-
Notifications
You must be signed in to change notification settings - Fork 0
[MOKOSH] RHEL-1843 - Test for improved capsh --print output #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Koncpa
wants to merge
12
commits into
main
Choose a base branch
from
auto/RHEL-1843_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e66ad05
[MOKOSH] RHEL-1843 - Add main.fmf for capsh print test
Koncpa d2da5cc
[MOKOSH] RHEL-1843 - Add runtest.sh for capsh print test
Koncpa 961efa6
[MOKOSH] RHEL-1843 - Add PURPOSE for capsh print test
Koncpa ef67788
Add main.fmf for RHEL-1843 test
Koncpa 9663a7f
Add runtest.sh for RHEL-1843 test
Koncpa a136375
Add PURPOSE for RHEL-1843 test
Koncpa 5319dab
[MOKOSH] RHEL-1843 - Add main.fmf for capsh print test
Koncpa 6d5cc02
[MOKOSH] RHEL-1843 - Add runtest.sh for capsh print test
Koncpa 6803106
[MOKOSH] RHEL-1843 - Add PURPOSE for capsh print test
Koncpa f0dec36
Add main.fmf for RHEL-1843 test
Koncpa 0ce76ae
Add runtest.sh for RHEL-1843 test
Koncpa 2db25d7
Add PURPOSE for RHEL-1843 test
Koncpa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 the improved output of the `capsh --print` command as requested in RHEL-1843. It ensures that full capability sets are represented by the keyword "all" and empty sets by "none". | ||
| Author: QE Automation <sec-eng-special@redhat.com> | ||
| Bug: https://issues.redhat.com/browse/RHEL-1843 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| summary: Test for RHEL-1843 - capsh --print should use "all" for full capability sets | ||
| description: | | ||
| Bug: https://issues.redhat.com/browse/RHEL-1843 | ||
| This test verifies that the `capsh --print` command now uses the keyword "all" | ||
| to represent a full set of capabilities, and "none" for an empty set, | ||
| making the output more intuitive and less prone to misinterpretation. | ||
| contact: QE Automation <sec-eng-special@redhat.com> | ||
| test: ./runtest.sh | ||
| framework: beakerlib | ||
| recommend: | ||
| - libcap | ||
| duration: 5m | ||
| tag: | ||
| - rhel-9 | ||
| - rhel-10 | ||
| adjust: | ||
| - enabled: false | ||
| when: distro < rhel-9.9 | ||
| continue: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/bin/bash | ||
| . /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
|
||
| rlJournalStart | ||
| rlPhaseStartSetup "Setup" | ||
| rlAssertRpm "libcap" | ||
| rlPhaseEnd | ||
|
|
||
| rlPhaseStartTest "Verify capsh --print output for full capabilities" | ||
| # For a root user, the default capabilities should be full. | ||
| # The output should now contain 'all' instead of a long list of individual capabilities. | ||
| rlRun "capsh --print" | ||
| rlAssertGrep "Current: all=ep" "$rlRun_LOG" "Check for 'all=ep' in Current capabilities" | ||
| rlAssertGrep "Bounding set: all" "$rlRun_LOG" "Check for 'all' in Bounding set" | ||
| rlPhaseEnd | ||
|
|
||
| rlPhaseStartTest "Verify capsh --print output for empty ambient set" | ||
| # The ambient set is typically empty for a root user. | ||
| # The output should now explicitly say 'none'. | ||
| rlRun "capsh --print" | ||
| rlAssertGrep "Ambient set: none" "$rlRun_LOG" "Check for 'none' in Ambient set" | ||
| rlPhaseEnd | ||
|
|
||
| rlPhaseStartTest "Verify capsh --print output for a non-root user (no capabilities)" | ||
| rlRun "useradd capsh_test_user" | ||
| rlRun "su - capsh_test_user -c 'capsh --print'" | ||
| rlAssertGrep "Current: =" "$rlRun_LOG" "Current capabilities should be empty for non-root user" | ||
| rlRun "userdel -r capsh_test_user" | ||
| rlPhaseEnd | ||
|
|
||
| rlPhaseStartCleanup "Cleanup" | ||
| # No cleanup needed in this case | ||
| rlPhaseEnd | ||
| rlJournalPrintText | ||
| rlJournalEnd | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.