From 0af53e4cade9239420b354ed488ec985e0cd899e Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Fri, 15 Apr 2022 22:18:22 +0800 Subject: [PATCH] test: Add fedora-iot-container and fedora-iot-installer tests --- .gitlab-ci.yml | 1 + schutzbot/terraform | 2 +- test/cases/ostree-ng.sh | 23 ++++++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bfcc09ebd..b6d18cc8d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -320,6 +320,7 @@ New OSTree: parallel: matrix: - RUNNER: + - rhos-01/fedora-35-x86_64-large - rhos-01/rhel-8.6-nightly-x86_64-large - rhos-01/rhel-9.0-nightly-x86_64-large - rhos-01/centos-stream-8-x86_64-large diff --git a/schutzbot/terraform b/schutzbot/terraform index de3aeb43b..0165cd9ea 100644 --- a/schutzbot/terraform +++ b/schutzbot/terraform @@ -1 +1 @@ -6d1fd6a47503950901b85b5b355d2ab4b5afd4f7 +5c047d53eb7213be272c452a8b09992618cd8aa0 diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index 335542f45..a7f6294e4 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -92,6 +92,7 @@ INSTALLER_TYPE=edge-installer INSTALLER_FILENAME=installer.iso mkdir -p "${ARTIFACTS}" ANSIBLE_USER_FOR_BIOS="installeruser" +OSTREE_OSNAME=rhel # Set up temporary files. TEMPDIR=$(mktemp -d) @@ -106,6 +107,13 @@ SSH_KEY=${SSH_DATA_DIR}/id_rsa SSH_KEY_PUB=$(cat "${SSH_KEY}".pub) case "${ID}-${VERSION_ID}" in + "fedora-35") + CONTAINER_TYPE=fedora-iot-container + INSTALLER_TYPE=fedora-iot-installer + OSTREE_REF="fedora/35/${ARCH}/iot" + OSTREE_OSNAME=fedora + OS_VARIANT="fedora35" + ;; "rhel-8.6") OSTREE_REF="test/rhel/8/${ARCH}/edge" OS_VARIANT="rhel8-unknown" @@ -168,8 +176,8 @@ poweroff echo -e 'admin\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers echo -e 'installeruser\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers # delete local ostree repo and add external prod edge repo -ostree remote delete rhel -ostree remote add --no-gpg-verify --no-sign-verify rhel ${PROD_REPO_URL} +ostree remote delete ${OSTREE_OSNAME} +ostree remote add --no-gpg-verify --no-sign-verify ${OSTREE_OSNAME} ${PROD_REPO_URL} %end EOFKS @@ -544,7 +552,7 @@ EOF # Test IoT/Edge OS greenprint "📼 Run Edge tests on BIOS VM" -sudo ansible-playbook -v -i "${TEMPDIR}"/inventory -e image_type=rhel -e ostree_commit="${INSTALL_HASH}" /usr/share/tests/osbuild-composer/ansible/check_ostree.yaml || RESULTS=0 +sudo ansible-playbook -v -i "${TEMPDIR}"/inventory -e image_type="$OSTREE_OSNAME" -e ostree_commit="${INSTALL_HASH}" /usr/share/tests/osbuild-composer/ansible/check_ostree.yaml || RESULTS=0 check_result # Clean up BIOS VM @@ -615,10 +623,15 @@ version = "*" [[packages]] name = "wget" version = "*" +EOF +# No RT kernel in Fedora +if [[ "$ID" != "fedora" ]]; then + tee -a "$BLUEPRINT_FILE" > /dev/null << EOF [customizations.kernel] name = "kernel-rt" EOF +fi greenprint "📄 upgrade blueprint" cat "$BLUEPRINT_FILE" @@ -678,7 +691,7 @@ sudo composer-cli blueprints delete upgrade > /dev/null # Upgrade image/commit. # Test user admin added by edge-container bp greenprint "🗳 Upgrade ostree image/commit" -sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} 'sudo rpm-ostree upgrade --os=rhel' +sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} "sudo rpm-ostree upgrade --os=${OSTREE_OSNAME}" sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} 'nohup sudo systemctl reboot &>/dev/null & exit' # Sleep 10 seconds here to make sure vm restarted already @@ -714,7 +727,7 @@ ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/ EOF # Test IoT/Edge OS -sudo ansible-playbook -v -i "${TEMPDIR}"/inventory -e image_type=rhel -e ostree_commit="${UPGRADE_HASH}" /usr/share/tests/osbuild-composer/ansible/check_ostree.yaml || RESULTS=0 +sudo ansible-playbook -v -i "${TEMPDIR}"/inventory -e image_type="$OSTREE_OSNAME" -e ostree_commit="${UPGRADE_HASH}" /usr/share/tests/osbuild-composer/ansible/check_ostree.yaml || RESULTS=0 check_result # Final success clean up