Skip to content

Commit

Permalink
test: adjust os name variable in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mcattamoredhat authored and yih-redhat committed Jun 17, 2024
1 parent 1b5d76a commit 4007061
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 13 deletions.
14 changes: 12 additions & 2 deletions ostree-ami-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CONTAINER_TYPE=edge-container
CONTAINER_FILENAME=container.tar
RAW_TYPE=edge-ami
RAW_FILENAME=image.raw
ANSIBLE_OS_NAME="rhel-edge"
ANSIBLE_OS_NAME="redhat"
BUCKET_NAME="rhel-edge-${TEST_UUID}"
BUCKET_URL="s3://${BUCKET_NAME}"
OBJECT_URL="http://${BUCKET_NAME}.s3.${AWS_DEFAULT_REGION}.amazonaws.com"
Expand All @@ -42,13 +42,23 @@ EDGE_USER_PASSWORD=foobar
sudo mkdir -p /etc/osbuild-composer/repositories

case "${ID}-${VERSION_ID}" in
"rhel-9"*)
"rhel-9.3")
OSTREE_REF="rhel/9/${ARCH}/edge"
SYSROOT_RO="true"
;;
"rhel-9.4")
OSTREE_REF="rhel/9/${ARCH}/edge"
SYSROOT_RO="true"
;;
"rhel-9.5")
OSTREE_REF="rhel/9/${ARCH}/edge"
SYSROOT_RO="true"
ANSIBLE_OS_NAME="rhel-edge"
;;
"centos-9")
OSTREE_REF="centos/9/${ARCH}/edge"
SYSROOT_RO="true"
ANSIBLE_OS_NAME="rhel-edge"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
Expand Down
13 changes: 8 additions & 5 deletions ostree-fdo-aio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ INSTALLER_FILENAME=simplified-installer.iso
REF_PREFIX="rhel-edge"
# Workaround BZ#2108646
BOOT_ARGS="uefi"
OS_NAME="redhat"

# Set up temporary files.
TEMPDIR=$(mktemp -d)
Expand Down Expand Up @@ -157,6 +158,7 @@ case "${ID}-${VERSION_ID}" in
FDO_USER_ONBOARDING="true"
USER_IN_BLUEPRINT="true"
BLUEPRINT_USER="simple"
OS_NAME="rhel-edge"
;;
"centos-8")
OSTREE_REF="centos/8/${ARCH}/edge"
Expand All @@ -183,6 +185,7 @@ case "${ID}-${VERSION_ID}" in
FDO_USER_ONBOARDING="true"
USER_IN_BLUEPRINT="true"
BLUEPRINT_USER="simple"
OS_NAME="rhel-edge"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
Expand Down Expand Up @@ -637,7 +640,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
EOF

# Test IoT/Edge OS
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0

# Check test result
check_result
Expand Down Expand Up @@ -785,7 +788,7 @@ if [[ "$ANSIBLE_USER" == "fdouser" ]]; then
fi

# Test IoT/Edge OS
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0

# Check test result
check_result
Expand Down Expand Up @@ -923,7 +926,7 @@ if [[ "$ANSIBLE_USER" == "fdouser" ]]; then
fi

# Test IoT/Edge OS
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${REBASE_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${REBASE_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0

# Check test result
check_result
Expand Down Expand Up @@ -1065,7 +1068,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
EOF

# Test IoT/Edge OS
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0

# Check test result
check_result
Expand Down Expand Up @@ -1199,7 +1202,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
EOF

# Test IoT/Edge OS
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${UPGRADE_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${UPGRADE_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0

# Check test result
check_result
Expand Down
5 changes: 4 additions & 1 deletion ostree-fdo-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CONTAINER_FILENAME=container.tar
INSTALLER_TYPE=edge-simplified-installer
INSTALLER_FILENAME=simplified-installer.iso
REF_PREFIX="rhel-edge"
OS_NAME="redhat"

# Set up temporary files.
TEMPDIR=$(mktemp -d)
Expand All @@ -46,11 +47,13 @@ case "${ID}-${VERSION_ID}" in
OSTREE_REF="rhel/9/${ARCH}/edge"
OS_VARIANT="rhel9-unknown"
BOOT_ARGS="uefi"
OS_NAME="rhel-edge"
;;
"centos-9")
OSTREE_REF="centos/9/${ARCH}/edge"
OS_VARIANT="centos-stream9"
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
OS_NAME="rhel-edge"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
Expand Down Expand Up @@ -591,7 +594,7 @@ ansible_become_method=sudo
EOF

# Test IoT/Edge OS
sudo podman run -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name=rhel-edge -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
sudo podman run -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z --rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory -e os_name="${OS_NAME}" -e ostree_commit="${INSTALL_HASH}" -e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" -e fdo_credential="true" -e sysroot_ro="$SYSROOT_RO" check-ostree.yaml || RESULTS=0
check_result

# Clean up VM
Expand Down
1 change: 1 addition & 0 deletions ostree-ng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ case "${ID}-${VERSION_ID}" in
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
SYSROOT_RO="true"
DIRS_FILES_CUSTOMIZATION="true"
ANSIBLE_OS_NAME="rhel-edge"
;;
"fedora-38")
CONTAINER_IMAGE_TYPE=fedora-iot-container
Expand Down
4 changes: 3 additions & 1 deletion ostree-raw-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RAW_FILENAME=image.raw.xz
BOOT_ARGS="uefi"
# RHEL and CS default ostree os_name is redhat
# But Fedora uses fedora-iot
ANSIBLE_OS_NAME="rhel-edge"
ANSIBLE_OS_NAME="redhat"

# Set up temporary files.
TEMPDIR=$(mktemp -d)
Expand Down Expand Up @@ -121,6 +121,7 @@ case "${ID}-${VERSION_ID}" in
ADD_SSSD="true"
USER_IN_RAW="true"
SYSROOT_RO="true"
ANSIBLE_OS_NAME="rhel-edge"
;;
"centos-8")
OSTREE_REF="centos/8/${ARCH}/edge"
Expand All @@ -140,6 +141,7 @@ case "${ID}-${VERSION_ID}" in
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
USER_IN_RAW="true"
SYSROOT_RO="true"
ANSIBLE_OS_NAME="rhel-edge"
;;
"fedora-38")
CONTAINER_TYPE=fedora-iot-container
Expand Down
4 changes: 3 additions & 1 deletion ostree-simplified-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ SYSROOT_RO="false"

# No FDO and Ignition in simplified installer is only supported started from 8.8 and 9.2
NO_FDO="false"
OS_NAME="rhel-edge"
OS_NAME="redhat"

# Prepare osbuild-composer repository file
sudo mkdir -p /etc/osbuild-composer/repositories
Expand Down Expand Up @@ -201,6 +201,7 @@ case "${ID}-${VERSION_ID}" in
USER_IN_BLUEPRINT="true"
BLUEPRINT_USER="simple"
NO_FDO="true"
OS_NAME="rhel-edge"
;;
"centos-8")
OSTREE_REF="centos/8/${ARCH}/edge"
Expand Down Expand Up @@ -229,6 +230,7 @@ case "${ID}-${VERSION_ID}" in
USER_IN_BLUEPRINT="true"
BLUEPRINT_USER="simple"
NO_FDO="true"
OS_NAME="rhel-edge"
;;
"fedora-"*)
OSTREE_REF="fedora/${VERSION_ID}/${ARCH}/iot"
Expand Down
23 changes: 20 additions & 3 deletions ostree-vsphere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ CONTAINER_FILENAME=container.tar
VSPHERE_IMAGE_TYPE=edge-vsphere
VSPHERE_FILENAME=image.vmdk
REF_PREFIX="rhel-edge"
OS_NAME="redhat"

# Set up temporary files.
TEMPDIR=$(mktemp -d)
Expand Down Expand Up @@ -60,21 +61,37 @@ DATACENTER_70_POOL="/Datacenter7.0/host/Automation/Resources"

# Workdaround for creating rhel9 and centos9 on dc67, change guest_id to 8
case "${ID}-${VERSION_ID}" in
"rhel-9"* )
"rhel-9.3" )
OSTREE_REF="rhel/9/${ARCH}/edge"
# GUEST_ID_DC67="rhel8_64Guest"
GUEST_ID_DC70="rhel9_64Guest"
;;
"rhel-9.4" )
OSTREE_REF="rhel/9/${ARCH}/edge"
# GUEST_ID_DC67="rhel8_64Guest"
GUEST_ID_DC70="rhel9_64Guest"
;;
"rhel-9.5" )
OSTREE_REF="rhel/9/${ARCH}/edge"
# GUEST_ID_DC67="rhel8_64Guest"
GUEST_ID_DC70="rhel9_64Guest"
OS_NAME="rhel-edge"
;;
"centos-9")
OSTREE_REF="centos/9/${ARCH}/edge"
# GUEST_ID_DC67="centos8_64Guest"
GUEST_ID_DC70="centos9_64Guest"
OS_NAME="rhel-edge"
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
exit 1;;
esac

if [[ "${ID}-${VERSION_ID}" == "rhel-9.5" ]]; then
OS_NAME="rhel-edge"
fi

# Colorful output.
function greenprint {
echo -e "\033[1;32m${1}\033[0m"
Expand Down Expand Up @@ -486,7 +503,7 @@ EOF
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z \
--rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory \
-e ignition="true" \
-e os_name=rhel-edge \
-e os_name="${OS_NAME}" \
-e ostree_commit="${INSTALL_HASH}" \
-e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" \
-e fdo_credential="false" \
Expand Down Expand Up @@ -681,7 +698,7 @@ EOF
podman run --annotation run.oci.keep_original_groups=1 -v "$(pwd)":/work:z -v "${TEMPDIR}":/tmp:z \
--rm quay.io/rhel-edge/ansible-runner:latest ansible-playbook -v -i /tmp/inventory \
-e ignition="true" \
-e os_name=rhel-edge \
-e os_name="${OS_NAME}" \
-e ostree_commit="${UPGRADE_HASH}" \
-e ostree_ref="${REF_PREFIX}:${OSTREE_REF}" \
-e fdo_credential="false" \
Expand Down

0 comments on commit 4007061

Please sign in to comment.