]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix ERRORs and false FAILs on some platforms
authorPádraig Brady <P@draigBrady.com>
Tue, 29 Nov 2016 21:15:59 +0000 (21:15 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 29 Nov 2016 21:21:12 +0000 (21:21 +0000)
* tests/misc/ls-time.sh: Skip the test rather than ERROR
when `touch -m -d ...` fails (Hurd).
* tests/tail-2/follow-stdin.sh: Avoid false FAILs by ignoring
the variances in sterror output.
* tests/rm/rm-readdir-fail.sh: Likewise.  Also avoid ERRORs
on systems that don't define _D_EXACT_NAMELEN.

tests/misc/ls-time.sh
tests/rm/rm-readdir-fail.sh
tests/tail-2/follow-stdin.sh

index 09a0fc180a615e6097a977a3b0e252fdefab7fc6..709a0034c02ded8931a90345fa0fa0d9dc984c2c 100755 (executable)
@@ -71,7 +71,7 @@ In the output below, the date of last modification for 'a' should
 have been $t3.
 EOF
   ls --full -l a
-  framework_failure_
+  skip_ "touch -m -d '$t3' didn't work"
   ;;
 esac
 
index 91fb0f64906f547410ec6e34026d9f6b3f3df1f4..7ea7da8bee61a896d9d230f7b1c73bd44355ccbb 100755 (executable)
@@ -68,7 +68,7 @@ struct dirent *readdir (DIR *dirp)
       count++;
       d->d_name[0]='0'+count; d->d_name[1]='\0';
 #ifdef _DIRENT_HAVE_D_NAMLEN
-      _D_EXACT_NAMELEN(d)=2;
+      d->d_namlen = 2;
 #endif
       errno = 0;
       return d;
@@ -89,7 +89,7 @@ export READDIR_PARTIAL
 for READDIR_PARTIAL in '' '1'; do
   rm -f preloaded
   (export LD_PRELOAD=$LD_PRELOAD:./k.so
-   returns_ 1 rm -Rf dir 2>>err) || fail=1
+   returns_ 1 rm -Rf dir 2>>errt) || fail=1
   if ! test -f preloaded; then
     cat err
     skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
@@ -101,10 +101,10 @@ done
 # Second case is more general error where we fail immediately
 # (with ENOENT in this case but it could be anything).
 cat <<EOF > exp
-rm: cannot remove 'dir': Directory not empty
-rm: traversal failed: dir: No such file or directory
+rm: cannot remove 'dir'
+rm: traversal failed: dir
 EOF
-
+sed 's/\(rm:.*\):.*/\1/' errt > err || framework_failure_
 compare exp err || fail=1
 
 Exit $fail
index 3d51f600653270d665a0806b498cfa6638779876..51ce82b0e27b4f62a9e68fa57cd4854ccca9eddc 100755 (executable)
@@ -52,13 +52,14 @@ done
 
 
 # Before coreutils-8.26 this would induce an UMR under UBSAN
-returns_ 1 timeout 10 tail -f - <&- 2>err || fail=1
+returns_ 1 timeout 10 tail -f - <&- 2>errt || fail=1
 cat <<\EOF >exp || framework_failure_
-tail: cannot fstat 'standard input': Bad file descriptor
-tail: error reading 'standard input': Bad file descriptor
+tail: cannot fstat 'standard input'
+tail: error reading 'standard input'
 tail: no files remaining
-tail: -: Bad file descriptor
+tail: -
 EOF
+sed 's/\(tail:.*\):.*/\1/' errt > err || framework_failure_
 compare exp err || fail=1