python3.10-http-server: Add test scripts#90
Conversation
- build/: scripts for building the image using defconfigs. - defconfig/: minimal Unikraft configuration files. - run/: scripts for running images and rootfs generation. - README.md: instructions for the automation scripts. Signed-off-by: Arghir Elisa-Elena <arghirelisaelena@gmail.com>
c09a911 to
46766ac
Compare
Add scripts/test/ for python3.10-http-server/: - README.md: instructions to run the tests - common.sh: common functions and variables for test scripts - single.sh: test an instance started beforehand - wrapper.sh: wrapper over single.sh that also starts an instance - all.sh: test all configurations Signed-off-by: Arghir Elisa-Elena <arghirelisaelena@gmail.com>
46766ac to
82cc741
Compare
There was a problem hiding this comment.
Aside from these suggestions, also implement the changes I suggested on your other PR. I have not included them here.
| test -d ./scripts/test/log || mkdir ./scripts/test/log | ||
|
|
||
| test_build_run qemu.x86_64 127.0.0.1 8080 | ||
| test_build_run qemu.arm64 127.0.0.1 18080 |
There was a problem hiding this comment.
Change the port number from 18080 to 8080, I think it's a typo.
| test_build_run fc.x86_64 172.44.0.2 8080 | ||
| test_build fc.arm64 | ||
| test_build xen.x86_64 | ||
| test_build xen.arm64 |
There was a problem hiding this comment.
These 3 lines should all be test_build_run <plat>.<arch> <host> <port>, so
test_build_run fc.arm64 172.44.0.2 8080
test_build_run xen.x86_64 127.0.0.1 8080
test_build_run xen.arm64 127.0.0.1 8080
| echo "Using as remote $host:$port" 1>&2 | ||
|
|
||
| test_curl_connect "$host" "$port" | ||
| test_curl_check_reply "$host" "$port" "Directory listing" |
There was a problem hiding this comment.
This check will always fail, because the check string is wrong.
Instead of "Directory listing" it should be "Hello, World!", because that's what the server returns after a GET request.
| test_curl_connect "$host" "$port" | ||
| test_curl_check_reply "$host" "$port" "Directory listing" | ||
|
|
||
| end_with_success |
There was a problem hiding this comment.
This end_with_success is redundant, it makes the output include an extra PASSED message. The first one is printed by wrapper.sh, so there is no need for this one.
|
|
||
| clean_up | ||
| start_instance | ||
| sleep 10 |
There was a problem hiding this comment.
From what I tested, sleep 10 is not enough for the server to properly initialize, so the curl check will almost always fail. Increase it to 15 or higher.
| And then query it with the `single.sh` script: | ||
|
|
||
| ```console | ||
| ./single.sh |
There was a problem hiding this comment.
Include the path from the application directory:
./scripts/test/single.sh
Running single.sh from the test drectory will fail because it will not find the auxiliary script common.sh, it uses a relative path.
Add scripts/test/ directory with scripts used for testing: