Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests for DNF 4 bootc plugin #1583

Open
wants to merge 2 commits into
base: bootc
Choose a base branch
from

Conversation

evan-goode
Copy link
Member

Currently WIP. The plan is to implement a new TMT plan that builds an image for a bootc VM and then runs Behave tests tagged with @bootc inside the VM.

@evan-goode evan-goode changed the base branch from main to bootc November 5, 2024 21:49
@evan-goode
Copy link
Member Author

Alright, this is in a rough but working state. I created a proof-of-concept test in dnf-behave-tests/dnf/plugins-core/bootc.feature that checks the output of dnf4 bootc status on a freshly-booted VM. Future work will include integrating this with GitHub/Packit, but the test is working locally.

Steps to run the test:

  1. Install tmt:
dnf install -y tmt+all
  1. Use Tito to build RPMs from the bootc branch of dnf-plugins-core for CentOS Stream 9 and place them in ./rpms

  2. Build the bootc qcow2 image (you may need to be root):

sudo ./container-test --container localhost/dnf-bootc:latest bootc_build

The qcow2 will be placed in ./build/qcow2/disk.qcow2 by default.

  1. Ensure /var/tmp/tmt is clean, then run the tests with tmt:
sudo rm -rf /var/tmp/tmt
sudo tmt run plans -n bootc-behave-dnf

Full logs (you can search for out: to see Behave output) will be in /var/tmp/tmt/run-00*/log.txt

The whole process is quite slow (existing slowness of building the container image + bootc image building to qcow2 + time to boot/provision the test VM), but that may just be the nature of the beast.

@evan-goode evan-goode marked this pull request as ready for review November 5, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant