Merge ~mreed8855/plainbox-provider-certification-server:uvt-virtualization2 into plainbox-provider-certification-server:master

Proposed by Michael Reed
Status: Merged
Approved by: Michael Reed
Approved revision: c58a9228301e84a751162e1327c5b38ffcc360b7
Merged at revision: 0c8cf36cd4143f6f12ecba43fd45a5eb51b3020c
Proposed branch: ~mreed8855/plainbox-provider-certification-server:uvt-virtualization2
Merge into: plainbox-provider-certification-server:master
Diff against target: 117 lines (+68/-2)
3 files modified
configs/canonical-certification.conf (+23/-0)
tools/canonical-certification-precheck (+39/-1)
units/packaging.pxu (+6/-1)
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+397525@code.launchpad.net

Commit message

Currently the kvm test is failing due to a python traceback error. I propose replacing this test with the use of uvt to test kvm. The bug that this attempts to solve is https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1895168

This replaces the previous merge proposal
https://code.launchpad.net/~mreed8855/plainbox-provider-certification-server/+git/plainbox-provider-certification-server/+merge/395793

Description of the change

Currently the kvm test is failing due to a python traceback error. I propose replacing this test with the use of uvt to test kvm. The bug that this attempts to solve is https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1895168

This is related to the following merge proposal
https://code.launchpad.net/~mreed8855/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/397524

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

Needs to leave the LXD stuff intact, but ok to remove the old KVM stuff.

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

inline comments added

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Looks like this MR is awaiting another patch. I'm marking it as "Work in progress".

Revision history for this message
Jeff Lane  (bladernr) wrote :

One last thing...
need to modify plainbox-provider-certification-server/tools/canonical-certification-precheck so that it will configure UVT_IMAGE_OR_SOURCE in the conf file.

There are examples in there for handling the LXD and KVM images so you should be able to just copy/pasta and make minor mods to one of those.

So nothing to fix, just one more thing to add.

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

Need to fix the merge conflicts in the diff. This is likely because your branch is far enough behind the current master that you need to do a rebase on the updated master.

review: Needs Fixing
Revision history for this message
Michael Reed (mreed8855) wrote :

I did a hard reset on my branch to remove my changes, I merged it with an updated master branch , added my changes back in and pushed it. This required a forced merge so I am not sure if that resolved the conflict.

Revision history for this message
Jeff Lane  (bladernr) wrote :

still needs a bit of fixing. See below

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configs/canonical-certification.conf b/configs/canonical-certification.conf
2index 99cdd28..cd53c88 100644
3--- a/configs/canonical-certification.conf
4+++ b/configs/canonical-certification.conf
5@@ -26,6 +26,9 @@ DISK_MDADM_READ_PERF = 150
6
7 # For virtualization testing:
8 #
9+# The KVM_TIMEOUT and KVM_IMAGE variables will soon be deprecated
10+# and will no longer work
11+#
12 # KVM_TIMEOUT sets the timeout to wait for the cloudimg to boot before exiting
13 # test. It is an integer in seconds (the default is 3000 seconds)
14 # KVM_IMAGE the location to find the cloud image to use for testing KVM. This
15@@ -54,6 +57,26 @@ DISK_MDADM_READ_PERF = 150
16 #KVM_TIMEOUT = 300
17 #KVM_IMAGE = /path/to/cloudimage-filename.img
18
19+# For virtualization testing using the uvtool:
20+# UVT_IMAGE_OR_SOURCE - the location of of the cloud image or the source
21+# for testing kvm using the uvtool
22+# Options:
23+#
24+# Specify a location for uvt-simplestreams-libvirt to retrive an image
25+#
26+# Example:
27+# UVT_IMAGE_OR_SOURCE = http://cloud-images.ubuntu.com/daily/server/daily/server/{release}
28+#
29+# Specify a cloud image for uvt-kvm create to create a vm
30+# - file:///local/path/to/cloud.img
31+# - This will tell the script to look at the path specified on the local
32+# filesystem for a copy of the cloud image to use.
33+#
34+# Example:
35+# UVT_IMAGE_OR_SOURCE = file:///home/ubuntu/focal-server-cloudimg-amd64.img
36+#
37+#UVT_IMAGE_OR_SOURCE =
38+
39 # For LXD testing:
40 #
41 # LXD_ROOTFS is the tarall that contains the pre-created root filesystem for
42diff --git a/tools/canonical-certification-precheck b/tools/canonical-certification-precheck
43index 0460ebe..b2da402 100755
44--- a/tools/canonical-certification-precheck
45+++ b/tools/canonical-certification-precheck
46@@ -21,7 +21,7 @@ info(){
47
48
49
50-steps="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"
51+steps="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"
52
53 while getopts "i" opt; do
54 case $opt in
55@@ -343,6 +343,44 @@ else
56 fi
57 }
58
59+# Check local availability of UVT KVM image or source
60+UVT_KVM_Image_Check(){
61+name="UVT_KVM Image Check"
62+echoname
63+if grep "^UVT_IMAGE_OR_SOURCE =" /etc/xdg/canonical-certification.conf >/dev/null; then
64+ kvmurl=$(grep ^UVT_IMAGE_OR_SOURCE /etc/xdg/canonical-certification.conf|awk '{print $3}')
65+ echo $kvmurl
66+ if [[ "$kvmurl" =~ .*\.img$ ]] ; then
67+ /usr/bin/qemu-img check $kvmurl >/dev/null 2>&1
68+ if [ $? = "0" ]; then
69+ echo -e " $kvmurl is a valid image.\n Continuing to use this image"
70+ pass
71+ return 0
72+ else
73+ echo -e "$kvmurl is an invalid image. \n"
74+ fail
75+ return 0
76+ fi
77+ elif [[ "$kvmurl" =~ ^http ]] ; then
78+ if curl --output /dev/null --silent --head -fail "$kvmurl"; then
79+ echo -e " This is a valid source $kvmurl.\n Continuing to use this source"
80+ pass
81+ else
82+ echo -e " This is not a valid source $kvmurl.\n Marking as failed"
83+ fail
84+ fi
85+ else
86+ echo -e " This is not a valid image or source"
87+ echo -e " Leaving configuration but commenting out.\n Trying cloud image."
88+ sudo sed -i '/^UVT_IMAGE_OR_SOURCE/ s/^#*/#/' /etc/xdg/canonical-certification.conf
89+ fail
90+ fi
91+else
92+ echo -e " UVT_IMAGE_OR_SOURCE is not configured. \n uvt-simplestreams-libvirt will download images from cloud-images.ubuntu by default"
93+ fail
94+fi
95+}
96+
97 # Check local availability of KVM image or pull from Internet, which tends to be slow
98 KVM_Image_Check(){
99 name="KVM Image Check"
100diff --git a/units/packaging.pxu b/units/packaging.pxu
101index 347b964..70b6430 100644
102--- a/units/packaging.pxu
103+++ b/units/packaging.pxu
104@@ -1,7 +1,12 @@
105 # This is for 'virtualization/kvm_check_vm'
106 unit: packaging meta-data
107 os-id: debian
108-Depends: genisoimage
109+Depends: uvtool
110+
111+# This is for 'virtualization/kvm_check_vm'
112+unit: packaging meta-data
113+os-id: debian
114+Depends: uvtool-libvirt
115
116 # The 'memory/memory_stress_ng' job requires numactl
117 unit: packaging meta-data

Subscribers

People subscribed via source and target branches