Skip to content

Commit

Permalink
schutzfile: Update snapshots to 20230701
Browse files Browse the repository at this point in the history
  • Loading branch information
schutzbot authored and yih-redhat committed Aug 31, 2023
1 parent f0eb8e9 commit 6c1f8f6
Showing 1 changed file with 58 additions and 26 deletions.
84 changes: 58 additions & 26 deletions test/cases/ostree-simplified-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -919,9 +946,6 @@ version = "*"
name = "wget"
version = "*"
[customizations.kernel]
name = "${KERNEL_RT_PKG}"
[[customizations.user]]
name = "admin"
description = "Administrator account"
Expand All @@ -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"

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 6c1f8f6

Please sign in to comment.