Update 'tests/sanity' to include more containers
Sanity testcase generates SELinux policy just for one container "fedora:latest". Testcase should test generating SELinux policy also for Fedora Rawhide container, RHEL universal base image {7,8} and centos containers
This commit is contained in:
parent
aa4e7af453
commit
41b007ecf3
@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
PACKAGE="udica"
|
PACKAGE="udica"
|
||||||
|
|
||||||
|
CONTAINERS="fedora:latest fedora:rawhide ubi8 ubi7 centos:8 centos:7"
|
||||||
|
|
||||||
rlJournalStart
|
rlJournalStart
|
||||||
rlPhaseStartSetup
|
rlPhaseStartSetup
|
||||||
rlAssertRpm "udica"
|
rlAssertRpm "udica"
|
||||||
@ -43,15 +45,16 @@ rlJournalStart
|
|||||||
rlRun "PAGER=cat man udica"
|
rlRun "PAGER=cat man udica"
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartTest "Test basic scenario"
|
for CONTAINER_NAME in ${CONTAINERS} ; do
|
||||||
rlRun "podman run -dit --name test -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 fedora"
|
rlPhaseStartTest "Test basic scenario for ${CONTAINER_NAME} container"
|
||||||
|
rlRun "podman run -dit --name test -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 ${CONTAINER_NAME}"
|
||||||
rlRun "podman ps | grep test"
|
rlRun "podman ps | grep test"
|
||||||
rlRun "ps -efZ | grep bash"
|
rlRun "ps -efZ | grep bash"
|
||||||
rlRun "ps -efZ | grep bash | grep container_t"
|
rlRun "ps -efZ | grep bash | grep container_t"
|
||||||
|
|
||||||
rlRun "podman exec test ls /home" 1,2
|
rlRun "podman exec test ls /home" 1,2
|
||||||
rlRun "podman exec test touch /var/spool/test" 1
|
rlRun "podman exec test touch /var/spool/test" 1
|
||||||
rlRun "podman exec test dnf install nmap-ncat -y" 0
|
rlRun "podman exec test yum install nmap-ncat -y" 0
|
||||||
rlWatchdog "rlRun \"podman exec test nc -l 53\"" 3
|
rlWatchdog "rlRun \"podman exec test nc -l 53\"" 3
|
||||||
|
|
||||||
CONT_ID=$(podman ps | grep test | cut -d ' ' -f 1)
|
CONT_ID=$(podman ps | grep test | cut -d ' ' -f 1)
|
||||||
@ -72,7 +75,7 @@ rlJournalStart
|
|||||||
|
|
||||||
rlRun "podman exec test2 ls /home" 0
|
rlRun "podman exec test2 ls /home" 0
|
||||||
rlRun "podman exec test2 touch /var/spool/test" 0
|
rlRun "podman exec test2 touch /var/spool/test" 0
|
||||||
rlRun "podman exec test2 dnf install nmap-ncat -y" 0
|
rlRun "podman exec test2 yum install nmap-ncat -y" 0
|
||||||
rlWatchdog "rlRun \"podman exec test2 nc -l 53\" 2" 3
|
rlWatchdog "rlRun \"podman exec test2 nc -l 53\" 2" 3
|
||||||
|
|
||||||
rlRun "podman stop test2"
|
rlRun "podman stop test2"
|
||||||
@ -81,6 +84,7 @@ rlJournalStart
|
|||||||
rlRun "semodule -r my_container base_container net_container home_container"
|
rlRun "semodule -r my_container base_container net_container home_container"
|
||||||
rlRun "rm my_container.cil"
|
rlRun "rm my_container.cil"
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
done
|
||||||
|
|
||||||
rlPhaseStartTest "Compare different ways of obtaining policy"
|
rlPhaseStartTest "Compare different ways of obtaining policy"
|
||||||
rlRun "podman run -dit --name test -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 fedora"
|
rlRun "podman run -dit --name test -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 fedora"
|
||||||
|
Loading…
Reference in New Issue
Block a user