From 923f554715a3fe74c92feaf307bebaa1867fe429 Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Wed, 15 Nov 2023 16:50:45 +0800 Subject: [PATCH] [guest-test] Test Enhance: drop kernel_img and initrd_img for osv_sanity common.json drop kernel_img and initrd_img in osv_sanity common.json reference config [Test Components] tdx [Test Types] any [Supported Devices] spr,emr,gnr,srf Signed-off-by: Hongyu Ning --- guest-test/osv_sanity/common.json | 4 +--- guest-test/qemu_get_config.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/guest-test/osv_sanity/common.json b/guest-test/osv_sanity/common.json index 04d92b04..212c667e 100644 --- a/guest-test/osv_sanity/common.json +++ b/guest-test/osv_sanity/common.json @@ -1,10 +1,8 @@ { - "kernel_img": "/boot/vmlinuz-xxx-yyy", - "initrd_img": "/boot/initramfs-xxx-yyy", "bios_img": "/path/to/EDKII/OVMF.fd or other virtual BIOS", "qemu_img": "/path/to/qemu-kvm with proper capabilty of VM test", "guest_img": "/path/to/prepared/guest_os_image, in qcow2 or raw image format", - "guest_img_format": "raw", + "guest_img_format": "raw or qcow2", "boot_pattern": "*Kernel*on*an*x86_64*", "guest_root_passwd": "123456" } \ No newline at end of file diff --git a/guest-test/qemu_get_config.py b/guest-test/qemu_get_config.py index 5d79b711..28a98ae0 100755 --- a/guest-test/qemu_get_config.py +++ b/guest-test/qemu_get_config.py @@ -42,8 +42,14 @@ qemu_config = json.loads(raw_config) # pre-config G-list variables' values confirmed by common.json -kernel_img = image_config["kernel_img"] -initrd_img = image_config["initrd_img"] +if os.path.isfile(image_config["kernel_img"]): + kernel_img = image_config["kernel_img"] +else: + kernel_img = "not_use" +if os.path.isfile(image_config["initrd_img"]): + initrd_img = image_config["initrd_img"] +else: + initrd_img = "not_use" bios_img = image_config["bios_img"] qemu_img = image_config["qemu_img"] guest_img = image_config["guest_img"]