run captree smoke tests
This commit is contained in:
parent
a3e0bbb8fc
commit
9298823630
2
tests/captree/main.fmf
Normal file
2
tests/captree/main.fmf
Normal file
@ -0,0 +1,2 @@
|
||||
summary: captree smoke test
|
||||
description: tests basic captree functionality
|
23
tests/captree/test.sh
Executable file
23
tests/captree/test.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
|
||||
if rpm --eval '%{golang_arches}' | tr ' ' '\n' | grep -q -e "$(rpm --eval '%{_arch}')"; then
|
||||
rlPhaseStartTest "Should display help"
|
||||
rlRun "captree -h"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Should list capabilities of pid 1"
|
||||
rlRun -s "captree --depth 1 1"
|
||||
rlAssertGrep 'systemd.*=ep' $rlRun_LOG
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Should display sys admin capability"
|
||||
rlRun -s "capsh --drop=cap_sys_admin -- -c 'captree --verbose \$\$'"
|
||||
rlAssertGrep "!cap_sys_admin" $rlRun_LOG
|
||||
rlPhaseEnd
|
||||
fi
|
||||
|
||||
rlJournalEnd
|
Loading…
Reference in New Issue
Block a user