Skip to content

Commit bae53aa

Browse files
committed
TMT: Run integration and unit tests
Include system and integration tests in the same file, get rid of tags and filter by plan name. Adjust names and identifiers for consistency. Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 7b3b842 commit bae53aa

File tree

6 files changed

+162
-20
lines changed

6 files changed

+162
-20
lines changed

.packit.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
distros: [RHEL-9.6.0-Nightly]
2020
epel-9-aarch64:
2121
distros: [RHEL-9.6.0-Nightly]
22-
tmt_plan: "/plans/system/root-local"
22+
tmt_plan: "/plans/sys-root-local"
2323
identifier: "sys-local-root"
2424

2525
- job: tests
@@ -48,3 +48,39 @@ jobs:
4848
targets: *test_targets
4949
tmt_plan: "/plans/system/rootless-remote"
5050
identifier: "sys-remote-rootless"
51+
52+
- job: tests
53+
trigger: pull_request
54+
skip_build: true
55+
use_internal_tf: true
56+
notifications: *packit_failure_notification
57+
targets: *test_targets
58+
tmt_plan: "/plans/integration/rootless-local"
59+
identifier: "int-local-rootless"
60+
61+
- job: tests
62+
trigger: pull_request
63+
skip_build: true
64+
use_internal_tf: true
65+
notifications: *packit_failure_notification
66+
targets: *test_targets
67+
tmt_plan: "/plans/integration/root-remote"
68+
identifier: "int-remote-root"
69+
70+
- job: tests
71+
trigger: pull_request
72+
skip_build: true
73+
use_internal_tf: true
74+
notifications: *packit_failure_notification
75+
targets: *test_targets
76+
tmt_plan: "/plans/integration/rootless-remote"
77+
identifier: "int-remote-rootless"
78+
79+
- job: tests
80+
trigger: pull_request
81+
skip_build: true
82+
use_internal_tf: true
83+
notifications: *packit_failure_notification
84+
targets: *test_targets
85+
tmt_plan: "/plans/localunit"
86+
identifier: "unit"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ run-docker-py-tests:
647647
rm -f test/__init__.py
648648

649649
.PHONY: localunit
650-
localunit: test/goecho/goecho test/version/version
650+
localunit: .install.ginkgo test/goecho/goecho test/version/version
651651
rm -rf ${COVERAGE_PATH} && mkdir -p ${COVERAGE_PATH}
652652
UNIT=1 $(GINKGO) \
653653
-r \

plans/integration.fmf

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
discover:
2+
how: fmf
3+
4+
execute:
5+
how: tmt
6+
7+
prepare:
8+
- name: build and test dependencies
9+
how: install
10+
package:
11+
- go-md2man
12+
- golang
13+
- gpgme-devel
14+
- libseccomp-devel
15+
- netavark
16+
- podman-catatonit
17+
# podman-tests used only to fetch test dependencies
18+
- podman-tests
19+
- slirp4netns
20+
- systemd-devel
21+
order: 5
22+
- how: shell
23+
script: modprobe null_blk nr_devices=1
24+
order: 5
25+
26+
provision:
27+
how: artemis
28+
hardware:
29+
memory: ">= 16 GB"
30+
cpu:
31+
cores: ">= 4"
32+
threads: ">=8"
33+
disk:
34+
- size: ">= 512 GB"
35+
36+
/root-local:
37+
summary: Local rootful integration tests
38+
discover+:
39+
test: /test/tmt/int-root-local
40+
41+
/rootless-local:
42+
summary: Local rootless integration tests
43+
discover+:
44+
test: /test/tmt/int-rootless-local
45+
46+
/root-remote:
47+
summary: Remote rootful integration tests
48+
discover+:
49+
test: /test/tmt/int-root-remote
50+
51+
/rootless-remote:
52+
summary: Remote rootless integration tests
53+
discover+:
54+
test: /test/tmt/int-rootless-remote

plans/localunit.fmf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
summary: Run unit tests
2+
3+
discover:
4+
how: fmf
5+
test: /test/tmt/localunit
6+
7+
execute:
8+
how: tmt
9+
10+
prepare:
11+
- name: build and test dependencies
12+
how: install
13+
package:
14+
- golang
15+
- gpgme-devel
16+
- libseccomp-devel
17+
- systemd-devel
18+
order: 5
19+
20+
provision:
21+
how: artemis
22+
hardware:
23+
memory: ">= 16 GB"
24+
cpu:
25+
cores: ">= 4"
26+
threads: ">=8"
27+
disk:
28+
- size: ">= 512 GB"

plans/system.fmf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ provision:
5353
- size: ">= 512 GB"
5454

5555
/root-local:
56-
summary: Local root system tests
56+
summary: Local rootful system tests
5757
discover+:
58-
filter: 'tag:local & tag:root & tag:system'
58+
test: /test/tmt/sys-root-local
5959

6060
/rootless-local:
6161
summary: Local rootless system tests
6262
discover+:
63-
filter: 'tag:local & tag:rootless & tag:system'
63+
test: /test/tmt/sys-rootless-local
6464

6565
/root-remote:
66-
summary: Remote root system tests
66+
summary: Remote rootful system tests
6767
discover+:
68-
filter: 'tag:remote & tag:root & tag:system'
68+
test: /test/tmt/sys-root-remote
6969

7070
/rootless-remote:
7171
summary: Remote rootless system tests
7272
discover+:
73-
filter: 'tag:remote & tag:rootless & tag:system'
73+
test: /test/tmt/sys-rootless-remote

test/tmt/system.fmf renamed to test/tmt/main.fmf

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,62 @@ adjust+:
88
environment+:
99
ROOTLESS_USER: "cloud-user"
1010

11-
/local-root:
12-
tag: [ local, root, system ]
13-
summary: local rootful test
11+
/sys-root-local:
1412
test: >
1513
bash ./setup.sh &&
1614
make -C $TMT_TREE localsystem
1715
duration: 40m
1816

19-
/local-rootless:
20-
tag: [ local, rootless, system ]
21-
summary: rootless test
17+
/sys-rootless-local:
2218
test: >
2319
bash ./setup.sh &&
2420
loginctl enable-linger $ROOTLESS_USER &&
2521
chown -R $ROOTLESS_USER $TMT_TREE &&
2622
su - "$ROOTLESS_USER" -c "CI_DESIRED_NETWORK=netavark make -C $TMT_TREE localsystem"
2723
duration: 40m
2824

29-
/remote-root:
30-
tag: [ remote, root, system ]
31-
summary: remote rootful test
25+
/sys-root-remote:
3226
test: >
3327
bash ./setup.sh &&
3428
make -C $TMT_TREE remotesystem
3529
duration: 40m
3630

37-
/remote-rootless:
38-
tag: [ remote, rootless, system ]
39-
summary: remote rootless test
31+
/sys-rootless-remote:
4032
test: >
4133
bash ./setup.sh &&
4234
loginctl enable-linger $ROOTLESS_USER &&
4335
chown -R $ROOTLESS_USER $TMT_TREE &&
4436
su - "$ROOTLESS_USER" -c "CI_DESIRED_NETWORK=netavark make -C $TMT_TREE remotesystem"
4537
duration: 40m
38+
39+
/int-root-local:
40+
test: >
41+
bash ./setup.sh &&
42+
make -C $TMT_TREE localintegration
43+
duration: 40m
44+
45+
/int-rootless-local:
46+
test: >
47+
bash ./setup.sh &&
48+
loginctl enable-linger $ROOTLESS_USER &&
49+
chown -R $ROOTLESS_USER $TMT_TREE &&
50+
su - "$ROOTLESS_USER" -c "make -C $TMT_TREE localintegration"
51+
duration: 40m
52+
53+
/int-root-remote:
54+
test: >
55+
bash ./setup.sh &&
56+
make -C $TMT_TREE remoteintegration
57+
duration: 40m
58+
59+
/int-rootless-remote:
60+
test: >
61+
bash ./setup.sh &&
62+
loginctl enable-linger $ROOTLESS_USER &&
63+
chown -R $ROOTLESS_USER $TMT_TREE &&
64+
su - "$ROOTLESS_USER" -c "make -C $TMT_TREE remoteintegration"
65+
duration: 40m
66+
67+
/localunit:
68+
test: make -C $TMT_TREE localunit
69+
duration: 40m

0 commit comments

Comments
 (0)