Skip to content

Commit

Permalink
test: Remove tmt bootc plugin code and use released bootc plugin
Browse files Browse the repository at this point in the history
Remove tests-intetration folder because TMT bootc plugin replaces
tests-integration

Signed-off-by: Xiaofeng Wang <[email protected]>
  • Loading branch information
henrywang committed Dec 5, 2024
1 parent 4690143 commit 304c35a
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 1,210 deletions.
2 changes: 1 addition & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ jobs:
targets:
- fedora-41-x86_64
- fedora-41-aarch64
tmt_plan: /integration-build
tmt_plan: /integration
skip_build: true
identifier: integration-test
32 changes: 0 additions & 32 deletions hack/provision-derived.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -xeu
variant=$1
# I'm a big fan of nushell for interactive use, and I want to support
# using it in our test suite because it's better than bash. First,
# enable EPEL to get it.
Expand All @@ -15,35 +14,4 @@ mkdir -p ~/.config/nushell
echo '$env.config = { show_banner: false, }' > ~/.config/nushell/config.nu
touch ~/.config/nushell/env.nu
dnf -y install nu
# And we also add pytest, to support running tests written in Python
dnf -y install python3-pytest
case "$variant" in
tmt)
# tmt wants rsync
dnf -y install cloud-init rsync
ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants

# tmt puts scrips in /var/lib/tmt/scripts, add them to $PATH
touch /etc/environment
echo "export PATH=$PATH:/var/lib/tmt/scripts" >> /etc/environment

# tmt needs a webserver to verify the VM is running
TESTCLOUD_GUEST="python3 -m http.server 10022 || python -m http.server 10022 || /usr/libexec/platform-python -m http.server 10022 || python2 -m SimpleHTTPServer 10022 || python -m SimpleHTTPServer 10022"
echo "$TESTCLOUD_GUEST" >> /opt/testcloud-guest.sh
chmod +x /opt/testcloud-guest.sh
echo "[Unit]" >> /etc/systemd/system/testcloud.service
echo "Description=Testcloud guest integration" >> /etc/systemd/system/testcloud.service
echo "After=cloud-init.service" >> /etc/systemd/system/testcloud.service
echo "[Service]" >> /etc/systemd/system/testcloud.service
echo "ExecStart=/bin/bash /opt/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service
echo "[Install]" >> /etc/systemd/system/testcloud.service
echo "WantedBy=multi-user.target" >> /etc/systemd/system/testcloud.service
systemctl enable testcloud.service
;;
"") echo "No variant"
;;
*)
echo "Unknown variant: $1" exit 1
;;
esac
dnf clean all && rm /var/log/* -rf
27 changes: 0 additions & 27 deletions plans/integration-build.fmf

This file was deleted.

22 changes: 22 additions & 0 deletions plans/integration.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
provision:
hardware:
cpu:
processors: ">= 2"
memory: ">= 6 GB"
virtualization:
is-supported: true
prepare:
- how: install
package:
- git
- podman
- skopeo
- tmt+provision-virtual
- tmt+provision-bootc
execute:
how: tmt
script: |
dnf -y builddep bootc
ls -al
git rev-parse --show-toplevel
make test-tmt
10 changes: 5 additions & 5 deletions plans/test-01-readonly.fmf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Run this via `make test-tmt` which will build a container,
# and a disk image from it.
provision:
how: virtual
# Generated by make test-tmt
image: file://./target/testvm/disk.qcow2
how: bootc
add-tmt-dependencies: true
container-file: hack/Containerfile
container-file-workdir: .
image-builder: quay.io/centos-bootc/bootc-image-builder:latest
disk: 20
summary: Execute booted readonly/nondestructive tests
execute:
Expand Down
9 changes: 5 additions & 4 deletions plans/test-20-local-upgrade.fmf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#
provision:
how: virtual
# Generated by make test-tmt
image: file://./target/testvm/disk.qcow2
how: bootc
add-tmt-dependencies: true
container-file: hack/Containerfile
container-file-workdir: .
image-builder: quay.io/centos-bootc/bootc-image-builder:latest
disk: 20
summary: Execute local upgrade tests
execute:
Expand Down
9 changes: 5 additions & 4 deletions plans/test-21-logically-bound-switch.fmf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#
provision:
how: virtual
# Generated by make test-tmt
image: file://./target/testvm/disk.qcow2
how: bootc
add-tmt-dependencies: true
container-file: hack/Containerfile
container-file-workdir: .
image-builder: quay.io/centos-bootc/bootc-image-builder:latest
disk: 20
summary: Execute logically bound images tests for switching images
execute:
Expand Down
9 changes: 4 additions & 5 deletions plans/test-22-logically-bound-install.fmf
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
environment+:
TMT_PLUGINS: ./tests/plugins
provision:
how: bootc
add_deps: false
containerfile: tests/containerfiles/lbi/Containerfile
containerfile_workdir: tests/containerfiles/lbi
add-tmt-dependencies: true
container-file: tests/containerfiles/lbi/Containerfile
container-file-workdir: tests/containerfiles/lbi
image-builder: quay.io/centos-bootc/bootc-image-builder:latest
disk: 20
summary: Execute logically bound images tests for installing image
execute:
Expand Down
8 changes: 5 additions & 3 deletions plans/test-23-install-outside-container.fmf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
provision:
how: virtual
# Generated by make test-tmt
image: file://./target/testvm/disk.qcow2
how: bootc
add-tmt-dependencies: true
container-file: hack/Containerfile
container-file-workdir: .
image-builder: quay.io/centos-bootc/bootc-image-builder:latest
disk: 20
summary: Execute tests for installing outside of a container
execute:
Expand Down
3 changes: 0 additions & 3 deletions tests-integration/build-image.fmf

This file was deleted.

1 change: 0 additions & 1 deletion tests/plugins/.gitignore

This file was deleted.

Loading

0 comments on commit 304c35a

Please sign in to comment.