* tests/cp/cp-mv-enotsup-xattr.sh: Don't hardcode "Operation not
supported".
* tests/cp/cp-a-selinux.sh: Likewise.
---
tests/cp/cp-a-selinux.sh | 5 +++--
tests/cp/cp-mv-enotsup-xattr.sh | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/cp/cp-a-selinux.sh b/tests/cp/cp-a-selinux.sh
index de7a854c6..970851e88 100755
--- a/tests/cp/cp-a-selinux.sh
+++ b/tests/cp/cp-a-selinux.sh
@@ -23,6 +23,7 @@
print_ver_ cp
require_root_
require_selinux_
+getlimits_
cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/mnt"; }
@@ -151,14 +152,14 @@ rm -f g
echo > g
cp --preserve=all ../f g 2>err || fail=1
test -s g || fail=1
-grep "Operation not supported" err && fail=1
+grep "$ENOTSUP" err && fail=1
# =====================================================
# The same as above except destination does not exist
rm -f g
cp --preserve=all ../f g 2>err || fail=1
test -s g || fail=1
-grep "Operation not supported" err && fail=1
+grep "$ENOTSUP" err && fail=1
# An alternative to the following approach would be to run in a confined
# domain (maybe creating/loading it) that lacks the required permissions
diff --git a/tests/cp/cp-mv-enotsup-xattr.sh b/tests/cp/cp-mv-enotsup-xattr.sh
index 4a31df837..8936b5c85 100755
--- a/tests/cp/cp-mv-enotsup-xattr.sh
+++ b/tests/cp/cp-mv-enotsup-xattr.sh
@@ -20,7 +20,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cp mv
-
+getlimits_
require_root_
cwd=$(pwd)
@@ -97,8 +97,8 @@ rm -f err noxattr/a
# This should fail with corresponding diagnostics
cp -a --preserve=xattr xattr/a noxattr/ 2>err && fail=1
if grep '^#define USE_XATTR 1' $CONFIG_HEADER > /dev/null; then
-cat <<\EOF > exp
-cp: setting attributes for 'noxattr/a': Operation not supported
+cat <<EOF > exp
+cp: setting attributes for 'noxattr/a': $ENOTSUP
EOF
else
cat <<\EOF > exp
--
2.52.0