Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Regression/RHEL-1843-capsh-print-all/PURPOSE
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
Bug: https://issues.redhat.com/browse/RHEL-1843
18 changes: 18 additions & 0 deletions Regression/RHEL-1843-capsh-print-all/main.fmf
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
test: ./runtest.sh
framework: beakerlib
recommend:
- libcap
duration: 5m
tag:
- Tier1
- Tier2
adjust:
- enabled: false
when: distro < rhel-9.9
continue: false
26 changes: 26 additions & 0 deletions Regression/RHEL-1843-capsh-print-all/runtest.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions Regression/RHEL-1843-capsh-print-output/PURPOSE
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
Bug: https://issues.redhat.com/browse/RHEL-1843
19 changes: 19 additions & 0 deletions Regression/RHEL-1843-capsh-print-output/main.fmf
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
test: ./runtest.sh
framework: beakerlib
recommend:
- libcap
duration: 5m
tag:
- rhel-9
- libcap
adjust:
- enabled: false
when: distro < rhel-9.9
continue: false
27 changes: 27 additions & 0 deletions Regression/RHEL-1843-capsh-print-output/runtest.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions Regression/RHEL-1843-improve-capsh-print-output/PURPOSE
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
Bug: https://issues.redhat.com/browse/RHEL-1843
20 changes: 20 additions & 0 deletions Regression/RHEL-1843-improve-capsh-print-output/main.fmf
Original file line number Diff line number Diff line change
@@ -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 <sec-eng-special@redhat.com>
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
27 changes: 27 additions & 0 deletions Regression/RHEL-1843-improve-capsh-print-output/runtest.sh
Original file line number Diff line number Diff line change
@@ -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