Skip to content

Commit af38ce9

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 af38ce9

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
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: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,31 @@ provision:
33
image: $@{test_disk_image}
44
prepare:
55
# Replace package mode with image mode
6+
# DO NOT RUN ON Github or Locally
7+
# Run on Packit and Gating only
8+
- how: install
9+
package:
10+
- podman
11+
- skopeo
12+
- jq
13+
- bootc
14+
- system-reinstall-bootc
15+
- expect
16+
- ansible-core
17+
- zstd
18+
when: running_env != unify
619
- how: shell
720
script:
8-
- pwd && ls -al
9-
- if [[ -d hack ]]; then cd hack && ./provision-packit.sh; fi
21+
- mkdir -p bootc && cp /var/share/test-artifacts/*.src.rpm bootc
22+
- 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
23+
- pwd && ls -al && cd bootc/hack && ./provision-packit.sh
24+
when: running_env != unify
1025
# tmt-reboot and reboot do not work in this case
1126
# reboot in ansible is the only way to reboot in tmt prepare
1227
- how: ansible
1328
playbook:
1429
- https://github.com/bootc-dev/bootc/raw/refs/heads/main/hack/packit-reboot.yml
30+
when: running_env != unify
1531
execute:
1632
how: tmt
1733

@@ -71,7 +87,7 @@ execute:
7187
test:
7288
- /tmt/tests/test-26-examples-build
7389
adjust:
74-
- when: running_env == packit
90+
- when: running_env != unify
7591
enabled: false
7692
because: packit tests use RPM bootc and does not install /usr/lib/bootc/initramfs-setup
7793

@@ -82,6 +98,6 @@ execute:
8298
test:
8399
- /tmt/tests/test-27-custom-selinux-policy
84100
adjust:
85-
- when: running_env == packit
101+
- when: running_env != unify
86102
enabled: false
87103
because: tmt-reboot does not work with systemd reboot in testing farm environment

0 commit comments

Comments
 (0)