Check for exit status of tests
This commit is contained in:
@@ -11,3 +11,6 @@ set -o nounset
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
timeout --kill-after=3s 1s ./mgmt --help # hello world!
|
timeout --kill-after=3s 1s ./mgmt --help # hello world!
|
||||||
|
pid=$!
|
||||||
|
wait $pid # get exit status
|
||||||
|
exit $?
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ fi
|
|||||||
|
|
||||||
# run till completion
|
# run till completion
|
||||||
timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch &
|
||||||
|
pid=$!
|
||||||
. wait.sh # wait for mgmt
|
wait $pid # get exit status
|
||||||
|
e=$?
|
||||||
|
|
||||||
test -e /tmp/mgmt/f1
|
test -e /tmp/mgmt/f1
|
||||||
test -e /tmp/mgmt/f2
|
test -e /tmp/mgmt/f2
|
||||||
test -e /tmp/mgmt/f3
|
test -e /tmp/mgmt/f3
|
||||||
test ! -e /tmp/mgmt/f4
|
test ! -e /tmp/mgmt/f4
|
||||||
|
|
||||||
|
exit $e
|
||||||
|
|||||||
@@ -11,10 +11,18 @@ mkdir -p "${MGMT_TMPDIR}"mgmt{A..C}
|
|||||||
|
|
||||||
# run till completion
|
# run till completion
|
||||||
timeout --kill-after=15s 10s ./mgmt run --file t3-a.yaml --converged-timeout=5 --no-watch &
|
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 &
|
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 &
|
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
|
# A: collected
|
||||||
test -e "${MGMT_TMPDIR}"mgmtA/f3b
|
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/f2a
|
||||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f1b
|
test ! -e "${MGMT_TMPDIR}"mgmtC/f1b
|
||||||
test ! -e "${MGMT_TMPDIR}"mgmtC/f2b
|
test ! -e "${MGMT_TMPDIR}"mgmtC/f2b
|
||||||
|
|
||||||
|
exit $(($e1+$e2+$e3))
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
# should take slightly more than 25s, but fail if we take 35s)
|
# 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 &
|
timeout --kill-after=35s 30s ./mgmt run --file t4.yaml --converged-timeout=5 --no-watch &
|
||||||
|
pid=$!
|
||||||
. wait.sh # wait for mgmt
|
wait $pid # get exit status
|
||||||
|
exit $?
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
# should take slightly more than 35s, but fail if we take 45s)
|
# 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 &
|
timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch &
|
||||||
|
pid=$!
|
||||||
. wait.sh # wait for mgmt
|
wait $pid # get exit status
|
||||||
|
exit $?
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ fi
|
|||||||
|
|
||||||
# run till completion
|
# run till completion
|
||||||
timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch &
|
timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch &
|
||||||
|
pid=$!
|
||||||
sleep 1s # let it converge
|
sleep 1s # let it converge
|
||||||
test -e /tmp/mgmt/f1
|
test -e /tmp/mgmt/f1
|
||||||
test -e /tmp/mgmt/f2
|
test -e /tmp/mgmt/f2
|
||||||
@@ -28,4 +29,5 @@ test -e /tmp/mgmt/f2
|
|||||||
|
|
||||||
killall -SIGINT mgmt # send ^C to exit mgmt
|
killall -SIGINT mgmt # send ^C to exit mgmt
|
||||||
|
|
||||||
. wait.sh # wait for mgmt
|
wait $pid # get exit status
|
||||||
|
exit $?
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user