]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: don't fail on systems without a "stat" syscall
authorJim Meyering <meyering@redhat.com>
Mon, 14 Apr 2008 21:33:43 +0000 (23:33 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 14 Apr 2008 21:33:43 +0000 (23:33 +0200)
* tests/test-lib.sh (require_strace_): Add a syscall parameter.
* tests/ls/stat-free-symlinks: Update caller.
* tests/mv/atomic: Likewise.
* tests/mv/atomic2: Likewise.
Reported by Mike Frysinger in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13222

tests/ls/stat-free-symlinks
tests/mv/atomic
tests/mv/atomic2
tests/test-lib.sh

index 07fb38e31a697be20d1f32891811be2a1f545050..85f363f0c3b68ea95a07071d2f678932ba5e0ca4 100755 (executable)
@@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../test-lib.sh
-require_strace_
+require_strace_ stat
 
 touch x || framework_failure
 chmod a+x x || framework_failure
index 38e98a5a2be1afa98d30cd1203881c3587aceede..5eadb958f2591b7f6ce5421ba4938e53519eeaee 100755 (executable)
@@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../test-lib.sh
-require_strace_
+require_strace_ unlink
 
 # Before the fix, mv would unnecessarily unlink the destination symlink:
 #   $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2; strace -qe unlink /bin/mv -T s1 s2
index d1029aa9c7c462563e319070263f966e90a03885..fe205b46d2f7c86f003ed7c08d8c0210178ff7c2 100755 (executable)
@@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../test-lib.sh
-require_strace_
+require_strace_ unlink
 
 # Before the fix, mv would unnecessarily unlink the destination symlink:
 #   $ rm -f a b b2; touch a b; ln b b2; strace -e unlink /p/bin/mv a b
index 9e04cfad62bfb7fd84de41532f3c199ba3457abf..ebc6a7cfc8f572d212a5b25c0dc560577881fbcb 100644 (file)
@@ -44,14 +44,17 @@ require_readable_root_()
   test -r / || skip_test_ "/ is not readable"
 }
 
-# Skip the current test if strace is not available or doesn't work.
+# Skip the current test if strace is not available or doesn't work
+# with the named syscall.  Usage: require_strace_ unlink
 require_strace_()
 {
+  test $# = 1 || framework_failure
+
   strace -V < /dev/null > /dev/null 2>&1 ||
     skip_test_ 'no strace program'
 
-  strace -qe unlink echo > /dev/null 2>&1 ||
-    skip_test_ 'strace does not work'
+  strace -qe "$1" echo > /dev/null 2>&1 ||
+    skip_test_ 'strace -qe "'"$1"'" does not work'
 }
 
 require_built_()