system-tests: switch ls with getfattr for selinux tests

The test `podman selinux: check unsupported relabel` has been failing
recently on Fedora rawhide.

This is due to a regression in the `ls` command itself. Workaround for
now is to switch to `getfattr -n security.selinux ...`.

Ref: https://github.com/containers/podman/issues/25132#issuecomment-2615744915

Fixes: #25132

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar
2025-01-27 18:38:15 +05:30
parent c76c13f179
commit 06c103469d

View File

@ -384,20 +384,21 @@ EOF
mount --type tmpfs -o "context=\"$LABEL\"" tmpfs $tmpdir
run ls -dZ ${tmpdir}
is "$output" "${LABEL} ${tmpdir}" "No Relabel Correctly"
run getfattr --only-values --absolute-names -n security.selinux ${tmpdir}
is "$output" "${LABEL}" "No Relabel Correctly"
run_podman run --rm -v $tmpdir:/test:z --privileged $IMAGE true
run ls -dZ $tmpdir
is "$output" "${LABEL} $tmpdir" "Ignored shared relabel Correctly"
run getfattr --only-values --absolute-names -n security.selinux ${tmpdir}
is "$output" "${LABEL}" "Ignored shared relabel Correctly"
run_podman run --rm -v $tmpdir:/test:Z --privileged $IMAGE true
run ls -dZ $tmpdir
is "$output" "${LABEL} $tmpdir" "Ignored private relabel Correctly"}
run getfattr --only-values --absolute-names -n security.selinux ${tmpdir}
is "$output" "${LABEL}" "Ignored private relabel Correctly"
umount $tmpdir
run_podman run --rm -v $tmpdir:/test:z --privileged $IMAGE true
run ls -dZ $tmpdir
is "$output" "${RELABEL} $tmpdir" "Ignored private relabel Correctly"}
run getfattr --only-values --absolute-names -n security.selinux ${tmpdir}
is "$output" "${RELABEL}" "Ignored private relabel Correctly"
}
# vim: filetype=sh