New test, sanity selinux check

This commit is contained in:
Miloš Prchlík 2023-10-09 14:58:42 +02:00
commit 342537c95b
2 changed files with 46 additions and 0 deletions

View file

@ -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

20
tests/selinux-context/test.sh Executable file
View file

@ -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