Skip to content

Commit 330a4c8

Browse files
committed
test: Use SRPM as test code source to work with gating test
Signed-off-by: Xiaofeng Wang <[email protected]>
1 parent 1880655 commit 330a4c8

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

hack/packit-reboot.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55
- name: Reboot after system-reinstall-bootc
66
hosts: all
77
tasks:
8-
- name: Check system mode
9-
shell: bootc status --json | jq -r '.status.type'
10-
register: os_mode
11-
12-
# null type means package mode
138
- name: Reboot system to image mode
149
reboot:
15-
when: os_mode.stdout == 'null'
1610

1711
- name: Wait for connection to become reachable/usable
1812
wait_for_connection:

hack/provision-packit.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ set -exuo pipefail
44
# Check environment
55
printenv
66

7-
# This script only runs on Packit and gating environment
8-
# Do not run this script for image mode system
9-
if command -v bootc >/dev/null && bootc status --json | grep '"type":"bootcHost"'; then
10-
echo "This system is Image Mode."
11-
exit 0
12-
fi
13-
14-
# Install required packages
15-
dnf install -y podman skopeo jq bootc system-reinstall-bootc expect ansible-core
16-
177
# temp folder to save building files and folders
188
BOOTC_TEMPDIR=$(mktemp -d)
199
trap 'rm -rf -- "$BOOTC_TEMPDIR"' EXIT

tests/run-tmt.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ rm -vrf /var/tmp/tmt/testcloud/images/bootc-integration-test.qcow2
2323

2424
cd target/tmt-workdir
2525
# TMT will rsync tmt-* scripts to TMT_SCRIPTS_DIR=/var/lib/tmt/scripts
26-
exec tmt --context "test_disk_image=${DISK}" run --all -e TMT_SCRIPTS_DIR=/var/lib/tmt/scripts "$@"
26+
# running_env=unify means running tmt on Github CI or locally
27+
exec tmt --context "test_disk_image=${DISK}" --context "running_env=unify" run --all -e TMT_SCRIPTS_DIR=/var/lib/tmt/scripts "$@"

tmt/plans/integration.fmf

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,29 @@ provision:
33
image: $@{test_disk_image}
44
prepare:
55
# Replace package mode with image mode
6+
- how: install
7+
package:
8+
- podman
9+
- skopeo
10+
- jq
11+
- bootc
12+
- system-reinstall-bootc
13+
- expect
14+
- ansible-core
15+
- zstd
16+
when: running_env != unify
617
- how: shell
718
script:
8-
- pwd && ls -al
9-
- if [[ -d hack ]]; then cd hack && ./provision-packit.sh; fi
19+
- mkdir -p bootc && cp /var/share/test-artifacts/*.src.rpm bootc
20+
- cd bootc && rpm2cpio *.src.rpm | cpio -idmv && rm -f *-vendor.tar.zstd && zstd -d *.tar.zstd && tar -xvf *.tar -C . --strip-components=1 && ls -al
21+
- pwd && ls -al && cd bootc/hack && ./provision-packit.sh
22+
when: running_env != unify
1023
# tmt-reboot and reboot do not work in this case
1124
# reboot in ansible is the only way to reboot in tmt prepare
1225
- how: ansible
1326
playbook:
14-
- https://github.com/bootc-dev/bootc/raw/refs/heads/main/hack/packit-reboot.yml
27+
- bootc/hack/packit-reboot.yml
28+
when: running_env != unify
1529
execute:
1630
how: tmt
1731

@@ -71,7 +85,7 @@ execute:
7185
test:
7286
- /tmt/tests/test-26-examples-build
7387
adjust:
74-
- when: running_env == packit
88+
- when: running_env != unify
7589
enabled: false
7690
because: packit tests use RPM bootc and does not install /usr/lib/bootc/initramfs-setup
7791

@@ -82,6 +96,6 @@ execute:
8296
test:
8397
- /tmt/tests/test-27-custom-selinux-policy
8498
adjust:
85-
- when: running_env == packit
99+
- when: running_env != unify
86100
enabled: false
87101
because: tmt-reboot does not work with systemd reboot in testing farm environment

0 commit comments

Comments
 (0)