Skip to content

Commit a1bbef4

Browse files
authored
Merge pull request #323 from lsm5/tmt-tests-simplify-2
TMT: Simplify tests
2 parents a688655 + 74f7615 commit a1bbef4

File tree

5 files changed

+40
-70
lines changed

5 files changed

+40
-70
lines changed

.packit.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ upstream_tag_template: v{version}
99
files_to_sync:
1010
- src: rpm/gating.yaml
1111
dest: gating.yaml
12+
delete: true
1213
- src: plans/
1314
dest: plans/
1415
delete: true
@@ -51,7 +52,7 @@ jobs:
5152
packages: [container-selinux-centos]
5253
notifications: *copr_build_failure_notification
5354
enable_net: true
54-
targets:
55+
targets: &centos_targets
5556
- centos-stream-9
5657
- centos-stream-10
5758

@@ -86,15 +87,23 @@ jobs:
8687
message: "Tests failed. @containers/packit-build please check."
8788
targets:
8889
- fedora-all
90+
tf_extra_params:
91+
environments:
92+
- artifacts:
93+
- type: repository-file
94+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
8995

9096
# Tests for CentOS Stream
9197
- job: tests
9298
trigger: pull_request
9399
packages: [container-selinux-centos]
94100
notifications: *test_failure_notification
95-
targets:
96-
- centos-stream-9
97-
- centos-stream-10
101+
targets: *centos_targets
102+
tf_extra_params:
103+
environments:
104+
- artifacts:
105+
- type: repository-file
106+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo
98107

99108
# Tests for RHEL
100109
- job: tests
@@ -105,11 +114,13 @@ jobs:
105114
targets:
106115
epel-9-x86_64:
107116
distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly]
108-
# Use centos-stream-10 until we have epel-10
109-
# TODO: Enable after RHEL-10 gets selinux-policy >= 40.13.1 which is
110-
# already on CentOS Stream 10.
111-
#centos-stream-10-x86_64:
112-
# distros: [RHEL-10-Beta-Nightly]
117+
tf_extra_params:
118+
environments:
119+
- artifacts:
120+
- type: repository-file
121+
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo
122+
- type: repository-file
123+
id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo
113124

114125
- job: propose_downstream
115126
trigger: release

plans/all.fmf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ execute:
1212
when: initiator is not defined or initiator != packit
1313

1414
/downstream:
15-
summary: Run SELinux specific Podman e2e tests on bodhi / errata and dist-git PRs
15+
summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs
1616
discover+:
1717
filter: tag:downstream
1818
adjust+:

test/Makefile

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@ basic_check:
33
semodule --list=full | grep container
44
semodule -B
55

6-
.PHONY: podman_e2e_test_upstream
7-
podman_e2e_test_upstream:
8-
bash ./podman-tests.sh e2e upstream
6+
.PHONY: podman_e2e_test
7+
podman_e2e_test:
8+
bash ./podman-tests.sh e2e
99

10-
.PHONY: podman_e2e_test_downstream
11-
podman_e2e_test_downstream:
12-
bash ./podman-tests.sh e2e downstream
13-
14-
.PHONY: podman_system_test_upstream
15-
podman_system_test_upstream:
16-
bash ./podman-tests.sh system upstream
17-
18-
.PHONY: podman_system_test_downstream
19-
podman_system_test_downstream:
20-
bash ./podman-tests.sh system downstream
10+
.PHONY: podman_system_test
11+
podman_system_test:
12+
bash ./podman-tests.sh system
2113

2214
clean:
2315
rm -rf podman-*dev* podman.spec

test/main.fmf

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,16 @@ require:
66
- policycoreutils
77

88
/basic_check:
9-
summary: Run basic checks
109
tag: [ upstream, downstream ]
10+
summary: Run basic checks
1111
test: make basic_check
1212

13-
/upstream:
14-
tag: upstream
15-
/upstream/podman_e2e_test:
16-
summary: Run SELinux specific Podman e2e tests on upstream PRs
17-
test: make podman_e2e_test_upstream
18-
/upstream/podman_system_test:
19-
summary: Run SELinux specific Podman system tests on upstream PRs
20-
test: make podman_system_test_upstream
13+
/podman_e2e_test:
14+
tag: [ upstream, downstream ]
15+
summary: Run SELinux specific Podman e2e tests
16+
test: make podman_e2e_test
2117

22-
/downstream:
23-
tag: downstream
24-
/downstream/podman_e2e_test:
25-
summary: Run SELinux specific Podman e2e tests on downstream bodhi / errata and dist-git PRs
26-
test: make podman_e2e_test_downstream
27-
/downstream/podman_system_test:
28-
summary: Run SELinux specific Podman system tests on downstream bodhi / errata and dist-git PRs
29-
test: make podman_system_test_downstream
18+
/podman_system_test:
19+
tag: [ upstream, downstream ]
20+
summary: Run SELinux specific Podman system tests
21+
test: make podman_system_test

test/podman-tests.sh

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,19 @@
22

33
set -exo pipefail
44

5+
cat /etc/redhat-release
6+
57
if [[ "$(id -u)" -ne 0 ]];then
68
echo "Please run as superuser"
79
exit 1
810
fi
911

1012
if [[ -z "$1" ]]; then
11-
echo -e "Usage: podman-tests.sh TEST_TYPE STREAM\nTEST_TYPE can be 'e2e' or 'system'\nSTREAM can be 'upstream' or 'downstream'"
13+
echo -e "Usage: $(basename ${BASH_SOURCE[0]}) TEST_TYPE\nTEST_TYPE can be 'e2e' or 'system'\n"
1214
exit 1
1315
fi
1416

1517
TEST_TYPE=$1
16-
STREAM=$2
17-
18-
# `rhel` macro exists on RHEL, CentOS Stream, and Fedora ELN
19-
# `centos` macro exists only on CentOS Stream
20-
CENTOS_VERSION=$(rpm --eval '%{?centos}')
21-
RHEL_VERSION=$(rpm --eval '%{?rhel}')
22-
23-
# For upstream tests, we need to test with podman and other packages from the
24-
# podman-next copr. For downstream tests (bodhi, errata), we don't need any
25-
# additional setup
26-
if [[ "$STREAM" == "upstream" ]]; then
27-
# Use CentOS Stream 10 copr target for RHEL-10 until EPEL 10 becomes
28-
# available
29-
if [[ -n $CENTOS_VERSION || $RHEL_VERSION -ge 10 ]]; then
30-
dnf -y copr enable rhcontainerbot/podman-next centos-stream-$CENTOS_VERSION
31-
else
32-
dnf -y copr enable rhcontainerbot/podman-next
33-
fi
34-
echo "priority=5" >> /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next.repo
35-
fi
3618

3719
# Remove testing-farm repos if they exist as these interfere with the packages
3820
# we want to install, especially when podman-next copr is involved
@@ -69,18 +51,11 @@ tar zxf *.tar.gz
6951

7052
popd
7153

72-
# Enable EPEL on RHEL/CentOS Stream envs to fetch bats
73-
if [[ -n $(rpm --eval '%{?rhel}') ]]; then
74-
# Until EPEL 10 is available use epel-9 for all RHEL and CentOS Stream
75-
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
76-
sed -i 's/$releasever/9/g' /etc/yum.repos.d/epel.repo
77-
fi
78-
7954
# Install dependencies for running tests
55+
# NOTE: bats will be fetched from Fedora repos on public testing-farm envs if EPEL repo is absent or disabled.
8056
dnf -y install bats golang
8157

8258
# Print versions of distro and installed packages
83-
cat /etc/redhat-release
8459
rpm -q bats container-selinux golang podman podman-tests selinux-policy
8560

8661
if [[ "$TEST_TYPE" == "e2e" ]]; then

0 commit comments

Comments
 (0)