From: Pádraig Brady
Date: Tue, 19 Jan 2016 15:51:00 +0000 (+0000) Subject: tests: avoid false failure in preserve-slink-time.sh on GPFS X-Git-Tag: v8.25~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4f10133bf8995f55c7ce56d6828b4a3efdda046;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/tests/cp/preserve-slink-time.sh b/tests/cp/preserve-slink-time.sh index 6c1835c386..3054d79134 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