From 43d9fbac1f7181d5e178250e6df5b2a8860abbb5 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 25 Jun 2020 14:18:30 +0200 Subject: [PATCH] tests/bracket.sh: disable 'test -N' tests due to noatime mounts src/cmd/ksh93/tests/bracket.sh: - Disable tests for [[ -N ... ]] (test -N ...), because it is expected to break on systems where $TMPDIR (or even the entire root file system) is mounted with noatime for better performance. Ref.: https://opensource.com/article/20/6/linux-noatime (It also needs annoyingly long sleep times on older systems with a 1-second timestamp granularity.) --- src/cmd/ksh93/tests/bracket.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/ksh93/tests/bracket.sh b/src/cmd/ksh93/tests/bracket.sh index e26d7495f..7447aa5f5 100755 --- a/src/cmd/ksh93/tests/bracket.sh +++ b/src/cmd/ksh93/tests/bracket.sh @@ -232,6 +232,12 @@ done [[ abcdcdabcde == {5}(ab|cd)e ]] || err_exit 'abcdcdabcd == {5}(ab|cd)e' ) || err_exit 'errors with {..}(...) patterns' [[ D290.2003.02.16.temp == D290.+(2003.02.16).temp* ]] || err_exit 'pattern match bug with +(...)' + +# Tests for [[ -N ... ]] (test -N ...) are disabled because it is expected to break on systems where +# $TMPDIR (or even the entire root file system) is mounted with noatime for better performance. +# Ref.: https://opensource.com/article/20/6/linux-noatime +# (It also needs annoyingly long sleep times on older systems with a 1-second timestamp granularity.) +: <<\end_disabled rm -rf $file { [[ -N $file ]] && err_exit 'test -N $tmp/*: st_mtime>st_atime after creat' @@ -242,6 +248,8 @@ sleep .02 read [[ -N $file ]] && err_exit 'test -N $tmp/*: st_mtime>st_atime after read' } > $file < $file +end_disabled + if rm -rf "$file" && ln -s / "$file" then [[ -L "$file" ]] || err_exit '-L not working' [[ -L "$file"/ ]] && err_exit '-L with file/ not working'