summaryrefslogtreecommitdiff
path: root/tests/misc/sort-exit-early.sh
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:17:09 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:17:09 +0300
commitcc78bdc31749e9754120ae5a9d4849f4832b40a4 (patch)
tree4f9e3f2064e56651ed8d41ae9d8ce8b08fc5241b /tests/misc/sort-exit-early.sh
parent8425beb209e6fedf50bcdd934ced14dfa0d7b596 (diff)
parent71cd8e3a743046573744123777061b64881bf372 (diff)
downloadcoreutils-cc78bdc31749e9754120ae5a9d4849f4832b40a4.tar.gz
Merge tag 'upstream/8.24'
Upstream version 8.24 Conflicts: INSTALL Makefile.in aclocal.m4 build-aux/config.guess build-aux/config.rpath build-aux/config.sub build-aux/depcomp build-aux/missing build-aux/test-driver build-aux/texinfo.tex doc/coreutils.info doc/stamp-vti doc/version.texi gnulib-tests/Makefile.in po/Makefile.in.in
Diffstat (limited to 'tests/misc/sort-exit-early.sh')
-rwxr-xr-xtests/misc/sort-exit-early.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/misc/sort-exit-early.sh b/tests/misc/sort-exit-early.sh
index 2a70253e..c675503c 100755
--- a/tests/misc/sort-exit-early.sh
+++ b/tests/misc/sort-exit-early.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test 'sort' exits early on inaccessible inputs or output
-# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+# Copyright (C) 2012-2015 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,18 +20,18 @@
print_ver_ sort
skip_if_root_
+SORT_FAILURE=2
+
# Check output is writable before starting to sort
touch input
chmod a-w input
-timeout 10 sort -o input && fail=1
-test $? = 124 && fail=1
+returns_ $SORT_FAILURE timeout 10 sort -o input || fail=1
# Check all inputs are readable before starting to sort
# Also ensure the output isn't created in this case
touch output
chmod a-r output
-timeout 10 sort -o typo - output && fail=1
-test $? = 124 && fail=1
+returns_ $SORT_FAILURE timeout 10 sort -o typo - output || fail=1
test -e typo && fail=1
Exit $fail