timeout: test for error code
This commit is contained in:
parent
a52c331edb
commit
68bdd83dc8
|
@ -2,10 +2,14 @@
|
||||||
|
|
||||||
source common.sh
|
source common.sh
|
||||||
|
|
||||||
failed=0
|
|
||||||
messages="`nix-build -Q timeout.nix -A infiniteLoop --timeout 2 2>&1 || failed=1`"
|
set +e
|
||||||
if [ $failed -ne 0 ]; then
|
messages=$(nix-build -Q timeout.nix -A infiniteLoop --timeout 2 2>&1)
|
||||||
echo "error: 'nix-store' succeeded; should have timed out"
|
status=$?
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ $status -ne 101 ]; then
|
||||||
|
echo "error: 'nix-store' exited with '$status'; should have exited 101"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue