Skip to content

Commit

Permalink
test: run all podman in root mode with sudo
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaofeng Wang <[email protected]>
  • Loading branch information
henrywang committed Jul 3, 2024
1 parent 45304e3 commit 98b62ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
12 changes: 10 additions & 2 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ actions:
- bash -c "ls -al contrib/packaging/"

jobs:
# Only add CS10 and RHEL-9 RPM build test
# But no e2e test on CS10 and RHEL-9
- job: copr_build
trigger: pull_request
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10-aarch64
- centos-stream-10-x86_64
- fedora-40-x86_64
- fedora-40-aarch64
- fedora-41-x86_64
- fedora-41-aarch64
- rhel-9-x86_64
- rhel-9-aarch64

- job: tests
trigger: pull_request
Expand All @@ -53,7 +61,7 @@ jobs:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- fedora-40-x86_64
- fedora-40-aarch64
- fedora-41-aarch64
tmt_plan: /to-existing-root
identifier: e2e-test-to-existing-root

Expand All @@ -62,7 +70,7 @@ jobs:
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- fedora-40-x86_64
- fedora-40-aarch64
- fedora-41-x86_64
tmt_plan: /to-disk
identifier: e2e-test-to-disk
2 changes: 1 addition & 1 deletion plans/e2e.fmf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
discover:
how: fmf
test: e2e
adjust+:
adjust:
- when: arch == x86_64 or arch == aarch64
provision:
hardware:
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/bootc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sudo cp "${TEMPDIR}/domain.crt" "/etc/pki/ca-trust/source/anchors/${REGISTRY_IP}
sudo update-ca-trust

greenprint "Deploy local registry"
podman run \
sudo podman run \
-d \
--name registry \
--replace \
Expand All @@ -87,7 +87,7 @@ podman run \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
quay.io/bootc-test/registry:2.8.3
podman ps -a
sudo podman ps -a

# Test image URL
TEST_IMAGE_NAME="bootc-workflow-test"
Expand Down Expand Up @@ -136,10 +136,10 @@ cat "$INSTALL_CONTAINERFILE"

# Build test bootc image and push to local registry
greenprint "Build $TEST_OS installation container image"
podman build --tls-verify=false --retry=5 --retry-delay=10 -t "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" -f "$INSTALL_CONTAINERFILE" "$TEMPDIR"
sudo podman build --tls-verify=false --retry=5 --retry-delay=10 -t "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" -f "$INSTALL_CONTAINERFILE" "$TEMPDIR"

greenprint "Push $TEST_OS installation container image"
retry podman push --tls-verify=false --quiet "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" "$TEST_IMAGE_URL"
retry sudo podman push --tls-verify=false --quiet "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" "$TEST_IMAGE_URL"

# Prepare Ansible inventory file and ansible.cfg
greenprint "Prepare inventory file"
Expand Down Expand Up @@ -251,10 +251,10 @@ EOF

# Build upgrade container image and push to locay registry
greenprint "Build $TEST_OS upgrade container image"
podman build --tls-verify=false --retry=5 --retry-delay=10 -t "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" -f "$UPGRADE_CONTAINERFILE" .
sudo podman build --tls-verify=false --retry=5 --retry-delay=10 -t "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" -f "$UPGRADE_CONTAINERFILE" .

greenprint "Push $TEST_OS upgrade container image"
retry podman push --tls-verify=false --quiet "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" "$TEST_IMAGE_URL"
retry sudo podman push --tls-verify=false --quiet "${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" "$TEST_IMAGE_URL"

# Copy upgrade image to local folder for bootc switch test
if [[ "$AIR_GAPPED_DIR" != "" ]]; then
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/playbooks/templates/user-data.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ users:
lock_passwd: true
ssh_authorized_keys:
- {{ lookup('ansible.builtin.file', ssh_key_pub) }}

# install with --cloud-init always shutdown vm on the first reboot
# https://github.com/virt-manager/virt-manager/issues/497
# workaround is shutdown vm in cloud-init when cloud-init finished
# then start vm
power_state:
delay: now
mode: poweroff
Expand Down

0 comments on commit 98b62ff

Please sign in to comment.