summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-10-29 14:32:01 +0000
committerPádraig Brady <P@draigBrady.com>2014-10-30 00:06:11 +0000
commit840da8a7c684ee3cf89394435185a978a910b026 (patch)
tree2468d9a36770bdd6435ace07445dc04946179f22
parent111a2b91da142bf6fb9edb7836c1979ba698cf6e (diff)
downloadcoreutils-840da8a7c684ee3cf89394435185a978a910b026.tar.xz
maint: tests: fix comments about retry_delay_
* tests/tail-2/F-vs-missing.sh: Comment with the correct total delay. * tests/tail-2/F-vs-rename.shi: Likewise. * tests/tail-2/flush-initial.sh: Likewise. * tests/tail-2/inotify-hash-abuse.sh: Likewise. * tests/tail-2/pipe-f2.sh: Likewise. * tests/misc/chroot-fail.sh: Initialize can_chroot_root in all cases.
-rwxr-xr-xtests/misc/chroot-fail.sh3
-rwxr-xr-xtests/tail-2/F-vs-missing.sh4
-rwxr-xr-xtests/tail-2/F-vs-rename.sh10
-rwxr-xr-xtests/tail-2/flush-initial.sh2
-rwxr-xr-xtests/tail-2/inotify-hash-abuse.sh4
-rwxr-xr-xtests/tail-2/pipe-f2.sh2
6 files changed, 13 insertions, 12 deletions
diff --git a/tests/misc/chroot-fail.sh b/tests/misc/chroot-fail.sh
index 75f724a87..29006e07f 100755
--- a/tests/misc/chroot-fail.sh
+++ b/tests/misc/chroot-fail.sh
@@ -40,6 +40,7 @@ if chroot / true ; then
test $? = 127 || fail=1
else
test $? = 125 || fail=1
+ can_chroot_root=0
fi
# Ensure that --skip-chdir fails with a non-"/" argument.
@@ -52,7 +53,7 @@ compare /dev/null out || fail=1
compare exp err || fail=1
# Ensure we chdir("/") appropriately when NEWROOT is old "/".
-if test "$can_chroot_root"; then
+if test $can_chroot_root = 1; then
ln -s / isroot || framework_failure_
for dir in '/' '/.' '/../' isroot; do
# Verify that chroot(1) succeeds and performs chdir("/")
diff --git a/tests/tail-2/F-vs-missing.sh b/tests/tail-2/F-vs-missing.sh
index d47b30229..5205d68b3 100755
--- a/tests/tail-2/F-vs-missing.sh
+++ b/tests/tail-2/F-vs-missing.sh
@@ -32,14 +32,14 @@ check_tail_output()
{ sleep $delay; return 1; }
}
-# Wait up to 6.3s for tail to start with diagnostic:
+# Wait up to 12.7s for tail to start with diagnostic:
# tail: cannot open 'missing/file' for reading: No such file or directory
tail_re='cannot open' retry_delay_ check_tail_output .1 7 || fail=1
mkdir missing || fail=1
(cd missing && echo x > file)
-# Wait up to 6.3s for this to appear in the output:
+# Wait up to 12.7s for this to appear in the output:
# "tail: '...' has appeared; following end of new file"
tail_re='has appeared' retry_delay_ check_tail_output .1 7 ||
{ echo "$0: file: unexpected delay?"; cat out; fail=1; }
diff --git a/tests/tail-2/F-vs-rename.sh b/tests/tail-2/F-vs-rename.sh
index 3e31ec8c3..c0fc76c18 100755
--- a/tests/tail-2/F-vs-rename.sh
+++ b/tests/tail-2/F-vs-rename.sh
@@ -34,24 +34,24 @@ check_tail_output()
{ sleep $delay; return 1; }
}
-# Wait up to 6.3s for tail to start
+# Wait up to 12.7s for tail to start
echo x > a
tail_re='^x$' retry_delay_ check_tail_output .1 7 || fail=1
mv a b || fail=1
-# Wait 6.3s for this diagnostic:
+# Wait 12.7s for this diagnostic:
# tail: 'a' has become inaccessible: No such file or directory
tail_re='inaccessible' retry_delay_ check_tail_output .1 7 || fail=1
echo x > a
-# Wait up to 6.3s for this to appear in the output:
+# Wait up to 12.7s for this to appear in the output:
# "tail: '...' has appeared; following end of new file"
tail_re='has appeared' retry_delay_ check_tail_output .1 7 ||
{ echo "$0: a: unexpected delay?"; cat out; fail=1; }
echo y >> b
-# Wait up to 6.3s for "y" to appear in the output:
+# Wait up to 12.7s for "y" to appear in the output:
tail_f_vs_rename_2() {
local delay="$1"
tr '\n' @ < out | grep '@@==> b <==@y@$' > /dev/null ||
@@ -61,7 +61,7 @@ retry_delay_ tail_f_vs_rename_2 .1 7 ||
{ echo "$0: b: unexpected delay?"; cat out; fail=1; }
echo z >> a
-# Wait up to 6.3s for "z" to appear in the output:
+# Wait up to 12.7s for "z" to appear in the output:
tail_f_vs_rename_3() {
local delay="$1"
tr '\n' @ < out | grep '@@==> a <==@z@$' > /dev/null ||
diff --git a/tests/tail-2/flush-initial.sh b/tests/tail-2/flush-initial.sh
index fd14eae90..29b94ac8d 100755
--- a/tests/tail-2/flush-initial.sh
+++ b/tests/tail-2/flush-initial.sh
@@ -25,7 +25,7 @@ echo line > in || fail=1
tail -f in > out &
tail_pid=$!
-# Wait for 1.5s for the file to be flushed.
+# Wait for 3.1s for the file to be flushed.
tail_flush()
{
local delay="$1"
diff --git a/tests/tail-2/inotify-hash-abuse.sh b/tests/tail-2/inotify-hash-abuse.sh
index 6492049dc..b47440e20 100755
--- a/tests/tail-2/inotify-hash-abuse.sh
+++ b/tests/tail-2/inotify-hash-abuse.sh
@@ -34,13 +34,13 @@ check_tail_output()
{ sleep $delay; return 1; }
}
-# Wait up to 6.3s for tail to start
+# Wait up to 12.7s for tail to start
echo x > $n
tail_re='^x$' retry_delay_ check_tail_output .1 7 || fail=1
mv 1 f || fail=1
-# Wait 6.3s for this diagnostic:
+# Wait 12.7s for this diagnostic:
# tail: '1' has become inaccessible: No such file or directory
tail_re='inaccessible' retry_delay_ check_tail_output .1 7 || fail=1
diff --git a/tests/tail-2/pipe-f2.sh b/tests/tail-2/pipe-f2.sh
index 13ccd0b39..471e9763a 100755
--- a/tests/tail-2/pipe-f2.sh
+++ b/tests/tail-2/pipe-f2.sh
@@ -32,7 +32,7 @@ check_tail_output()
test -s out || { sleep $n_sec; return 1; }
}
-# Wait 6.3s for tail to write something.
+# Wait 12.7s for tail to write something.
retry_delay_ check_tail_output .1 7 || fail=1
compare exp out || fail=1