Skip to content

Commit

Permalink
[guest-test] Test Enhance: separate json in osv_sanity example code
Browse files Browse the repository at this point in the history
same as previous commit, a standalone common.json separated from
qemu.config.json under osv_sanity, so end user only need to revise it
other than any rest source code files from guest-test framework or under
ovs_sanity specifically

[Test Components] tdx
[Test Types] any
[Supported Devices] spr,emr,gnr,srf

Signed-off-by: Hongyu Ning <[email protected]>
  • Loading branch information
hongyuni committed Nov 13, 2023
1 parent 76c09a5 commit 1645086
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
11 changes: 8 additions & 3 deletions guest-test/guest.test_launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ NOTE!! args passed here will override params in qemu.confg.json
-c guest kernel extra commandline
-p guest pmu off/on
-g [optional, default off] code coverage test mode off/on
-i [optional] path under guest-test to standalone common.json file
-j [optional] path under guest-test to standalone qemu.config.json file
-h HELP info
EOF
Expand Down Expand Up @@ -105,7 +106,7 @@ echo PORT="$PORT" > "$SCRIPT_DIR"/test_params.py
# used across test_launcher.sh, qemu_runner.py, test_executor.sh

# get args for QEMU boot configurable parameters
while getopts :v:s:m:d:t:x:c:p:g:j:h arg; do
while getopts :v:s:m:d:t:x:c:p:g:i:j:h arg; do
case $arg in
v)
VCPU=$OPTARG
Expand Down Expand Up @@ -143,9 +144,13 @@ while getopts :v:s:m:d:t:x:c:p:g:j:h arg; do
GCOV=$OPTARG
echo GCOV="\"$GCOV\"" >> "$SCRIPT_DIR"/test_params.py
;;
i)
JSON_C=$OPTARG
echo JSON_C="\"$JSON_C\"" >> "$SCRIPT_DIR"/test_params.py
;;
j)
JSON=$OPTARG
echo JSON="\"$JSON\"" >> "$SCRIPT_DIR"/test_params.py
JSON_Q=$OPTARG
echo JSON_Q="\"$JSON_Q\"" >> "$SCRIPT_DIR"/test_params.py
;;
h)
usage && exit 0
Expand Down
10 changes: 10 additions & 0 deletions guest-test/osv_sanity/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"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",
"boot_pattern": "*Kernel*on*an*x86_64*",
"guest_root_passwd": "123456"
}
8 changes: 0 additions & 8 deletions guest-test/osv_sanity/qemu.config.default.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"common": {
"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",
"boot_pattern": "*Kernel*on*an*x86_64*",
"guest_root_passwd": "123456",
"vm_type": "tdx",
"pmu": "off",
"cpus": "4",
Expand Down
4 changes: 2 additions & 2 deletions guest-test/osv_sanity/test_2.1.1.4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create TDX guest with default qemu config and check TSC value on guest
guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -x TD_TSC_DEFAULT -p off -j "osv_sanity/qemu.config.default.json"
guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -x TD_TSC_DEFAULT -p off -i "osv_sanity/common.json" -j "osv_sanity/qemu.config.default.json"
# Create TDX guest with tsc-freq specified qemu config and check TSC value on guest
guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -x TD_TSC_CONFIG -p off -j "osv_sanity/qemu.config.tsc.json"
guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -x TD_TSC_CONFIG -p off -i "osv_santiy/common.json" -j "osv_sanity/qemu.config.tsc.json"

0 comments on commit 1645086

Please sign in to comment.