mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
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.
This commit is contained in:
1 parent
111a2b91da
commit
840da8a7c6
6 files changed
+13
-12
No files matched your search
@@ -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("/")
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user