From 6c1f8f6490a3d3dc7e9ac0ad67fe81099993f3ad Mon Sep 17 00:00:00 2001 From: schutzbot Date: Sat, 1 Jul 2023 05:29:44 +0000 Subject: [PATCH] schutzfile: Update snapshots to 20230701 --- test/cases/ostree-simplified-installer.sh | 84 ++++++++++++++++------- 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/test/cases/ostree-simplified-installer.sh b/test/cases/ostree-simplified-installer.sh index db8185e2ef0..c3858c56ac9 100755 --- a/test/cases/ostree-simplified-installer.sh +++ b/test/cases/ostree-simplified-installer.sh @@ -125,7 +125,21 @@ SYSROOT_RO="false" ANSIBLE_USER="admin" FDO_USER_ONBOARDING="false" +IMAGE_TYPE=redhat + case "${ID}-${VERSION_ID}" in + "fedora-38") + OSTREE_REF="fedora/38/${ARCH}/iot" + PARENT_REF="fedora/38/${ARCH}/iot" + OS_VARIANT="fedora-unknown" + CONTAINER_TYPE="iot-container" + INSTALLER_TYPE="iot-simplified-installer" + REF_PREFIX="fedora-iot" + SYSROOT_RO="true" + IMAGE_TYPE="fedora" + ANSIBLE_USER=fdouser + FDO_USER_ONBOARDING="true" + ;; "rhel-8"* ) OSTREE_REF="rhel/8/${ARCH}/edge" PARENT_REF="rhel/8/${ARCH}/edge" @@ -173,8 +187,16 @@ if [[ "$FDO_USER_ONBOARDING" == "true" ]]; then fdouser ALL=(ALL) NOPASSWD: ALL EOF sudo /usr/local/bin/yq -iy '.service_info.files |= [{path: "/etc/sudoers.d/fdouser", source_path: "/tmp/fdouser"}]' /etc/fdo/aio/configs/serviceinfo_api_server.yml - sudo systemctl restart fdo-aio fi + +if [[ "${ID}" == "fedora" ]]; then + # Fedora iot-simplified-installer only has /dev/vda3, details https://github.com/osbuild/osbuild-composer/issues/3527 + echo "Change vda4 to vda3 for fedora in serviceinfo config file" + sudo sed -i 's/vda4/vda3/' /etc/fdo/aio/configs/serviceinfo_api_server.yml +fi + +sudo systemctl restart fdo-aio + # Wait for fdo server to be running until [ "$(curl -X POST http://${FDO_SERVER_ADDRESS}:8080/ping)" == "pong" ]; do sleep 1; @@ -366,18 +388,15 @@ version = "*" [[packages]] name = "sssd" version = "*" +EOF +# Fedora does not have kernel-rt +if [[ "$ID" != "fedora" ]]; then + tee -a "$BLUEPRINT_FILE" >> /dev/null << EOF [customizations.kernel] name = "${KERNEL_RT_PKG}" - -[[customizations.user]] -name = "admin" -description = "Administrator account" -password = "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl." -key = "${SSH_KEY_PUB}" -home = "/home/admin/" -groups = ["wheel"] EOF +fi greenprint "📄 container blueprint" cat "$BLUEPRINT_FILE" @@ -434,11 +453,11 @@ modules = [] groups = [] [[customizations.user]] -name = "simple" +name = "admin" description = "Administrator account" password = "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl." key = "${SSH_KEY_PUB}" -home = "/home/simple/" +home = "/home/admin/" groups = ["wheel"] [customizations] @@ -508,7 +527,7 @@ for _ in $(seq 0 30); do done # With new ostree-libs-2022.6-3, edge vm needs to reboot twice to make the /sysroot readonly -sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" "simple@${EDGE_GUEST_ADDRESS}" "echo ${EDGE_USER_PASSWORD} |nohup sudo -S systemctl reboot &>/dev/null & exit" +sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" "admin@${EDGE_GUEST_ADDRESS}" "echo ${EDGE_USER_PASSWORD} |nohup sudo -S systemctl reboot &>/dev/null & exit" # Sleep 10 seconds here to make sure vm restarted already sleep 10 for _ in $(seq 0 30); do @@ -532,7 +551,7 @@ ${EDGE_GUEST_ADDRESS} [ostree_guest:vars] ansible_python_interpreter=/usr/bin/python3 -ansible_user=simple +ansible_user=admin ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ansible_become=yes @@ -542,7 +561,7 @@ EOF # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${INSTALL_HASH}" \ -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \ @@ -575,11 +594,11 @@ groups = [] installation_device = "/dev/vda" [[customizations.user]] -name = "simple" +name = "admin" description = "Administrator account" password = "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl." key = "${SSH_KEY_PUB}" -home = "/home/simple/" +home = "/home/admin/" groups = ["wheel"] [customizations.fdo] @@ -705,7 +724,7 @@ ${EDGE_GUEST_ADDRESS} [ostree_guest:vars] ansible_python_interpreter=/usr/bin/python3 -ansible_user=simple +ansible_user=admin ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ansible_become=yes @@ -715,7 +734,7 @@ EOF # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${INSTALL_HASH}" \ -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \ @@ -751,6 +770,14 @@ groups = [] [customizations] installation_device = "/dev/vda" +[[customizations.user]] +name = "admin" +description = "Administrator account" +password = "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl." +key = "${SSH_KEY_PUB}" +home = "/home/admin/" +groups = ["wheel"] + [customizations.fdo] manufacturing_server_url="http://${FDO_SERVER_ADDRESS}:8080" diun_pub_key_hash="${DIUN_PUB_KEY_HASH}" @@ -886,11 +913,11 @@ fi # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${INSTALL_HASH}" \ - -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \ -e fdo_credential="true" \ + -e skip_rollback_test="true" \ -e sysroot_ro="$SYSROOT_RO" \ /usr/share/tests/osbuild-composer/ansible/check_ostree.yaml || RESULTS=0 check_result @@ -919,9 +946,6 @@ version = "*" name = "wget" version = "*" -[customizations.kernel] -name = "${KERNEL_RT_PKG}" - [[customizations.user]] name = "admin" description = "Administrator account" @@ -930,6 +954,14 @@ home = "/home/admin/" groups = ["wheel"] EOF +# Fedora does not have kernel-rt +if [[ "$ID" != "fedora" ]]; then + tee -a "$BLUEPRINT_FILE" >> /dev/null << EOF +[customizations.kernel] +name = "${KERNEL_RT_PKG}" +EOF +fi + greenprint "📄 rebase blueprint" cat "$BLUEPRINT_FILE" @@ -1023,7 +1055,7 @@ EOF # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${REBASE_HASH}" \ -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \ @@ -1183,7 +1215,7 @@ EOF # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${INSTALL_HASH}" \ -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \ @@ -1324,7 +1356,7 @@ EOF # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ - -e image_type=redhat \ + -e image_type=${IMAGE_TYPE} \ -e ostree_commit="${UPGRADE_HASH}" \ -e skip_rollback_test="true" \ -e edge_type=edge-simplified-installer \