Skip to content

Commit 1d83cca

Browse files
authored
Add plan and test for container tools integration testing (teemtee#4026)
Implement a simple test verifying the basic container provision functionality. Include a plan in the special `friends` directory so that related components can easily enable integration testing at their side. Check that no AVC failures are triggered during its execution. The plan can be enabled in the related git repositories in the following way: summary: Run tmt integration tests plan: import: url: https://github.com/teemtee/tmt path: /plans/friends name: /podman Fix teemtee#3996.
1 parent 7e50171 commit 1d83cca

File tree

8 files changed

+68
-6
lines changed

8 files changed

+68
-6
lines changed

plans/friends/podman.fmf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
summary: Integration plan for podman & friends
2+
3+
description:
4+
Ensure that the basic functionality of the container provision
5+
plugin is working and no AVC denials are triggered. This plan
6+
is supposed to be run for podman, crun, container-selinux and
7+
friends pull requests to prevent introducing breaking changes.
8+
9+
discover:
10+
how: fmf
11+
url: https://github.com/teemtee/tmt
12+
filter: "tag:podman"
13+
adjust-tests:
14+
- check: avc
15+
16+
prepare:
17+
name: enable-epel
18+
how: feature
19+
epel: enabled
20+
order: 20
21+
22+
link:
23+
- relates: https://github.com/containers/container-selinux
24+
- relates: https://github.com/containers/podman
25+
- relates: https://github.com/containers/crun
26+
- verifies: https://github.com/containers/container-selinux/issues/389

tests/provision/container/alpine/main.fmf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ description:
55
so make sure a reasonable error is returned to the user.
66
Run a simple successful check against the Alpine Linux
77
tests image.
8-
tag+:
9-
- provision-only
10-
- provision-container
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/plan:
2+
discover:
3+
how: fmf
4+
provision:
5+
how: container
6+
image: fedora
7+
execute:
8+
how: tmt
9+
10+
/test:
11+
test: cat /etc/os-release
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
summary: Provision a fedora container and run a simple command
2+
description:
3+
Make sure that the simple use case of starting a container,
4+
running a simple command in it and stopping it works fine and
5+
does not trigger any AVC denials.
6+
tag+:
7+
- podman
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
. /usr/share/beakerlib/beakerlib.sh || exit 1
3+
4+
rlJournalStart
5+
rlPhaseStartSetup
6+
rlRun "run=\$(mktemp -d)" 0 "Create a run directory"
7+
rlRun "pushd data"
8+
rlPhaseEnd
9+
10+
rlPhaseStartTest
11+
rlRun -s "tmt run --id $run -vvv"
12+
rlAssertGrep "NAME.*Fedora Linux" $rlRun_LOG
13+
rlPhaseEnd
14+
15+
rlPhaseStartCleanup
16+
rlRun "popd"
17+
rlGetTestState || rlFileSubmit "$run/log.txt"
18+
rlRun "rm -r $run" 0 "Remove the run directory"
19+
rlPhaseEnd
20+
rlJournalEnd

tests/provision/container/main.fmf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tag+:
2+
- provision-only
3+
- provision-container

tests/provision/container/toolbox/main.fmf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ description:
66
Silverblue.
77

88
duration: 30m
9-
tag+:
10-
- provision-only
11-
- provision-container
129
require+:
1310
- toolbox
1411
adjust+:

0 commit comments

Comments
 (0)