coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-portable strace usage (was: [PATCH] tests: fix incorrect `|| fai


From: Dmitry V. Levin
Subject: Re: non-portable strace usage (was: [PATCH] tests: fix incorrect `|| fail` pattern in tests)
Date: Sun, 1 Mar 2020 06:44:26 +0300

On Sat, Feb 29, 2020 at 09:07:10PM +0000, Pádraig Brady wrote:
[...]
> diff --git a/tests/ls/stat-free-symlinks.sh b/tests/ls/stat-free-symlinks.sh
> index c538a1c51..a786145db 100755
> --- a/tests/ls/stat-free-symlinks.sh
> +++ b/tests/ls/stat-free-symlinks.sh
> @@ -32,7 +32,7 @@ ln -s x link-to-x || framework_failure_
>  # symlink and an executable file properly.
>  
>  LS_COLORS='or=0:mi=0:ex=01;32:ln=01;35' \
> -  strace -qe stat ls -F --color=always x link-to-x > out.tmp 2> err || fail
> +  strace -qe stat ls -F --color=always x link-to-x > out.tmp 2> err || fail=1
>  # Elide info messages strace can send to stdout of the form:
>  #   [ Process PID=1234 runs in 32 bit mode. ]
>  sed '/Process PID=/d' out.tmp > out

This caught my eye because "strace -e stat" is not portable:
while traditional architectures have stat syscall, more recent
architectures don't have it and the test will fail there.

Also this test is going to be missing the point on traditional
architectures as soon as their libc switch to newfstatat/fstatat64/statx.


-- 
ldv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]