diff --git a/.packit.yaml b/.packit.yaml index e70949183..592daaa60 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -19,12 +19,15 @@ srpm_build_deps: - openssl-devel actions: + # The last setp here is required by Packit to return the archive name + # https://packit.dev/docs/configuration/actions#create-archive create-archive: - bash -c "cargo install cargo-vendor-filterer" - bash -c "cargo xtask spec" - bash -c "cat target/bootc.spec" - bash -c "cp target/bootc* contrib/packaging/" - bash -c "ls -1 target/bootc*.tar.zstd | grep -v 'vendor'" + # Do nothing with spec file. Two steps here are for debugging fix-spec-file: - bash -c "cat contrib/packaging/bootc.spec" - bash -c "ls -al contrib/packaging/" diff --git a/tests/e2e/README.md b/tests/e2e/README.md index 270798172..54d2815ec 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -1,68 +1,11 @@ -## Integration Test +## End to end (e2e) Test ### Scenarios -Integration test includes two scenarios, `RPM build` and `bootc install/upgrade`. +End to end (e2e) test includes `bootc install to-existing-root`, `bootc install to-disk`, `bootc upgrade`, and `bootc switch` tests -1. RPM build scenario will build RPM for RHEL 9, CentOS Stream 9, and Fedora with mock. +* bootc install/upgrade/switch scenario will install, upgrade, and switch bootc image and have some system checking, such as check mount point/permission, run podman with root and rootless, check persistent log, etc. -2. bootc install/upgrade scenario will install and upgrade bootc image and have some system checking, such as check mount point/permission, run podman with root and rootless, check persistent log. +### Run end to end Test -#### Run RPM Build Test - -```shell - podman run --rm --privileged -v ./:/workdir:z -e TEST_OS=$TEST_OS -e ARCH=$ARCH -e RHEL_REGISTRY_URL=$RHEL_REGISTRY_URL -e DOWNLOAD_NODE=$DOWNLOAD_NODE --workdir /workdir quay.io/fedora/fedora:40 ./tests/integration/mockbuild.sh -``` - -#### Run Integration Test - -Run on a shared test infrastructure using the [`testing farm`](https://docs.testing-farm.io/Testing%20Farm/0.1/cli.html) tool. For example, running on AWS. - -Run `testing-farm` CLI from `quay.io/testing-farm/cli` container. Don't forget export the `TESTING_FARM_API_TOKEN` in your environment. To run RHEL test, `Red Hat Ranch` has to be used. - -```shell - export TESTING_FARM_API_TOKEN= - testing-farm request \ - --plan "aws" \ - --environment PLATFORM=$PLATFORM \ - --environment ARCH=$ARCH \ - --environment TEST_OS=$TEST_OS \ - --environment AWS_REGION=us-east-1 \ - --secret DOWNLOAD_NODE=$DOWNLOAD_NODE \ - --secret RHEL_REGISTRY_URL=$RHEL_REGISTRY_URL \ - --secret QUAY_USERNAME=$QUAY_USERNAME \ - --secret QUAY_PASSWORD=$QUAY_PASSWORD \ - --secret QUAY_SECRET=$QUAY_SECRET \ - --secret AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ - --secret AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ - --git-url \ - --git-ref \ - --compose "CentOS-Stream-9" \ - --arch $ARCH \ - --context "arch=$ARCH" \ - --timeout "120" -``` - -* AWS test needs environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION=us-east-1` have to be configured. - -### Required environment variables - - TEST_OS The OS to run the tests in. Currently supported values: - "rhel-9-4" - "centos-stream-9" - ARCH Test architecture - "x86_64" - "aarch64" - - PLATFORM Run test on: - "aws" - QUAY_USERNAME quay.io username - QUAY_PASSWORD quay.io password - QUAY_SECRET Save into /etc/ostree/auth.json for authenticated registry - DOWNLOAD_NODE RHEL nightly compose download URL - RHEL_REGISTRY_URL RHEL bootc image URL - AWS_ACCESS_KEY_ID AWS access key id - AWS_SECRET_ACCESS_KEY AWS secrety key - AWS_REGION AWS region - "us-east-1" RHEL AWS EC2 image is only available in this region - TESTING_FARM_API_TOKEN Required by Testing Farm API +Test run is drived by [Packit](https://packit.dev/) and running on [Testing-farm](https://docs.testing-farm.io/). diff --git a/tests/e2e/bootc-install.sh b/tests/e2e/bootc-install.sh index 3b7df5301..46ac8c319 100755 --- a/tests/e2e/bootc-install.sh +++ b/tests/e2e/bootc-install.sh @@ -98,7 +98,7 @@ echo "$PACKIT_COPR_PROJECT and $PACKIT_COPR_RPMS" # Generate bootc copr repo file if [[ "$VERSION_ID" == 41 ]]; then - REPLACE_TEST_OS="rawhide" + REPLACE_TEST_OS="${ID}-rawhide" else REPLACE_TEST_OS="$TEST_OS" fi diff --git a/tests/e2e/playbooks/deploy-libvirt.yaml b/tests/e2e/playbooks/deploy-libvirt.yaml index 38813e0cd..7cda19186 100644 --- a/tests/e2e/playbooks/deploy-libvirt.yaml +++ b/tests/e2e/playbooks/deploy-libvirt.yaml @@ -3,7 +3,6 @@ become: false vars: test_os: "" - arch: "{{ lookup('env', 'ARCH') | default('x86_64', true) }}" ssh_key_pub: "" ssh_user: "cloud-user" inventory_file: "" @@ -19,6 +18,9 @@ fedora-41: fedora-unknown tasks: + - set_fact: + arch: "{{ ansible_facts['architecture'] }}" + - name: Get temp folder command: dirname "{{ inventory_file }}" register: result_temp_folder