summaryrefslogtreecommitdiff
path: root/tests/cp/no-ctx.sh
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-06-25 13:21:28 +0100
committerPádraig Brady <P@draigBrady.com>2015-06-25 13:41:24 +0100
commit1d82751e2ca03084db4cb06c0b4eaf73036082d8 (patch)
tree04e6e03035b745632a22458a3351d5ea6337dc80 /tests/cp/no-ctx.sh
parent381b797784b050f4eafc0dd4b6f070f2d1465f98 (diff)
downloadcoreutils-1d82751e2ca03084db4cb06c0b4eaf73036082d8.tar.xz
tests: avoid false failures with LD_PRELOAD=libasan.so.2
The LD_PRELOAD checks by -fsanitize=address are overly strict: https://groups.google.com/forum/#!topic/address-sanitizer/jEvOJgkDqQk A workaround is to first export LD_PRELOAD=libasan.so.2 The tests below are adjusted so that workaround is not discarded. * tests/cp/no-ctx.sh: Append to $LD_PRELOAD. * tests/df/no-mtab-status.sh: Likewise. * tests/df/skip-duplicates.sh: Likewise. * tests/ls/getxattr-speedup.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/cp/nfs-removal-race.sh: Likewise. Also check that LD_PRELOAD is effective to aid future maintainability and avoid false failure if libasan.so.2 is not preloaded.
Diffstat (limited to 'tests/cp/no-ctx.sh')
-rwxr-xr-xtests/cp/no-ctx.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/cp/no-ctx.sh b/tests/cp/no-ctx.sh
index 377d203b0..852b8e641 100755
--- a/tests/cp/no-ctx.sh
+++ b/tests/cp/no-ctx.sh
@@ -50,14 +50,14 @@ gcc_shared_ k.c k.so \
touch file_src
# New file with SELinux context optionally included
-LD_PRELOAD=./k.so cp -a file_src file_dst || fail=1
+LD_PRELOAD=$LD_PRELOAD:./k.so cp -a file_src file_dst || fail=1
# Existing file with SELinux context optionally included
-LD_PRELOAD=./k.so cp -a file_src file_dst || fail=1
+LD_PRELOAD=$LD_PRELOAD:./k.so cp -a file_src file_dst || fail=1
# ENODATA should give an immediate error when required to preserve ctx
# This is debatable, and maybe we should not fail when no context available?
-( export LD_PRELOAD=./k.so
+( export LD_PRELOAD=$LD_PRELOAD:./k.so
returns_ 1 cp --preserve=context file_src file_dst ) || fail=1
test -e preloaded || skip_ 'LD_PRELOAD interception failed'