diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-01-19 15:51:00 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-01-19 16:09:09 +0000 |
commit | b4f10133bf8995f55c7ce56d6828b4a3efdda046 (patch) | |
tree | 9fe4fed07c4df20a820fcd3bbbbd908080ec4b54 | |
parent | f0dc5ec6f95f7af971024cb1e8a49922e4187f4b (diff) | |
download | coreutils-b4f10133bf8995f55c7ce56d6828b4a3efdda046.tar.xz |
tests: avoid false failure in preserve-slink-time.sh on GPFS
* tests/cp/preserve-slink-time.sh: Add a delay between the
ln and the cp so that there is enough difference between
the timestamps so GPFS won't discard the update.
Reported by Assaf Gordon.
-rwxr-xr-x | tests/cp/preserve-slink-time.sh | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/cp/preserve-slink-time.sh b/tests/cp/preserve-slink-time.sh index 6c1835c38..3054d7913 100755 --- a/tests/cp/preserve-slink-time.sh +++ b/tests/cp/preserve-slink-time.sh @@ -31,11 +31,21 @@ case $(stat --format=%y dangle) in ??:??:??.000000000) sleep 2;; esac -# Can't use --format=%x, as lstat() modifies atime on some platforms. -cp -Pp dangle d2 || framework_failure_ -stat --format=%y dangle > t1 || framework_failure_ -stat --format=%y d2 > t2 || framework_failure_ - -compare t1 t2 || fail=1 +copy_timestamp_() { + sleep $1 + rm -f d2 + cp -Pp dangle d2 || framework_failure_ + # Can't use --format=%x, as lstat() modifies atime on some platforms. + stat --format=%y dangle > t1 || framework_failure_ + stat --format=%y d2 > t2 || framework_failure_ + compare t1 t2 +} + +# We retry with a delay at least 1.5s because on GPFS +# it was seen that the timestamp wasn't updated unless there +# was sufficient delay between the ln and cp. +# I.e., if there wasn't sufficient difference in +# the timestamp being updated, the update was discarded. +retry_delay_ copy_timestamp_ .1 4 || fail=1 Exit $fail |