diff --git a/Regression/RHEL-1843-capsh-print-all/PURPOSE b/Regression/RHEL-1843-capsh-print-all/PURPOSE new file mode 100644 index 0000000..12b4cd1 --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-all/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/libcap/Regression/RHEL-1843-capsh-print-all +Description: This test verifies that the `capsh --print` command correctly uses the keywords 'all' and 'none' to represent full and empty capability sets, respectively. This addresses the ambiguity in the previous output format. +Author: QE Automation +Bug: https://issues.redhat.com/browse/RHEL-1843 diff --git a/Regression/RHEL-1843-capsh-print-all/main.fmf b/Regression/RHEL-1843-capsh-print-all/main.fmf new file mode 100644 index 0000000..fca647e --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-all/main.fmf @@ -0,0 +1,18 @@ +summary: Test for RHEL-1843 - capsh --print should use 'all' and 'none' for capabilities +description: | + Bug: https://issues.redhat.com/browse/RHEL-1843 + This test verifies that the `capsh --print` command uses the keywords 'all' + and 'none' to represent full or empty capability sets, as requested by the RFE. +contact: QE Automation +test: ./runtest.sh +framework: beakerlib +recommend: + - libcap +duration: 5m +tag: + - Tier1 + - Tier2 +adjust: + - enabled: false + when: distro < rhel-9.9 + continue: false diff --git a/Regression/RHEL-1843-capsh-print-all/runtest.sh b/Regression/RHEL-1843-capsh-print-all/runtest.sh new file mode 100644 index 0000000..878d9e3 --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-all/runtest.sh @@ -0,0 +1,26 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup "Setup" + rlAssertRpm "libcap" + rlPhaseEnd + + rlPhaseStartTest "Test capsh --print output for full capabilities" + # Run as root to ensure all capabilities are initially set + rlRun "capsh --print" + rlAssertGrep "Current: all=ep" "$rlRun_LOG" "Check for 'all' in Current capabilities" + rlAssertGrep "Bounding set: all" "$rlRun_LOG" "Check for 'all' in Bounding set" + rlPhaseEnd + + rlPhaseStartTest "Test capsh --print output for empty capabilities" + # Switch to a non-root user to have empty capabilities + rlRun "su - nobody -s /bin/bash -c 'capsh --print'" + rlAssertGrep "Current: =" "$rlRun_LOG" "Check for empty Current capabilities" + rlAssertNotGrep "all" "$rlRun_LOG" "Ensure 'all' is not present for empty capabilities" + rlPhaseEnd + + rlPhaseStartCleanup "Cleanup" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/RHEL-1843-capsh-print-output/PURPOSE b/Regression/RHEL-1843-capsh-print-output/PURPOSE new file mode 100644 index 0000000..28302c8 --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-output/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/libcap/Regression/RHEL-1843-capsh-print-output +Description: This test verifies the improved output of the `capsh --print` command as requested in RHEL-1843. +Author: QE Automation +Bug: https://issues.redhat.com/browse/RHEL-1843 diff --git a/Regression/RHEL-1843-capsh-print-output/main.fmf b/Regression/RHEL-1843-capsh-print-output/main.fmf new file mode 100644 index 0000000..e80e680 --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-output/main.fmf @@ -0,0 +1,19 @@ +summary: Test for RHEL-1843 - Improve capabilities presentation layer for capsh --print command +description: | + Bug: https://issues.redhat.com/browse/RHEL-1843 + This test verifies that the `capsh --print` command output is improved as per the RFE. + It checks that "all=ep" is printed instead of "=ep", and that the "Bounding set" + and "Ambient set" are printed correctly when all capabilities are set. +contact: QE Automation +test: ./runtest.sh +framework: beakerlib +recommend: + - libcap +duration: 5m +tag: + - rhel-9 + - libcap +adjust: + - enabled: false + when: distro < rhel-9.9 + continue: false diff --git a/Regression/RHEL-1843-capsh-print-output/runtest.sh b/Regression/RHEL-1843-capsh-print-output/runtest.sh new file mode 100644 index 0000000..8973a5a --- /dev/null +++ b/Regression/RHEL-1843-capsh-print-output/runtest.sh @@ -0,0 +1,27 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup "Setup" + rlAssertRpm "libcap" + rlPhaseEnd + + rlPhaseStartTest "Verify capsh --print output with all capabilities" + # Run capsh --print and capture the output + rlRun "capsh --print > capsh_output.txt" 0 "Run capsh --print" + + # Verify 'Current: all=ep' + rlAssertGrep "Current: all=ep" capsh_output.txt "Check for 'Current: all=ep'" + + # Verify 'Bounding set: all' + rlAssertGrep "Bounding set: all" capsh_output.txt "Check for 'Bounding set: all'" + + # Verify 'Ambient set: none' + rlAssertGrep "Ambient set: none" capsh_output.txt "Check for 'Ambient set: none'" + rlPhaseEnd + + rlPhaseStartCleanup "Cleanup" + rlRun "rm -f capsh_output.txt" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/RHEL-1843-improve-capsh-print-output/PURPOSE b/Regression/RHEL-1843-improve-capsh-print-output/PURPOSE new file mode 100644 index 0000000..fad89a0 --- /dev/null +++ b/Regression/RHEL-1843-improve-capsh-print-output/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/libcap/Regression/RHEL-1843-improve-capsh-print-output +Description: This test verifies the improved output of the `capsh --print` command as requested in RHEL-1843. It ensures that when all capabilities are set, the output is clear and not misleading, using keywords like "all" and "none". +Author: QE Automation +Bug: https://issues.redhat.com/browse/RHEL-1843 diff --git a/Regression/RHEL-1843-improve-capsh-print-output/main.fmf b/Regression/RHEL-1843-improve-capsh-print-output/main.fmf new file mode 100644 index 0000000..9cfe978 --- /dev/null +++ b/Regression/RHEL-1843-improve-capsh-print-output/main.fmf @@ -0,0 +1,20 @@ +summary: Test for RHEL-1843 - Improve capabilities presentation layer for capsh --print command +description: | + Bug: https://issues.redhat.com/browse/RHEL-1843 + Verify that the `capsh --print` command provides a more intuitive and + explicit output when all capabilities are set. The test checks that the + output uses keywords like "all" and "none" to avoid misinterpretation. +contact: QE Automation +test: ./runtest.sh +framework: beakerlib +recommend: + - libcap +duration: 5m +tag: + - Tier1 + - CI-Tier-1 + - libcap +adjust: + - enabled: false + when: distro < rhel-9.9 + continue: false diff --git a/Regression/RHEL-1843-improve-capsh-print-output/runtest.sh b/Regression/RHEL-1843-improve-capsh-print-output/runtest.sh new file mode 100644 index 0000000..649b1af --- /dev/null +++ b/Regression/RHEL-1843-improve-capsh-print-output/runtest.sh @@ -0,0 +1,27 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup "Setup" + rlAssertRpm "libcap" + rlPhaseEnd + + rlPhaseStartTest "Test capsh --print output with full capabilities" + # Run capsh --print and capture the output + rlRun "capsh --print" + + # Verify that "Current" shows "all=ep" + rlAssertGrep "Current: all=ep" "$rlRun_LOG" "Check for 'Current: all=ep'" + + # Verify that "Bounding set" shows "all" + rlAssertGrep "Bounding set: all" "$rlRun_LOG" "Check for 'Bounding set: all'" + + # Verify that "Ambient set" shows "none" + rlAssertGrep "Ambient set: none" "$rlRun_LOG" "Check for 'Ambient set: none'" + rlPhaseEnd + + rlPhaseStartCleanup "Cleanup" + # No cleanup needed + rlPhaseEnd +rlJournalPrintText +rlJournalEnd