mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-21 21:46: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
|
||||
|
||||
failed=0
|
||||
messages="`nix-build -Q timeout.nix -A infiniteLoop --timeout 2 2>&1 || failed=1`"
|
||||
if [ $failed -ne 0 ]; then
|
||||
echo "error: 'nix-store' succeeded; should have timed out"
|
||||
|
||||
set +e
|
||||
messages=$(nix-build -Q timeout.nix -A infiniteLoop --timeout 2 2>&1)
|
||||
status=$?
|
||||
set -e
|
||||
|
||||
if [ $status -ne 101 ]; then
|
||||
echo "error: 'nix-store' exited with '$status'; should have exited 101"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue