Check for exit status of tests

This commit is contained in:
James Shubin
2016-08-10 08:51:38 -04:00
parent 4ca98b5f17
commit 0c7b05b233
7 changed files with 28 additions and 16 deletions

View File

@@ -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 $?

View File

@@ -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

View File

@@ -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))

View File

@@ -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 $?

View File

@@ -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 $?

View File

@@ -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 $?

View File

@@ -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