diff --git a/test/shell/t1.sh b/test/shell/t1.sh index bffe2e72..4adfe46a 100755 --- a/test/shell/t1.sh +++ b/test/shell/t1.sh @@ -11,3 +11,6 @@ set -o nounset set -o pipefail timeout --kill-after=3s 1s ./mgmt --help # hello world! +pid=$! +wait $pid # get exit status +exit $? diff --git a/test/shell/t2.sh b/test/shell/t2.sh index a17c6f41..56ce776f 100755 --- a/test/shell/t2.sh +++ b/test/shell/t2.sh @@ -8,10 +8,13 @@ fi # run till completion timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch & - -. wait.sh # wait for mgmt +pid=$! +wait $pid # get exit status +e=$? test -e /tmp/mgmt/f1 test -e /tmp/mgmt/f2 test -e /tmp/mgmt/f3 test ! -e /tmp/mgmt/f4 + +exit $e diff --git a/test/shell/t3.sh b/test/shell/t3.sh index d71ea270..13790ec2 100755 --- a/test/shell/t3.sh +++ b/test/shell/t3.sh @@ -11,10 +11,18 @@ mkdir -p "${MGMT_TMPDIR}"mgmt{A..C} # run till completion timeout --kill-after=15s 10s ./mgmt run --file t3-a.yaml --converged-timeout=5 --no-watch & +pid1=$! timeout --kill-after=15s 10s ./mgmt run --file t3-b.yaml --converged-timeout=5 --no-watch & +pid2=$! timeout --kill-after=15s 10s ./mgmt run --file t3-c.yaml --converged-timeout=5 --no-watch & +pid3=$! -. wait.sh # wait for mgmt +wait $pid1 # get exit status +e1=$? +wait $pid2 # get exit status +e2=$? +wait $pid3 # get exit status +e3=$? # A: collected test -e "${MGMT_TMPDIR}"mgmtA/f3b @@ -69,3 +77,5 @@ test ! -e "${MGMT_TMPDIR}"mgmtC/f1a test ! -e "${MGMT_TMPDIR}"mgmtC/f2a test ! -e "${MGMT_TMPDIR}"mgmtC/f1b test ! -e "${MGMT_TMPDIR}"mgmtC/f2b + +exit $(($e1+$e2+$e3)) diff --git a/test/shell/t4.sh b/test/shell/t4.sh index 34231c24..e334004d 100755 --- a/test/shell/t4.sh +++ b/test/shell/t4.sh @@ -2,5 +2,6 @@ # should take slightly more than 25s, but fail if we take 35s) timeout --kill-after=35s 30s ./mgmt run --file t4.yaml --converged-timeout=5 --no-watch & - -. wait.sh # wait for mgmt +pid=$! +wait $pid # get exit status +exit $? diff --git a/test/shell/t5.sh b/test/shell/t5.sh index a3a8d656..9527b723 100755 --- a/test/shell/t5.sh +++ b/test/shell/t5.sh @@ -2,5 +2,6 @@ # should take slightly more than 35s, but fail if we take 45s) timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch & - -. wait.sh # wait for mgmt +pid=$! +wait $pid # get exit status +exit $? diff --git a/test/shell/t6.sh b/test/shell/t6.sh index 64e7674c..40222f0e 100755 --- a/test/shell/t6.sh +++ b/test/shell/t6.sh @@ -8,6 +8,7 @@ fi # run till completion timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch & +pid=$! sleep 1s # let it converge test -e /tmp/mgmt/f1 test -e /tmp/mgmt/f2 @@ -28,4 +29,5 @@ test -e /tmp/mgmt/f2 killall -SIGINT mgmt # send ^C to exit mgmt -. wait.sh # wait for mgmt +wait $pid # get exit status +exit $? diff --git a/test/shell/wait.sh b/test/shell/wait.sh deleted file mode 100644 index 86aab21d..00000000 --- a/test/shell/wait.sh +++ /dev/null @@ -1,8 +0,0 @@ -# NOTE: boiler plate to wait on mgmt; source with: . wait.sh; should NOT be +x -while test "`jobs -p`" != "" -do - for j in `jobs -p` - do - wait $j || continue # wait for mgmt job $j - done -done