Skip to content

Commit

Permalink
Switched to using a switch statement in osname parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhalenar committed Oct 10, 2024
1 parent f306824 commit 79bfe2f
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,19 +533,31 @@ launch_vm() {
vm_extra_args="fips=${fips_mode}"
vm_initrd_inject=""

declare -A os_map=(
["rhel94-bootc"]="rhel9.4"
["rhel-9.4"]="rhel9.4"
["centos9-bootc"]="centos-stream9"
["centos9"]="centos-stream9")
local osname

case "${boot_blueprint}" in
rhel*9*4*)
osname="rhel9.4"
;;
centos9*)
osname="centos-stream9"
;;
*)
record_junit "${vmname}" "osname-parse" "FAILED"
exit 1
;;
esac

record_junit "${vmname}" "osname-parse" "OK"


# Add support of bootc image directory sharing with virtual machines
if [ "${bootc_mode}" -ne 0 ] ; then
# The ISO files generated by bootc-image-builder is not recognized by virt-install.
# Work around the problem by specifying kernel and initrd paths.
if [[ "${boot_blueprint}.iso" == *-bootc.iso ]] ; then
vm_loc_args+=",kernel=images/pxeboot/vmlinuz,initrd=images/pxeboot/initrd.img"
vm_loc_args+=" --osinfo name=${os_map[${boot_blueprint}]}"
vm_loc_args+=" --osinfo name=${osname}"
fi
fi

Expand Down

0 comments on commit 79bfe2f

Please sign in to comment.