Skip to content

Commit

Permalink
test: fix fedora-rawhide TEST_OS issue and arch issue in
Browse files Browse the repository at this point in the history
deploy-libvirt playbook

Signed-off-by: Xiaofeng Wang <[email protected]>
  • Loading branch information
henrywang committed Jun 27, 2024
1 parent a3994ba commit d649683
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 64 deletions.
3 changes: 3 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
67 changes: 5 additions & 62 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
@@ -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=<your-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 <PR URL> \
--git-ref <PR branch> \
--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/).
2 changes: 1 addition & 1 deletion tests/e2e/bootc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/playbooks/deploy-libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand All @@ -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
Expand Down

0 comments on commit d649683

Please sign in to comment.