aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-27 02:16:49 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-27 02:16:49 +0100
commit2b4ac9b580dcde28a428be2c5e662dc6c88ac054 (patch)
treed94deb509b1791aaed10587d33a54e12299e6372
parent79038a2a6d21681b99cafcfb712b3da7b32d663e (diff)
downloadgallery-2b4ac9b580dcde28a428be2c5e662dc6c88ac054.tar.gz
gallery-2b4ac9b580dcde28a428be2c5e662dc6c88ac054.tar.xz
gallery-2b4ac9b580dcde28a428be2c5e662dc6c88ac054.zip
Make the test script more robust
-rwxr-xr-xtest.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/test.sh b/test.sh
index a51aeb2..0f69676 100755
--- a/test.sh
+++ b/test.sh
@@ -15,6 +15,8 @@ cp -ra $HOME/Pictures/Anime $input
./gallery web $target :8080 &
web=$!
+trap "kill $web; wait $web" EXIT INT
+sleep 0.25
call() (curl http://localhost:8080/api/$1 -X POST --data-binary @-)
@@ -24,6 +26,3 @@ echo '{}' | call duplicates
echo '{}' | call orphans
echo '{"sha1":"d53fc82162fd19a6e7b92b401b08b7505dbf3dfd"}' | call info
echo '{"sha1":"9539d9895ab8c25d76c321b23b8a327801a496bb"}' | call similar
-
-kill $web || :
-wait $web