summaryrefslogtreecommitdiff
path: root/tests/misc/chroot-fail.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/chroot-fail.sh')
-rwxr-xr-xtests/misc/chroot-fail.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/misc/chroot-fail.sh b/tests/misc/chroot-fail.sh
index bb840c731..48c6769a7 100755
--- a/tests/misc/chroot-fail.sh
+++ b/tests/misc/chroot-fail.sh
@@ -22,20 +22,15 @@ print_ver_ chroot pwd
# These tests verify exact status of internal failure; since none of
# them actually run a command, we don't need root privileges
-chroot # missing argument
-test $? = 125 || fail=1
-chroot --- / true # unknown option
-test $? = 125 || fail=1
+returns_ 125 chroot || fail=1 # missing argument
+returns_ 125 chroot --- / true || fail=1 # unknown option
# chroot("/") succeeds for non-root users on some systems, but not all.
if chroot / true ; then
can_chroot_root=1
- chroot / sh -c 'exit 2' # exit status propagation
- test $? = 2 || fail=1
- chroot / . # invalid command
- test $? = 126 || fail=1
- chroot / no_such # no such command
- test $? = 127 || fail=1
+ returns_ 2 chroot / sh -c 'exit 2' || fail=1 # exit status propagation
+ returns_ 126 chroot / . || fail=1# invalid command
+ returns_ 127 chroot / no_such || fail=1 # no such command
else
test $? = 125 || fail=1
can_chroot_root=0