mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-07-26 02:30:35 +02:00
tests: stat-free-color: accommodate stat of /selinux on rawhide
* tests/ls/stat-free-color: This test recently began to fail on rawhide because dynamic library start-up code now stats "/selinux", making the total number of calls 2 rather than the prior 1. Create two more dangling symlinks, so that any erroneous stat- or lstat-calling code will get at least those three.
This commit is contained in:
@@ -21,7 +21,9 @@ print_ver_ ls
|
|||||||
require_strace_ stat
|
require_strace_ stat
|
||||||
require_dirent_d_type_
|
require_dirent_d_type_
|
||||||
|
|
||||||
ln -s nowhere dangle || framework_failure_
|
for i in 1 2 3; do
|
||||||
|
ln -s nowhere dangle-$i || framework_failure_
|
||||||
|
done
|
||||||
|
|
||||||
# Disable enough features via LS_COLORS so that ls --color
|
# Disable enough features via LS_COLORS so that ls --color
|
||||||
# can do its job without calling stat (other than the obligatory
|
# can do its job without calling stat (other than the obligatory
|
||||||
@@ -49,6 +51,11 @@ eval $(dircolors -b color-without-stat)
|
|||||||
|
|
||||||
strace -o log -e stat,lstat,stat64,lstat64 ls --color=always . || fail=1
|
strace -o log -e stat,lstat,stat64,lstat64 ls --color=always . || fail=1
|
||||||
n_lines=$(wc -l < log)
|
n_lines=$(wc -l < log)
|
||||||
test $n_lines = 1 || fail=1
|
|
||||||
|
# Expect one or two stat calls.
|
||||||
|
case $n_lines in
|
||||||
|
1|2) ;;
|
||||||
|
*) fail=1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
Exit $fail
|
Exit $fail
|
||||||
|
|||||||
Reference in New Issue
Block a user