diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-04-30 13:26:54 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-01 08:05:16 +0200 |
commit | d49b881eafe25c2efd2816d1ad6164c43e5896fa (patch) | |
tree | 5199f252f83e3013104b3e91f156a8747c56acf3 /test | |
parent | Merge pull request #19476 from yuwata/network-can (diff) | |
download | systemd-d49b881eafe25c2efd2816d1ad6164c43e5896fa.tar.xz systemd-d49b881eafe25c2efd2816d1ad6164c43e5896fa.zip |
test: fix a yet another pipefail + pipe race
Basically the same scenario as in
a33e2692e162671f0d97856ad2f49a2620a1ec10, where `awk` exits as soon
as it finds a match, thus sending SIGPIPE to `ldd` if it's not fast
enough. That, in combination with `set -o pipefail` causes random &
unexpected fails, like:
```
No journal files were found.
-rw-r----- 1 root root 16777216 Apr 30 10:31
/var/tmp/TEST-01-BASIC_sanitizers-nspawn/system.journal
TEST-01-BASIC RUN: Basic systemd setup [OK]
systemd is not linked against the ASan DSO
gcc does this by default, for clang compile with -shared-libasan
make: *** [Makefile:2: clean-again] Error 1
make: Leaving directory '/build/test/TEST-01-BASIC'
```
Diffstat (limited to 'test')
-rw-r--r-- | test/test-functions | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test-functions b/test/test-functions index 8bae7a9911..da1e20f492 100644 --- a/test/test-functions +++ b/test/test-functions @@ -227,10 +227,10 @@ if [[ "$IS_BUILT_WITH_ASAN" = "yes" ]]; then QEMU_SMP="${QEMU_SMP:-4}" # We need to correctly distinguish between gcc's and clang's ASan DSOs. - if ASAN_RT_NAME="$(ldd "$SYSTEMD" | awk '/libasan.so/ {x=$1; exit} END {print x; exit x==""}')"; then + if ASAN_RT_NAME="$(awk '/libasan.so/ {x=$1; exit} END {print x; exit x==""}' < <(ldd "$SYSTEMD"))"; then ASAN_COMPILER=gcc ASAN_RT_PATH="$(readlink -f "$(${CC:-gcc} --print-file-name "$ASAN_RT_NAME")")" - elif ASAN_RT_NAME="$(ldd "$SYSTEMD" | awk '/libclang_rt.asan/ {x=$1; exit} END {print x; exit x==""}')"; then + elif ASAN_RT_NAME="$(awk '/libclang_rt.asan/ {x=$1; exit} END {print x; exit x==""}' < <(ldd "$SYSTEMD"))"; then ASAN_COMPILER=clang ASAN_RT_PATH="$(readlink -f "$(${CC:-clang} --print-file-name "$ASAN_RT_NAME")")" |