From 98201fec06826ec43cafa437541aa6e52b3de577 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Wed, 31 Jul 2024 18:35:05 +0800 Subject: [PATCH 1/4] test: add centos stream 10 rpm build and e2e test Signed-off-by: Xiaofeng Wang --- .packit.yaml | 10 +++++++++- plans/e2e.fmf | 9 +-------- tests/e2e/bootc-install.sh | 9 ++++++++- tests/e2e/playbooks/deploy-libvirt.yaml | 4 +++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index c39184696..63ef29720 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -44,6 +44,10 @@ jobs: - centos-stream-9-aarch64 - centos-stream-9-ppc64le - centos-stream-9-s390x + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 + - centos-stream-10-ppc64le + - centos-stream-10-s390x - fedora-40-x86_64 - fedora-40-aarch64 - fedora-40-ppc64le @@ -65,11 +69,14 @@ jobs: skip_build: true identifier: integration-test + # To avoid https://issues.redhat.com/browse/TFT-2691 + # x86_64 tf runner is not enough now - job: tests trigger: pull_request targets: - centos-stream-9-x86_64 - centos-stream-9-aarch64 + - centos-stream-10-aarch64 - fedora-40-x86_64 tmt_plan: /to-existing-root identifier: e2e-test-to-existing-root @@ -77,8 +84,9 @@ jobs: - job: tests trigger: pull_request targets: - - centos-stream-9-x86_64 - centos-stream-9-aarch64 + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 - fedora-40-aarch64 tmt_plan: /to-disk identifier: e2e-test-to-disk diff --git a/plans/e2e.fmf b/plans/e2e.fmf index 587b5a54c..563dccf58 100644 --- a/plans/e2e.fmf +++ b/plans/e2e.fmf @@ -11,13 +11,6 @@ adjust: virtualization: is-supported: true prepare: - - how: shell - script: | - source /etc/os-release - if [[ "$ID" == "centos" ]]; then - # EPEL for genisoimage - dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - fi - how: install package: - ansible-core @@ -30,7 +23,7 @@ prepare: - qemu-kvm - libvirt - virt-install - - genisoimage + - xorriso - how: shell script: ansible-galaxy collection install https://ansible-collection.s3.amazonaws.com/ansible-posix-1.5.4.tar.gz https://ansible-collection.s3.amazonaws.com/community-general-8.5.0.tar.gz execute: diff --git a/tests/e2e/bootc-install.sh b/tests/e2e/bootc-install.sh index 9976572dd..ee19b0419 100755 --- a/tests/e2e/bootc-install.sh +++ b/tests/e2e/bootc-install.sh @@ -41,11 +41,18 @@ source /etc/os-release case ""${ID}-${VERSION_ID}"" in "centos-9") TEST_OS="centos-stream-9" - TIER1_IMAGE_URL="quay.io/centos-bootc/centos-bootc-dev:stream9" + TIER1_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream9" SSH_USER="cloud-user" REDHAT_VERSION_ID="9" BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no" ;; + "centos-10") + TEST_OS="centos-stream-10" + TIER1_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream10" + SSH_USER="cloud-user" + REDHAT_VERSION_ID="10" + BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no" + ;; "fedora-"*) TEST_OS="fedora-${VERSION_ID}" TIER1_IMAGE_URL="quay.io/fedora/fedora-bootc:${VERSION_ID}" diff --git a/tests/e2e/playbooks/deploy-libvirt.yaml b/tests/e2e/playbooks/deploy-libvirt.yaml index 7cda19186..7541bfa64 100644 --- a/tests/e2e/playbooks/deploy-libvirt.yaml +++ b/tests/e2e/playbooks/deploy-libvirt.yaml @@ -14,6 +14,7 @@ boot_args: "" os_variant: centos-stream-9: centos-stream9 + centos-stream-10: centos-stream9 fedora-40: fedora-unknown fedora-41: fedora-unknown @@ -116,7 +117,8 @@ # Then the --cloud-init will be dropped when start after system reset - name: Generate seed.iso for NoCloud cloud-init command: | - genisoimage -output "{{ image_path }}/seed.iso" \ + xorriso -as mkisofs -input-charset utf8 \ + -o "{{ image_path }}/seed.iso" \ -volid cidata \ -joliet \ -rock \ From b3cead0e07ddef19ac2c5bb23000c3c5bd394a1c Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Wed, 31 Jul 2024 23:48:15 +0800 Subject: [PATCH 2/4] test: disable selinux on CS10 to workaround libvirt selinux issue Workaround issue https://issues.redhat.com/browse/RHEL-46893 Signed-off-by: Xiaofeng Wang --- tests/e2e/bootc-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/bootc-install.sh b/tests/e2e/bootc-install.sh index ee19b0419..1c6bf6fb4 100755 --- a/tests/e2e/bootc-install.sh +++ b/tests/e2e/bootc-install.sh @@ -52,6 +52,8 @@ case ""${ID}-${VERSION_ID}"" in SSH_USER="cloud-user" REDHAT_VERSION_ID="10" BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no" + # workaround CS10 libvirt selinux policy issue https://issues.redhat.com/browse/RHEL-46893 + sudo setenforce 0 ;; "fedora-"*) TEST_OS="fedora-${VERSION_ID}" From 714b77c49e943bba6c6be95c685fdfd220f88ad1 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Thu, 1 Aug 2024 12:54:19 +0800 Subject: [PATCH 3/4] test: remove kargs "systemd.unified_cgroup_hierarchy=0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "systemd.unified_cgroup_hierarchy=0" does not work with CS10 It caused boot failure with error: [!!!!!!] Refusing to run under cgroup v1, SY… specified on kernel command line. Signed-off-by: Xiaofeng Wang --- tests/e2e/bootc-install.sh | 4 ++-- tests/e2e/playbooks/check-system.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/bootc-install.sh b/tests/e2e/bootc-install.sh index 1c6bf6fb4..154e4966a 100755 --- a/tests/e2e/bootc-install.sh +++ b/tests/e2e/bootc-install.sh @@ -129,7 +129,7 @@ kargs = ["mitigations=on", "nosmt"] EOF RUN mkdir -p /usr/lib/bootc/kargs.d RUN cat <> /usr/lib/bootc/kargs.d/01-console.toml -kargs = ["systemd.unified_cgroup_hierarchy=0","console=ttyS0","panic=0"] +kargs = ["console=ttyS0","panic=0"] EOF REALEOF @@ -263,7 +263,7 @@ ansible-playbook -v \ -e test_os="$TEST_OS" \ -e bootc_image="$TEST_IMAGE_URL" \ -e image_label_version_id="$REDHAT_VERSION_ID" \ - -e kargs="mitigations=on,nosmt,systemd.unified_cgroup_hierarchy=0,console=ttyS0,panic=0" \ + -e kargs="mitigations=on,nosmt,console=ttyS0,panic=0" \ playbooks/check-system.yaml # Prepare upgrade containerfile diff --git a/tests/e2e/playbooks/check-system.yaml b/tests/e2e/playbooks/check-system.yaml index 3107b2fa0..e7e19ce8f 100644 --- a/tests/e2e/playbooks/check-system.yaml +++ b/tests/e2e/playbooks/check-system.yaml @@ -356,7 +356,7 @@ register: result_selinux_denied become: true ignore_errors: true - + # case: check karg - name: grep for kargs shell: cat /proc/cmdline | grep {{item}} From a657b76ba158d7b6fef3b0459fd649b17f2e29ae Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Thu, 1 Aug 2024 13:01:59 +0800 Subject: [PATCH 4/4] test: update / mount SOURCE checking case SOURCE can be overlay, none or composefs Signed-off-by: Xiaofeng Wang --- tests/e2e/playbooks/check-system.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/playbooks/check-system.yaml b/tests/e2e/playbooks/check-system.yaml index e7e19ce8f..793b87080 100644 --- a/tests/e2e/playbooks/check-system.yaml +++ b/tests/e2e/playbooks/check-system.yaml @@ -218,13 +218,16 @@ command: findmnt -r -o SOURCE -n / register: result_root_mount_point + # overlay: as default + # none: workaround issue https://gitlab.com/redhat/centos-stream/containers/bootc/-/issues/301 + # composefs: issue has been fixed by https://github.com/containers/composefs/pull/303 - name: / mount point checking block: - assert: that: - - result_root_mount_point.stdout == "overlay" - fail_msg: "/ does not mount with overlay" - success_msg: "/ mounts with overlay" + - result_root_mount_point.stdout == "overlay" or result_root_mount_point.stdout == "none" or result_root_mount_point.stdout == "composefs" + fail_msg: "/ does not mount with overlay or none or composefs" + success_msg: "/ mounts with overlay or none or composefs" always: - set_fact: total_counter: "{{ total_counter | int + 1 }}"