summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/cp/cp-a-selinux.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cp/cp-a-selinux.sh b/tests/cp/cp-a-selinux.sh
index d000ee8f1..a889ad0a8 100755
--- a/tests/cp/cp-a-selinux.sh
+++ b/tests/cp/cp-a-selinux.sh
@@ -73,7 +73,8 @@ old_type_d=$(get_selinux_type c_d)
# and get the adjusted type for comparison
cp -a c Z1 || fail=1
cp -a c_d Z1_d || fail=1
-if restorecon Z1 Z1_d 2>/dev/null; then
+if restorecon Z1 Z1_d 2>restorecon.err \
+ && compare /dev/null restorecon.err; then
new_type_f=$(get_selinux_type Z1)
new_type_d=$(get_selinux_type Z1_d)