diff --git a/tests/selinux-context/main.fmf b/tests/selinux-context/main.fmf new file mode 100644 index 0000000..7d3fa5a --- /dev/null +++ b/tests/selinux-context/main.fmf @@ -0,0 +1,26 @@ +summary: Verify selinux context of binutils files + +require+: + - policycoreutils + +link+: + - verifies: https://issues.redhat.com/browse/RHELPLAN-166055 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2232410 + - verifies: https://issues.redhat.com/browse/RHELPLAN-167156 + - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2236729 + +adjust+: + - when: collection is not defined + enabled: false + + - when: collection == gcc-toolset-11 + environment+: + COLLECTION_ROOT: /opt/rh/gcc-toolset-11/root + + - when: collection == gcc-toolset-12 + environment+: + COLLECTION_ROOT: /opt/rh/gcc-toolset-12/root + + - when: collection == gcc-toolset-13 + environment+: + COLLECTION_ROOT: /opt/rh/gcc-toolset-13/root diff --git a/tests/selinux-context/test.sh b/tests/selinux-context/test.sh new file mode 100755 index 0000000..deefe50 --- /dev/null +++ b/tests/selinux-context/test.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +. /usr/share/beakerlib/beakerlib.sh || exit 1 +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + rlPhaseEnd + + rlPhaseStartTest + rlRun -s "restorecon -Rvn $COLLECTION_ROOT" + rlRun "grep 'Would relabel' $rlRun_LOG" 1 + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd