From 0223cf8c2bdbef8036fbf7e52078e59cb3f6550d Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 3 Mar 2020 09:48:32 +0100 Subject: [PATCH] ci: Update ClearLinux image A new ClearLinux image has been uploaded to the Azure storage account. It is based off of the ClearLinux cloudguest image 31310 version, with three extra bundles added to it. First bundle is curl, which adds the curl binary to the image, second bundle is iperf, adding the iperf binary to the image, and third bundle is sysadmin-basic to include utility like netcat. The image is 2G in size. Signed-off-by: Sebastien Boeuf --- docs/custom-image.md | 2 +- scripts/run_integration_tests.sh | 8 ++-- scripts/sha1sums | 6 +++ .../clear/openstack/latest/user_data | 2 +- tests/integration.rs | 40 +++++++++---------- 5 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 scripts/sha1sums diff --git a/docs/custom-image.md b/docs/custom-image.md index e57c13c54..fb779dc8b 100644 --- a/docs/custom-image.md +++ b/docs/custom-image.md @@ -45,7 +45,7 @@ sudo swupd bundle-add os-installer wget https://download.clearlinux.org/current/config/image/cloudguest.yaml sed -i '/size: \"864M\"/d' cloudguest.yaml sed -i 's/\"800M\"/\"2G\"/g' cloudguest.yaml -sed -i 's/bootloader,/bootloader,\n iperf,/g' cloudguest.yaml +sed -i 's/bootloader,/bootloader,\n curl,\n iperf,/g' cloudguest.yaml sed -i 's/systemd-networkd-autostart/sysadmin-basic,\n systemd-networkd-autostart/g' cloudguest.yaml # Create the custom cloudguest image clr-installer -c cloudguest.yaml diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index f54ffbf00..5e0c0962b 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -6,6 +6,8 @@ source $HOME/.cargo/env WORKLOADS_DIR="$HOME/workloads" mkdir -p "$WORKLOADS_DIR" +cp scripts/sha1sums $WORKLOADS_DIR + FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]') FW="$WORKLOADS_DIR/hypervisor-fw" if [ ! -f "$FW" ]; then @@ -14,7 +16,7 @@ if [ ! -f "$FW" ]; then popd fi -CLEAR_OS_IMAGE_NAME="clear-31310-cloudguest.img" +CLEAR_OS_IMAGE_NAME="clear-31311-cloudguest.img" CLEAR_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/$CLEAR_OS_IMAGE_NAME" CLEAR_OS_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_IMAGE_NAME" if [ ! -f "$CLEAR_OS_IMAGE" ]; then @@ -23,7 +25,7 @@ if [ ! -f "$CLEAR_OS_IMAGE" ]; then popd fi -CLEAR_OS_RAW_IMAGE_NAME="clear-31310-cloudguest-raw.img" +CLEAR_OS_RAW_IMAGE_NAME="clear-31311-cloudguest-raw.img" CLEAR_OS_RAW_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_RAW_IMAGE_NAME" if [ ! -f "$CLEAR_OS_RAW_IMAGE" ]; then pushd $WORKLOADS_DIR @@ -67,7 +69,7 @@ if [ ! -f "$EOAN_OS_RAW_IMAGE" ]; then fi pushd $WORKLOADS_DIR -curl --silent "https://cloudhypervisorstorage.blob.core.windows.net/images/sha1sums" | sha1sum --check +cat sha1sums | sha1sum --check if [ $? -ne 0 ]; then echo "sha1sum validation of images failed, remove invalid images to fix the issue." exit 1 diff --git a/scripts/sha1sums b/scripts/sha1sums new file mode 100644 index 000000000..ff2590a6a --- /dev/null +++ b/scripts/sha1sums @@ -0,0 +1,6 @@ +cf7cfa783082fc4d6b4d1c0a53e4402648c14b82 clear-31311-cloudguest.img +142a410546b592ff9536b46bb410faf8ac11edee clear-31311-cloudguest-raw.img +27f3b17962ace69b51f0ddc2012095e3109e6ed8 bionic-server-cloudimg-amd64.img +8db9cc58b01452ce2d06c313177e6e74d8582d93 bionic-server-cloudimg-amd64-raw.img +4a452cdcf781f95d31a1668ecb92a937c176709a eoan-server-cloudimg-amd64.img +91fdfb21df8920fd55915edf7669282cda2505f6 eoan-server-cloudimg-amd64-raw.img diff --git a/test_data/cloud-init/clear/openstack/latest/user_data b/test_data/cloud-init/clear/openstack/latest/user_data index c2c07ca1a..7cef0340a 100644 --- a/test_data/cloud-init/clear/openstack/latest/user_data +++ b/test_data/cloud-init/clear/openstack/latest/user_data @@ -66,4 +66,4 @@ write_files: # 512M ram requires 256 pages echo 256 | sudo tee /proc/sys/vm/nr_hugepages sudo chmod a+rwX /dev/hugepages - /mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=/dev/vda2 VFIOTAG" --disk path=/mnt/clear-31310-cloudguest.img path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,file=/dev/hugepages --device path=/sys/bus/pci/devices/0000:00:05.0/ path=/sys/bus/pci/devices/0000:00:06.0/ + /mnt/cloud-hypervisor --kernel /mnt/vmlinux --cmdline "console=hvc0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c VFIOTAG" --disk path=/mnt/clear-31311-cloudguest.img path=/mnt/cloudinit.img --cpus boot=1 --memory size=512M,file=/dev/hugepages --device path=/sys/bus/pci/devices/0000:00:05.0/ path=/sys/bus/pci/devices/0000:00:06.0/ diff --git a/tests/integration.rs b/tests/integration.rs index 30e0960a8..cf08f8451 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -193,10 +193,10 @@ mod tests { workload_path.push("workloads"); let mut osdisk_base_path = workload_path.clone(); - osdisk_base_path.push("clear-31310-cloudguest.img"); + osdisk_base_path.push("clear-31311-cloudguest.img"); let mut osdisk_raw_base_path = workload_path; - osdisk_raw_base_path.push("clear-31310-cloudguest-raw.img"); + osdisk_raw_base_path.push("clear-31311-cloudguest-raw.img"); let osdisk_path = String::from(tmp_dir.path().join("osdisk.img").to_str().unwrap()); let osdisk_raw_path = @@ -955,7 +955,7 @@ mod tests { .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -1000,7 +1000,7 @@ mod tests { .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -1143,7 +1143,7 @@ mod tests { .spawn() .unwrap(); - thread::sleep(std::time::Duration::new(10, 0)); + thread::sleep(std::time::Duration::new(20, 0)); // 1 network interface + default localhost ==> 2 interfaces // It's important to note that this test is fully exercising the // vhost-user-net implementation and the associated backend since @@ -1161,8 +1161,6 @@ mod tests { 2 ); - thread::sleep(std::time::Duration::new(10, 0)); - // The following pci devices will appear on guest with PCI-MSI // interrupt vectors assigned. // 1 virtio-console with 3 vectors: config, Rx, Tx @@ -1581,7 +1579,7 @@ mod tests { // Just check the VM booted correctly. aver_eq!(tb, guest.get_cpu_count().unwrap_or_default(), 1); - aver!(tb, guest.get_total_memory().unwrap_or_default() > 492_000); + aver!(tb, guest.get_total_memory().unwrap_or_default() > 491_000); aver!(tb, guest.get_entropy().unwrap_or_default() >= 900); let _ = cloud_child.kill(); @@ -1687,7 +1685,7 @@ mod tests { ]) .args(&[ "--cmdline", - "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 \ + "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c \ console=tty0 console=ttyS0,115200n8 console=hvc0 quiet \ init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable \ no_timer_check noreplace-smp cryptomgr.notests \ @@ -1816,7 +1814,7 @@ mod tests { ) .as_str(), ]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -1870,7 +1868,7 @@ mod tests { ) .as_str(), ]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -2234,7 +2232,7 @@ mod tests { .args(&["--memory", "size=1G,file=/dev/hugepages"]) .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 vfio_iommu_type1.allow_unsafe_interrupts rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 vfio_iommu_type1.allow_unsafe_interrupts rw"]) .args(&[ "--net", format!( @@ -2321,7 +2319,7 @@ mod tests { .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw acpi=off"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw acpi=off"]) .spawn() .unwrap(); @@ -2425,7 +2423,7 @@ mod tests { .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -2556,7 +2554,7 @@ mod tests { // Then boot it curl_command(&api_socket, "PUT", "http://localhost/api/v1/vm.boot", None); - thread::sleep(std::time::Duration::new(5, 0)); + thread::sleep(std::time::Duration::new(20, 0)); // Check that the VM booted as expected aver_eq!( @@ -2610,7 +2608,7 @@ mod tests { // Then boot it curl_command(&api_socket, "PUT", "http://localhost/api/v1/vm.boot", None); - thread::sleep(std::time::Duration::new(5, 0)); + thread::sleep(std::time::Duration::new(20, 0)); // Check that the VM booted as expected aver_eq!( @@ -2695,7 +2693,7 @@ mod tests { .as_str(), ]) .args(&["--net", guest.default_net_string_w_iommu().as_str()]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap(); @@ -2946,7 +2944,7 @@ mod tests { .args(&["--cpus", "boot=2,max=4"]) .args(&["--memory", "size=512M"]) .args(&["--kernel", kernel_path.to_str().unwrap()]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .default_disks() .default_net() .args(&["--api-socket", &api_socket]) @@ -3038,7 +3036,7 @@ mod tests { .args(&["--cpus", "boot=2,max=4"]) .args(&["--memory", "size=512M,hotplug_size=8192M"]) .args(&["--kernel", kernel_path.to_str().unwrap()]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .default_disks() .default_net() .args(&["--api-socket", &api_socket]) @@ -3150,7 +3148,7 @@ mod tests { .args(&["--cpus", "boot=2,max=4"]) .args(&["--memory", "size=512M,hotplug_size=8192M"]) .args(&["--kernel", kernel_path.to_str().unwrap()]) - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .default_disks() .default_net() .args(&["--api-socket", &api_socket]) @@ -3247,7 +3245,7 @@ mod tests { .args(&["--kernel", kernel_path.to_str().unwrap()]) .default_disks() .default_net() - .args(&["--cmdline", "root=PARTUUID=8d93774b-e12c-4ac5-aa35-77bfa7168767 console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) + .args(&["--cmdline", "root=PARTUUID=6fb4d1a8-6c8c-4dd7-9f7c-1fe0b9f2574c console=tty0 console=ttyS0,115200n8 console=hvc0 quiet init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp cryptomgr.notests rootfstype=ext4,btrfs,xfs kvm-intel.nested=1 rw"]) .spawn() .unwrap();