Skip to content

Commit

Permalink
Update the Virtualization Script for 24.04 (BugFix) (canonical#968)
Browse files Browse the repository at this point in the history
Updated the canonical-certification.conf for noble
Updated the precheck script to remove the UVT_KVM test
Updated the script to call the KVM check image test
  • Loading branch information
mreed8855 authored and LiaoU3 committed Mar 20, 2024
1 parent da8cf32 commit 2b4e6ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DISK_MDADM_READ_PERF = 150
# KVM_IMAGE = http://cloud-images.ubuntu.com/daily/server/daily/server/{release}
#
# Example:
# KVM_IMAGE = file:///home/ubuntu/jammy-server-cloudimg-amd64.img
# KVM_IMAGE = file:///home/ubuntu/noble-server-cloudimg-amd64.img
#
# Note that a MAAS server set up via the MANIACS guide may optionally house
# copies of the KVM images under http://{ip-address}/cloud/.
Expand Down Expand Up @@ -79,8 +79,8 @@ DISK_MDADM_READ_PERF = 150
# UNCOMMENT BOTH OF THE FOLLOWING 2 LINES nad set the proper URLs as necessary
# OR leave them commented out and the LXD test will obtain the needed images
# from cloud-images.ubuntu.com.
#LXD_ROOTFS = http://server_url/path/to/jammy-server-cloudimg-amd64.squashfs
#LXD_TEMPLATE = http://server_url/path/to/jammy-server-cloudimg-amd64-lxd.tar.xz
#LXD_ROOTFS = http://server_url/path/to/noble-server-cloudimg-amd64.squashfs
#LXD_TEMPLATE = http://server_url/path/to/noble-server-cloudimg-amd64-lxd.tar.xz

# The STRESS_NG_MIN_SWAP_SIZE environment variable sets the minimum swap
# space, in gibibytes (GiB), that the stress/memory_stress_ng test requires.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ info(){
eval pass${i}=3
}

steps="Fix_APT_Issues Verify_Config_File Ubuntu_Version Arch EFI_Mode CCS_Version SID_Check Installed_Ram Virtualization_Support NICs_enabled Jumbo_Frames IPERF Network_Subnets LVM_Check Hard_Disks USB_Disks Disk_Speed_Check UVT_KVM_Image_Check LXD_Image_Check XDG_Check CPUFreq_Check GPGPU_Check NVDIMM_Detection"
steps="Fix_APT_Issues Verify_Config_File Ubuntu_Version Arch EFI_Mode CCS_Version SID_Check Installed_Ram Virtualization_Support NICs_enabled Jumbo_Frames IPERF Network_Subnets LVM_Check Hard_Disks USB_Disks Disk_Speed_Check KVM_Image_Check LXD_Image_Check XDG_Check CPUFreq_Check GPGPU_Check NVDIMM_Detection"

while getopts "i" opt; do
case $opt in
Expand Down Expand Up @@ -388,43 +388,6 @@ else
fi
}

# Check local availability of UVT KVM image or source
UVT_KVM_Image_Check(){
echoname "UVT_KVM Image Check"
if grep "^UVT_IMAGE_OR_SOURCE =" $configfile >/dev/null; then
kvmurl=$(grep ^UVT_IMAGE_OR_SOURCE $configfile|awk '{print $3}')
echo $kvmurl
if [[ "$kvmurl" =~ .*\.img$ ]] ; then
/usr/bin/qemu-img check $kvmurl >/dev/null 2>&1
if [ $? = "0" ]; then
echo -e " $kvmurl is a valid image.\n Continuing to use this image"
pass
return 0
else
echo -e "$kvmurl is an invalid image. \n"
fail
return 0
fi
elif [[ "$kvmurl" =~ ^http ]] ; then
if curl --output /dev/null --silent --head -fail "$kvmurl"; then
echo -e " This is a valid source $kvmurl.\n Continuing to use this source"
pass
else
echo -e " This is not a valid source $kvmurl.\n Marking as failed"
fail
fi
else
echo -e " This is not a valid image or source"
echo -e " Leaving configuration but commenting out.\n Trying cloud image."
sudo sed -i '/^UVT_IMAGE_OR_SOURCE/ s/^#*/#/' $configfile
fail
fi
else
echo -e " UVT_IMAGE_OR_SOURCE is not configured. \n uvt-simplestreams-libvirt will download images from cloud-images.ubuntu by default"
fail
fi
}

# Check local availability of KVM image or pull from Internet, which tends to be slow
KVM_Image_Check(){
echoname "KVM Image Check"
Expand Down

0 comments on commit 2b4e6ca

Please sign in to comment.