From e6dd429a646b080f2a729d2aaaf8ed44e822843b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 28 Nov 2025 14:26:30 +0100 Subject: [PATCH] tests: qcow: Add testing for uncompressed backing file Signed-off-by: Anatol Belski --- scripts/run_integration_tests_aarch64.sh | 10 ++++++++++ scripts/run_integration_tests_x86_64.sh | 10 ++++++++++ tests/integration.rs | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/scripts/run_integration_tests_aarch64.sh b/scripts/run_integration_tests_aarch64.sh index 35115461c..c13d7b9ad 100755 --- a/scripts/run_integration_tests_aarch64.sh +++ b/scripts/run_integration_tests_aarch64.sh @@ -90,6 +90,16 @@ update_workloads() { popd || exit fi + JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME="jammy-server-cloudimg-arm64-custom-20220329-0-backing-uncompressed.qcow2" + JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE="$WORKLOADS_DIR/$JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME" + if [ ! -f "$JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE" ]; then + pushd "$WORKLOADS_DIR" || exit + time qemu-img create -f qcow2 \ + -b "$JAMMY_OS_QCOW2_UNCOMPRESSED_IMAGE" \ + -F qcow2 $JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME + popd || exit + fi + ALPINE_MINIROOTFS_URL="http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/aarch64/alpine-minirootfs-3.11.3-aarch64.tar.gz" ALPINE_MINIROOTFS_TARBALL="$WORKLOADS_DIR/alpine-minirootfs-aarch64.tar.gz" if [ ! -f "$ALPINE_MINIROOTFS_TARBALL" ]; then diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index 84cda3b01..32983672b 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -90,6 +90,16 @@ if [ ! -f "$JAMMY_OS_QCOW_BACKING_ZSTD_FILE_IMAGE" ]; then popd || exit fi +JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME="jammy-server-cloudimg-amd64-custom-20241017-0-backing-uncompressed.qcow2" +JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE="$WORKLOADS_DIR/$JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME" +if [ ! -f "$JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE" ]; then + pushd "$WORKLOADS_DIR" || exit + time qemu-img create -f qcow2 \ + -b "$JAMMY_OS_IMAGE" \ + -F qcow2 $JAMMY_OS_QCOW_BACKING_UNCOMPRESSED_FILE_IMAGE_NAME + popd || exit +fi + ALPINE_MINIROOTFS_URL="http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/x86_64/alpine-minirootfs-3.11.3-x86_64.tar.gz" ALPINE_MINIROOTFS_TARBALL="$WORKLOADS_DIR/alpine-minirootfs-x86_64.tar.gz" if [ ! -f "$ALPINE_MINIROOTFS_TARBALL" ]; then diff --git a/tests/integration.rs b/tests/integration.rs index 3757d2a25..b0cc2ce88 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -47,6 +47,8 @@ mod x86_64 { "jammy-server-cloudimg-amd64-custom-20241017-0-zstd.qcow2"; pub const JAMMY_IMAGE_NAME_QCOW2_BACKING_ZSTD_FILE: &str = "jammy-server-cloudimg-amd64-custom-20241017-0-backing-zstd.qcow2"; + pub const JAMMY_IMAGE_NAME_QCOW2_BACKING_UNCOMPRESSED_FILE: &str = + "jammy-server-cloudimg-amd64-custom-20241017-0-backing-uncompressed.qcow2"; pub const WINDOWS_IMAGE_NAME: &str = "windows-server-2022-amd64-2.raw"; pub const OVMF_NAME: &str = "CLOUDHV.fd"; pub const GREP_SERIAL_IRQ_CMD: &str = "grep -c 'IO-APIC.*ttyS0' /proc/interrupts || true"; @@ -70,6 +72,8 @@ mod aarch64 { "jammy-server-cloudimg-arm64-custom-20220329-0-zstd.qcow2"; pub const JAMMY_IMAGE_NAME_QCOW2_BACKING_ZSTD_FILE: &str = "jammy-server-cloudimg-arm64-custom-20220329-0-backing-zstd.qcow2"; + pub const JAMMY_IMAGE_NAME_QCOW2_BACKING_UNCOMPRESSED_FILE: &str = + "jammy-server-cloudimg-arm64-custom-20220329-0-backing-uncompressed.qcow2"; pub const WINDOWS_IMAGE_NAME: &str = "windows-11-iot-enterprise-aarch64.raw"; pub const OVMF_NAME: &str = "CLOUDHV_EFI.fd"; pub const GREP_SERIAL_IRQ_CMD: &str = "grep -c 'GICv3.*uart-pl011' /proc/interrupts || true"; @@ -3547,6 +3551,12 @@ mod common_parallel { disk_check_consistency(JAMMY_IMAGE_NAME_QCOW2_BACKING_ZSTD_FILE); } + #[test] + fn test_virtio_block_qcow2_backing_uncompressed_file() { + _test_virtio_block(JAMMY_IMAGE_NAME_QCOW2_BACKING_UNCOMPRESSED_FILE, false, false); + disk_check_consistency(JAMMY_IMAGE_NAME_QCOW2_BACKING_UNCOMPRESSED_FILE); + } + #[test] fn test_virtio_block_vhd() { let mut workload_path = dirs::home_dir().unwrap();