]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: kill background tasks when config test exits
authorPetr Špaček <petr.spacek@nic.cz>
Mon, 17 Aug 2020 12:24:19 +0000 (14:24 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 24 Aug 2020 08:13:05 +0000 (10:13 +0200)
In theory there should be no background task but we need cleanup in case
kresd gets into infinite loop or something like that.

scripts/test-config.sh

index 25f2662f3c1a8634cb833222b004532f45a4a7a3..3ae6c3aaeb548ca34947431ccf432c525d6d7ba2 100755 (executable)
@@ -13,6 +13,7 @@ TEST_DIR="$(dirname ${TEST_FILE})"
 TMP_RUNDIR="$(mktemp -d)"
 
 function finish {
+    kill -s 9 $(jobs -p) || :
     rm -rf "${TMP_RUNDIR}"
 }
 trap finish EXIT