diff options
author | Eric Blake <ebb9@byu.net> | 2010-01-08 12:01:08 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2010-01-12 06:00:05 -0700 |
commit | 39243f0ea8efc572e3206b5f0fca12696a52308e (patch) | |
tree | c1edfa1cd546e4fb9b73a99839bc27aab08a516b /tests/touch/no-dereference | |
parent | a4da48c4f54bae74ef167db41f65a6eab2ae6a37 (diff) | |
download | coreutils-39243f0ea8efc572e3206b5f0fca12696a52308e.tar.xz |
tests: avoid spurious failure on old kernel
* tests/touch/no-dereference: Skip test if utimensat doesn't
support symlinks.
Reported by Bernhard Voelker.
Diffstat (limited to 'tests/touch/no-dereference')
-rwxr-xr-x | tests/touch/no-dereference | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference index 7adacc409..c1a6748b5 100755 --- a/tests/touch/no-dereference +++ b/tests/touch/no-dereference @@ -48,8 +48,17 @@ grep '^#define HAVE_LUTIMES' "$CONFIG_HEADER" > /dev/null || skip_test_ 'this system lacks the utimensat function' # Changing time of dangling symlink is okay. -touch -h dangling || fail=1 -test -f nowhere && fail=1 +# Skip the test if this fails, but the error text corresponds to +# ENOSYS (possible with old kernel but new glibc). +touch -h dangling 2> err +case $? in + 0) test -f nowhere && fail=1 + test -s err && fail=1;; + 1) grep 'Function not implemented' err \ + && skip_test_ 'this system lacks the utimensat function' + fail=1;; + *) fail=1;; +esac # Change the mtime of a symlink. touch -m -h -d 2009-10-10 link || fail=1 |