mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
timeout: test for error code
This commit is contained in:
parent
a52c331edb
commit
68bdd83dc8
1 changed files with 8 additions and 4 deletions
|
@ -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