From 342537c95b76aaa3953ce501fffceb682ce33dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Mon, 9 Oct 2023 14:58:42 +0200 Subject: [PATCH] New test, sanity selinux check --- tests/selinux-context/main.fmf | 26 ++++++++++++++++++++++++++ tests/selinux-context/test.sh | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/selinux-context/main.fmf create mode 100755 tests/selinux-context/test.sh 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