Skip to content

Commit

Permalink
Merge pull request #187 from yih-redhat/add-cs9
Browse files Browse the repository at this point in the history
ci: add centos-stream-9 support
  • Loading branch information
yih-redhat authored Nov 25, 2024
2 parents 5f03e50 + 0eddd97 commit 0195d80
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/greenboot-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,26 @@ jobs:
secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }}"
variables: "ARCH=x86_64"
timeout: 90

Centos-stream-9-bootc:
needs: check-pull-request
if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
continue-on-error: true
runs-on: ubuntu-latest

steps:
- name: Run the tests
uses: sclorg/[email protected]
with:
compose: CentOS-Stream-9
api_key: ${{ secrets.TF_API_KEY }}
git_url: ${{ needs.check-pull-request.outputs.repo_url }}
git_ref: ${{ needs.check-pull-request.outputs.ref }}
# update_pull_request_status: true
# pull_request_status_name: "Centos-stream-9-bootc"
tmt_context: "arch=x86_64;distro=cs-9"
tmt_plan_regex: bootc
tf_scope: private
secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }}"
variables: "ARCH=x86_64"
timeout: 90
6 changes: 5 additions & 1 deletion tests/greenboot-bootc-anaconda-iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ case "${ID}-${VERSION_ID}" in
OS_VARIANT="fedora-unknown"
BASE_IMAGE_URL="quay.io/fedora/fedora-bootc:41"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi"
;;
"fedora-42")
OS_VARIANT="fedora-unknown"
BASE_IMAGE_URL="quay.io/fedora/fedora-bootc:42"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi"
;;
"centos-9")
OS_VARIANT="centos-stream9"
BASE_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream9"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
;;
"rhel-9.6")
OS_VARIANT="rhel9-unknown"
BASE_IMAGE_URL="registry.stage.redhat.io/rhel9/rhel-bootc:9.6"
BIB_URL="registry.stage.redhat.io/rhel9/bootc-image-builder:9.6"
BOOT_ARGS="uefi"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
Expand Down Expand Up @@ -283,7 +287,7 @@ sudo virt-install --name="${TEST_UUID}-uefi"\
--os-type linux \
--os-variant ${OS_VARIANT} \
--cdrom "/var/lib/libvirt/images/install.iso" \
--boot uefi \
--boot ${BOOT_ARGS} \
--nographics \
--noautoconsole \
--wait=-1 \
Expand Down
12 changes: 8 additions & 4 deletions tests/greenboot-bootc-qcow2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ case "${ID}-${VERSION_ID}" in
OS_VARIANT="fedora-unknown"
BASE_IMAGE_URL="quay.io/fedora/fedora-bootc:41"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi"
;;
"fedora-42")
OS_VARIANT="fedora-unknown"
BASE_IMAGE_URL="quay.io/fedora/fedora-bootc:42"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi"
;;
"centos-9")
OS_VARIANT="centos-stream9"
BASE_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream9"
BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
;;
"rhel-9.6")
OS_VARIANT="rhel9-unknown"
BASE_IMAGE_URL="registry.stage.redhat.io/rhel9/rhel-bootc:9.6"
BIB_URL="registry.stage.redhat.io/rhel9/bootc-image-builder:9.6"
BOOT_ARGS="uefi"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
Expand Down Expand Up @@ -172,7 +176,7 @@ cp rpmbuild/RPMS/x86_64/*.rpm tests/ && popd
## Build bootc container with greenboot installed
##
###########################################################
greenprint "Building rhel-edge-bootc container"
greenprint "Building bootc container with greenboot installed"
podman login quay.io -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD}
podman login registry.stage.redhat.io -u ${STAGE_REDHAT_IO_USERNAME} -p ${STAGE_REDHAT_IO_TOKEN}
tee Containerfile > /dev/null << EOF
Expand All @@ -189,7 +193,7 @@ RUN dnf install -y \
RUN rm -f /tmp/greenboot-*.rpm
EOF
podman build --retry=5 --retry-delay=10s -t quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID} -f Containerfile .
greenprint "Pushing greenboot-bootc container to quay.io"
greenprint "Pushing bootc container to quay.io"
podman push quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID}

###########################################################
Expand Down Expand Up @@ -237,7 +241,7 @@ podman run \
## Provision vm with qcow2/iso artifacts
##
###########################################################
greenprint "Installing vm with bootc qcow2 image"
greenprint "Installing vm with bootc qcow2/iso image"
mv $(pwd)/output/qcow2/disk.qcow2 /var/lib/libvirt/images/${TEST_UUID}-disk.qcow2
LIBVIRT_IMAGE_PATH_UEFI=/var/lib/libvirt/images/${TEST_UUID}-disk.qcow2
sudo restorecon -Rv /var/lib/libvirt/images/
Expand All @@ -248,7 +252,7 @@ sudo virt-install --name="${TEST_UUID}-uefi"\
--network network=integration,mac=34:49:22:B0:83:30 \
--os-type linux \
--os-variant ${OS_VARIANT} \
--boot uefi \
--boot ${BOOT_ARGS} \
--nographics \
--noautoconsole \
--wait=-1 \
Expand Down
22 changes: 22 additions & 0 deletions tests/greenboot-bootc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when: ansible_facts['distribution'] == 'Fedora'

# case: check greenboot* services
- name: a list of greenboot* service should be enabled
block:
- name: a list of greenboot* service should be enabled
command: systemctl is-enabled greenboot-grub2-set-counter greenboot-grub2-set-success greenboot-healthcheck greenboot-rpm-ostree-grub2-check-fallback greenboot-status greenboot-task-runner redboot-auto-reboot redboot-task-runner
register: result_greenboot_service

- assert:
that:
- result_greenboot_service.stdout == 'enabled\nenabled\nenabled\nenabled\nenabled\nenabled\nenabled\nenabled'
fail_msg: "Some of greenboot* services are not enabled"
success_msg: "All greenboot* services are enabled"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when: ansible_facts['distribution'] != 'Fedora'

# case: check greenboot fall back log
- name: fallback log should be found here
Expand Down

0 comments on commit 0195d80

Please sign in to comment.