Skip to content

Commit 2993ffc

Browse files
committed
test: fix fedora-rawhide TEST_OS issue and arch issue in
deploy-libvirt playbook Signed-off-by: Xiaofeng Wang <[email protected]>
1 parent 92731d1 commit 2993ffc

File tree

4 files changed

+12
-64
lines changed

4 files changed

+12
-64
lines changed

.packit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ srpm_build_deps:
1919
- openssl-devel
2020

2121
actions:
22+
# The last setp here is required by Packit to return the archive name
23+
# https://packit.dev/docs/configuration/actions#create-archive
2224
create-archive:
2325
- bash -c "cargo install cargo-vendor-filterer"
2426
- bash -c "cargo xtask spec"
2527
- bash -c "cat target/bootc.spec"
2628
- bash -c "cp target/bootc* contrib/packaging/"
2729
- bash -c "ls -1 target/bootc*.tar.zstd | grep -v 'vendor'"
30+
# Do nothing with spec file. Two steps here are for debugging
2831
fix-spec-file:
2932
- bash -c "cat contrib/packaging/bootc.spec"
3033
- bash -c "ls -al contrib/packaging/"

tests/e2e/README.md

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,11 @@
1-
## Integration Test
1+
## End to end (e2e) Test
22

33
### Scenarios
44

5-
Integration test includes two scenarios, `RPM build` and `bootc install/upgrade`.
5+
End to end (e2e) test includes `bootc install to-existing-root`, `bootc install to-disk`, `bootc upgrade`, and `bootc switch` tests
66

7-
1. RPM build scenario will build RPM for RHEL 9, CentOS Stream 9, and Fedora with mock.
7+
* 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.
88

9-
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.
9+
### Run end to end Test
1010

11-
#### Run RPM Build Test
12-
13-
```shell
14-
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
15-
```
16-
17-
#### Run Integration Test
18-
19-
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.
20-
21-
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.
22-
23-
```shell
24-
export TESTING_FARM_API_TOKEN=<your-token>
25-
testing-farm request \
26-
--plan "aws" \
27-
--environment PLATFORM=$PLATFORM \
28-
--environment ARCH=$ARCH \
29-
--environment TEST_OS=$TEST_OS \
30-
--environment AWS_REGION=us-east-1 \
31-
--secret DOWNLOAD_NODE=$DOWNLOAD_NODE \
32-
--secret RHEL_REGISTRY_URL=$RHEL_REGISTRY_URL \
33-
--secret QUAY_USERNAME=$QUAY_USERNAME \
34-
--secret QUAY_PASSWORD=$QUAY_PASSWORD \
35-
--secret QUAY_SECRET=$QUAY_SECRET \
36-
--secret AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
37-
--secret AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
38-
--git-url <PR URL> \
39-
--git-ref <PR branch> \
40-
--compose "CentOS-Stream-9" \
41-
--arch $ARCH \
42-
--context "arch=$ARCH" \
43-
--timeout "120"
44-
```
45-
46-
* AWS test needs environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION=us-east-1` have to be configured.
47-
48-
### Required environment variables
49-
50-
TEST_OS The OS to run the tests in. Currently supported values:
51-
"rhel-9-4"
52-
"centos-stream-9"
53-
ARCH Test architecture
54-
"x86_64"
55-
"aarch64"
56-
57-
PLATFORM Run test on:
58-
"aws"
59-
QUAY_USERNAME quay.io username
60-
QUAY_PASSWORD quay.io password
61-
QUAY_SECRET Save into /etc/ostree/auth.json for authenticated registry
62-
DOWNLOAD_NODE RHEL nightly compose download URL
63-
RHEL_REGISTRY_URL RHEL bootc image URL
64-
AWS_ACCESS_KEY_ID AWS access key id
65-
AWS_SECRET_ACCESS_KEY AWS secrety key
66-
AWS_REGION AWS region
67-
"us-east-1" RHEL AWS EC2 image is only available in this region
68-
TESTING_FARM_API_TOKEN Required by Testing Farm API
11+
Test run is drived by [Packit](https://packit.dev/) and running on [Testing-farm](https://docs.testing-farm.io/).

tests/e2e/bootc-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ echo "$PACKIT_COPR_PROJECT and $PACKIT_COPR_RPMS"
9898

9999
# Generate bootc copr repo file
100100
if [[ "$VERSION_ID" == 41 ]]; then
101-
REPLACE_TEST_OS="rawhide"
101+
REPLACE_TEST_OS="${ID}-rawhide"
102102
else
103103
REPLACE_TEST_OS="$TEST_OS"
104104
fi

tests/e2e/playbooks/deploy-libvirt.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
become: false
44
vars:
55
test_os: ""
6-
arch: "{{ lookup('env', 'ARCH') | default('x86_64', true) }}"
76
ssh_key_pub: ""
87
ssh_user: "cloud-user"
98
inventory_file: ""
@@ -19,6 +18,9 @@
1918
fedora-41: fedora-unknown
2019

2120
tasks:
21+
- set_fact:
22+
arch: "{{ ansible_facts['architecture'] }}"
23+
2224
- name: Get temp folder
2325
command: dirname "{{ inventory_file }}"
2426
register: result_temp_folder

0 commit comments

Comments
 (0)