From d43de0d3c9a10116e7bb28afe2250c373dfa90a1 Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Fri, 2 Feb 2024 13:09:09 +0800 Subject: [PATCH 1/5] [guest-test] Test Enhance: add $FEATURE_PATH param to support wider VM feature test add $FEATURE_PATH parameter to support wider VM feature test, user can leverage guest-test framework as simple libarary to launch and run feature test in VM [Test Components] guest-test [Test Types] any [Supported Devices] all-generic Signed-off-by: Hongyu Ning --- guest-test/guest.test_executor.sh | 2 +- guest-test/guest.test_launcher.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/guest-test/guest.test_executor.sh b/guest-test/guest.test_executor.sh index 490e0eea..77118633 100755 --- a/guest-test/guest.test_executor.sh +++ b/guest-test/guest.test_executor.sh @@ -120,6 +120,6 @@ if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then cd "$SCRIPT_DIR" || die "fail to switch to $SCRIPT_DIR" # select specific "$FEATURE.test_executor.sh" by $FEATURE - "$FEATURE"/"$FEATURE".test_executor.sh || \ + ../"$FEATURE_PATH"/"$FEATURE".test_executor.sh || \ die "Failed on $TESTCASE of $FEATURE" fi diff --git a/guest-test/guest.test_launcher.sh b/guest-test/guest.test_launcher.sh index 60867e13..7c40e34b 100755 --- a/guest-test/guest.test_launcher.sh +++ b/guest-test/guest.test_launcher.sh @@ -59,7 +59,8 @@ NOTE!! args passed here will override params in json config file -m memory size in GB -d debug on/off (resive to true/false in new qemu) -t vm_type legacy/tdx/tdxio - -f feature (subfolder) to test + -e feature specific path to feature.test_executor.sh + -f feature to test -x testcase pass to test_executor -c guest kernel extra commandline -p guest pmu off/on @@ -112,7 +113,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:f:x:c:p:g:i:j:h arg; do +while getopts :v:s:m:d:t:e:f:x:c:p:g:i:j:h arg; do case $arg in v) VCPU=$OPTARG @@ -134,6 +135,10 @@ while getopts :v:s:m:d:t:f:x:c:p:g:i:j:h arg; do VM_TYPE=$OPTARG echo VM_TYPE="\"$VM_TYPE\"" >> "$SCRIPT_DIR"/test_params.py ;; + e) + FEATURE_PATH=$OPTARG + echo FEATURE_PATH="\"$FEATURE_PATH\"" >> "$SCRIPT_DIR"/test_params.py + ;; f) FEATURE=$OPTARG echo FEATURE="\"$FEATURE\"" >> "$SCRIPT_DIR"/test_params.py From 3b6cf53c0dbb6c1d30422aeb37a42709aab93359 Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Fri, 2 Feb 2024 13:11:36 +0800 Subject: [PATCH 2/5] [guest-test][amx] Test Enhance: revise amx test to support $FEATURE_PATH framework change revise amx test under lkvs to support $FEATURE_PATH framework change [Test Components] amx [Test Types] any [Supported Devices] all-generic Signed-off-by: Hongyu Ning --- {guest-test/amx => amx}/amx.test_executor.sh | 4 ++-- {guest-test/amx => amx}/tests | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename {guest-test/amx => amx}/amx.test_executor.sh (97%) rename {guest-test/amx => amx}/tests (57%) diff --git a/guest-test/amx/amx.test_executor.sh b/amx/amx.test_executor.sh similarity index 97% rename from guest-test/amx/amx.test_executor.sh rename to amx/amx.test_executor.sh index 60a1e754..14487b51 100644 --- a/guest-test/amx/amx.test_executor.sh +++ b/amx/amx.test_executor.sh @@ -16,7 +16,7 @@ SCRIPT_DIR_LOCAL="$( cd "$( dirname "$0" )" && pwd )" echo "$SCRIPT_DIR_LOCAL" # get test scenario config for $FEATURE tdx test_executor -source "$SCRIPT_DIR_LOCAL"/../test_params.py +source "$SCRIPT_DIR_LOCAL"/../guest-test/test_params.py ## end of common variables example ## ###################### Functions ###################### @@ -25,7 +25,7 @@ source "$SCRIPT_DIR_LOCAL"/../test_params.py ###################### Do Works ###################### ## common works example ## cd "$(dirname "$0")" 2>/dev/null || exit 1 -source ../../.env +source ../.env # get test_executor common functions: # function based on sshpass to scp common.sh and optional $1 test_script.sh to Guest VM diff --git a/guest-test/amx/tests b/amx/tests similarity index 57% rename from guest-test/amx/tests rename to amx/tests index 56e5d49e..ce87a65c 100644 --- a/guest-test/amx/tests +++ b/amx/tests @@ -1,2 +1,2 @@ -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t legacy -f amx -x TMUL_1 -c " " -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f amx -x TMUL_1 -c "accept_memory=lazy" -p off \ No newline at end of file +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t legacy -e amx -f amx -x TMUL_1 -c " " -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e amx -f amx -x TMUL_1 -c "accept_memory=lazy" -p off \ No newline at end of file From 62d8e2bf31cd22902ba8af1d537a74a657c69ae9 Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Fri, 2 Feb 2024 13:14:44 +0800 Subject: [PATCH 3/5] [guest-test][tdx_guest] Test Enhance: revise tdx_guest test to support $FEATURE_PATH framework change revise tdx_guest test under lkvs to support $FEATURE_PATH framework change [Test Components] tdx_guest [Test Types] any [Supported Devices] spr,emr,gnr,srf Signed-off-by: Hongyu Ning --- guest-test/tdx/tests | 51 ------------------- {guest-test/tdx => tdx_guest}/README.md | 0 .../tdx => tdx_guest}/tdx.test_executor.sh | 4 +- .../tdx => tdx_guest}/tdx_attest_check.sh | 0 .../tdx_attest_test_suite/.gitignore | 0 .../tdx_attest_test_suite/Makefile | 0 .../include/linux/kselftest.h | 0 .../include/linux/kselftest_harness.h | 0 .../include/linux/types.h | 0 .../tdx_attest_test_suite/tdx-attest-test.c | 0 .../tdx_device_filter_test.sh | 0 .../tdx_ebizzy_test_suite/.gitignore | 0 .../tdx_ebizzy_test_suite/Makefile | 0 .../tdx_ebizzy_test_suite/ebizzy.c | 0 .../tdx_ebizzy_test_suite/ebizzy.h | 0 .../tdx => tdx_guest}/tdx_guest_bat_test.sh | 0 .../tdx => tdx_guest}/tdx_guest_boot_check.sh | 0 .../tdx_halt_test_module/.gitignore | 0 .../tdx_halt_test_module/Makefile | 0 .../tdx_halt_test_module/halt_test.c | 0 {guest-test/tdx => tdx_guest}/tdx_mem_test.sh | 0 .../tdx => tdx_guest}/tdx_speed_test.sh | 0 .../tdx => tdx_guest}/tdx_test_module.sh | 0 tdx_guest/tests | 51 +++++++++++++++++++ 24 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 guest-test/tdx/tests rename {guest-test/tdx => tdx_guest}/README.md (100%) rename {guest-test/tdx => tdx_guest}/tdx.test_executor.sh (99%) rename {guest-test/tdx => tdx_guest}/tdx_attest_check.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/.gitignore (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/Makefile (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/include/linux/kselftest.h (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/include/linux/kselftest_harness.h (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/include/linux/types.h (100%) rename {guest-test/tdx => tdx_guest}/tdx_attest_test_suite/tdx-attest-test.c (100%) rename {guest-test/tdx => tdx_guest}/tdx_device_filter_test.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_ebizzy_test_suite/.gitignore (100%) rename {guest-test/tdx => tdx_guest}/tdx_ebizzy_test_suite/Makefile (100%) rename {guest-test/tdx => tdx_guest}/tdx_ebizzy_test_suite/ebizzy.c (100%) rename {guest-test/tdx => tdx_guest}/tdx_ebizzy_test_suite/ebizzy.h (100%) rename {guest-test/tdx => tdx_guest}/tdx_guest_bat_test.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_guest_boot_check.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_halt_test_module/.gitignore (100%) rename {guest-test/tdx => tdx_guest}/tdx_halt_test_module/Makefile (100%) rename {guest-test/tdx => tdx_guest}/tdx_halt_test_module/halt_test.c (100%) rename {guest-test/tdx => tdx_guest}/tdx_mem_test.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_speed_test.sh (100%) rename {guest-test/tdx => tdx_guest}/tdx_test_module.sh (100%) create mode 100644 tdx_guest/tests diff --git a/guest-test/tdx/tests b/guest-test/tdx/tests deleted file mode 100644 index c0df24c6..00000000 --- a/guest-test/tdx/tests +++ /dev/null @@ -1,51 +0,0 @@ -# case implemented by tdx_guest_boot_check.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 4 -s 1 -m 4 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 4 -s 2 -m 4 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 4 -s 2 -m 96 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 64 -s 8 -m 96 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 288 -s 1 -m 1 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 288 -s 8 -m 96 -d on -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d off -t tdx -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t legacy -f tdx -x TD_BOOT -c " " -p off -# case implemented by tdx_attest_check.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_ATTEST_VERIFY_REPORT -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_ATTEST_VERITY_REPORTMAC -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_ATTEST_VERIFY_RTMR_EXTEND -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_ATTEST_VERIFY_QUOTE -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_TSM_ATTEST_QUOTE_PRECHECK -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_TSM_ATTEST_QUOTE -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_TSM_ATTEST_QUOTE_NEG -c "accept_memory=lazy" -p off -# case implemented by tdx_speed_test.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_NET_SPEED -c "accept_memory=lazy" -p off -# case implemented by tdx_mem_test.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -f tdx -x TD_MEM_EBIZZY_FUNC -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 8 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_8G_1W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 8 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_8G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 32 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_32G_1W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 32 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_32G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 96 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_96G_1W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 96 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_1C_96G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 8 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_8G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 8 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_8G_256W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 32 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_32G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 32 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_32G_256W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 96 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_96G_32W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 96 -d on -t tdx -f tdx -x TD_MEM_ACPT_T_32C_96G_256W -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -f tdx -x TD_MEM_ACPT_FUNC -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -f tdx -x TD_MEM_ACPT_CAL -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -f tdx -x TD_MEM_ACPT_NEG -c "accept_memory=eager" -p off -# case implemented by tdx_test_module.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_VE_HALT -c "accept_memory=lazy" -p off -# case implemented by tdx_guest_bat_test.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_CPUINFO -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_KCONFIG -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_DRIVER_KCONFIG -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_LAZY_ACCEPT_KCONFIG -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_TSM_REPORTS_KCONFIG -c "accept_memory=lazy" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_GUEST_ATTEST_DEV -c "accept_memory=lazy" -p off -# case implemented by tdx_device_filter_test.sh -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_ALLOW_ACPI -c "tdx_allow_acpi=WAET" -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_BLOCK_ACPI -c " " -p off -./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -f tdx -x TD_NO_CCFILTER -c "noccfilter" -p off \ No newline at end of file diff --git a/guest-test/tdx/README.md b/tdx_guest/README.md similarity index 100% rename from guest-test/tdx/README.md rename to tdx_guest/README.md diff --git a/guest-test/tdx/tdx.test_executor.sh b/tdx_guest/tdx.test_executor.sh similarity index 99% rename from guest-test/tdx/tdx.test_executor.sh rename to tdx_guest/tdx.test_executor.sh index e78f5adb..e11070d7 100755 --- a/guest-test/tdx/tdx.test_executor.sh +++ b/tdx_guest/tdx.test_executor.sh @@ -16,7 +16,7 @@ SCRIPT_DIR_LOCAL="$( cd "$( dirname "$0" )" && pwd )" echo "$SCRIPT_DIR_LOCAL" # get test scenario config for $FEATURE tdx test_executor -source "$SCRIPT_DIR_LOCAL"/../test_params.py +source "$SCRIPT_DIR_LOCAL"/../guest-test/test_params.py ## end of common variables example ## ###################### Functions ###################### @@ -46,7 +46,7 @@ guest_tsm_attest() { ###################### Do Works ###################### ## common works example ## cd "$(dirname "$0")" 2>/dev/null || exit 1 -source ../../.env +source ../.env # get test_executor common functions: # function based on sshpass to scp common.sh and $1 test_script.sh to Guest VM diff --git a/guest-test/tdx/tdx_attest_check.sh b/tdx_guest/tdx_attest_check.sh similarity index 100% rename from guest-test/tdx/tdx_attest_check.sh rename to tdx_guest/tdx_attest_check.sh diff --git a/guest-test/tdx/tdx_attest_test_suite/.gitignore b/tdx_guest/tdx_attest_test_suite/.gitignore similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/.gitignore rename to tdx_guest/tdx_attest_test_suite/.gitignore diff --git a/guest-test/tdx/tdx_attest_test_suite/Makefile b/tdx_guest/tdx_attest_test_suite/Makefile similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/Makefile rename to tdx_guest/tdx_attest_test_suite/Makefile diff --git a/guest-test/tdx/tdx_attest_test_suite/include/linux/kselftest.h b/tdx_guest/tdx_attest_test_suite/include/linux/kselftest.h similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/include/linux/kselftest.h rename to tdx_guest/tdx_attest_test_suite/include/linux/kselftest.h diff --git a/guest-test/tdx/tdx_attest_test_suite/include/linux/kselftest_harness.h b/tdx_guest/tdx_attest_test_suite/include/linux/kselftest_harness.h similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/include/linux/kselftest_harness.h rename to tdx_guest/tdx_attest_test_suite/include/linux/kselftest_harness.h diff --git a/guest-test/tdx/tdx_attest_test_suite/include/linux/types.h b/tdx_guest/tdx_attest_test_suite/include/linux/types.h similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/include/linux/types.h rename to tdx_guest/tdx_attest_test_suite/include/linux/types.h diff --git a/guest-test/tdx/tdx_attest_test_suite/tdx-attest-test.c b/tdx_guest/tdx_attest_test_suite/tdx-attest-test.c similarity index 100% rename from guest-test/tdx/tdx_attest_test_suite/tdx-attest-test.c rename to tdx_guest/tdx_attest_test_suite/tdx-attest-test.c diff --git a/guest-test/tdx/tdx_device_filter_test.sh b/tdx_guest/tdx_device_filter_test.sh similarity index 100% rename from guest-test/tdx/tdx_device_filter_test.sh rename to tdx_guest/tdx_device_filter_test.sh diff --git a/guest-test/tdx/tdx_ebizzy_test_suite/.gitignore b/tdx_guest/tdx_ebizzy_test_suite/.gitignore similarity index 100% rename from guest-test/tdx/tdx_ebizzy_test_suite/.gitignore rename to tdx_guest/tdx_ebizzy_test_suite/.gitignore diff --git a/guest-test/tdx/tdx_ebizzy_test_suite/Makefile b/tdx_guest/tdx_ebizzy_test_suite/Makefile similarity index 100% rename from guest-test/tdx/tdx_ebizzy_test_suite/Makefile rename to tdx_guest/tdx_ebizzy_test_suite/Makefile diff --git a/guest-test/tdx/tdx_ebizzy_test_suite/ebizzy.c b/tdx_guest/tdx_ebizzy_test_suite/ebizzy.c similarity index 100% rename from guest-test/tdx/tdx_ebizzy_test_suite/ebizzy.c rename to tdx_guest/tdx_ebizzy_test_suite/ebizzy.c diff --git a/guest-test/tdx/tdx_ebizzy_test_suite/ebizzy.h b/tdx_guest/tdx_ebizzy_test_suite/ebizzy.h similarity index 100% rename from guest-test/tdx/tdx_ebizzy_test_suite/ebizzy.h rename to tdx_guest/tdx_ebizzy_test_suite/ebizzy.h diff --git a/guest-test/tdx/tdx_guest_bat_test.sh b/tdx_guest/tdx_guest_bat_test.sh similarity index 100% rename from guest-test/tdx/tdx_guest_bat_test.sh rename to tdx_guest/tdx_guest_bat_test.sh diff --git a/guest-test/tdx/tdx_guest_boot_check.sh b/tdx_guest/tdx_guest_boot_check.sh similarity index 100% rename from guest-test/tdx/tdx_guest_boot_check.sh rename to tdx_guest/tdx_guest_boot_check.sh diff --git a/guest-test/tdx/tdx_halt_test_module/.gitignore b/tdx_guest/tdx_halt_test_module/.gitignore similarity index 100% rename from guest-test/tdx/tdx_halt_test_module/.gitignore rename to tdx_guest/tdx_halt_test_module/.gitignore diff --git a/guest-test/tdx/tdx_halt_test_module/Makefile b/tdx_guest/tdx_halt_test_module/Makefile similarity index 100% rename from guest-test/tdx/tdx_halt_test_module/Makefile rename to tdx_guest/tdx_halt_test_module/Makefile diff --git a/guest-test/tdx/tdx_halt_test_module/halt_test.c b/tdx_guest/tdx_halt_test_module/halt_test.c similarity index 100% rename from guest-test/tdx/tdx_halt_test_module/halt_test.c rename to tdx_guest/tdx_halt_test_module/halt_test.c diff --git a/guest-test/tdx/tdx_mem_test.sh b/tdx_guest/tdx_mem_test.sh similarity index 100% rename from guest-test/tdx/tdx_mem_test.sh rename to tdx_guest/tdx_mem_test.sh diff --git a/guest-test/tdx/tdx_speed_test.sh b/tdx_guest/tdx_speed_test.sh similarity index 100% rename from guest-test/tdx/tdx_speed_test.sh rename to tdx_guest/tdx_speed_test.sh diff --git a/guest-test/tdx/tdx_test_module.sh b/tdx_guest/tdx_test_module.sh similarity index 100% rename from guest-test/tdx/tdx_test_module.sh rename to tdx_guest/tdx_test_module.sh diff --git a/tdx_guest/tests b/tdx_guest/tests new file mode 100644 index 00000000..9cc13cc8 --- /dev/null +++ b/tdx_guest/tests @@ -0,0 +1,51 @@ +# case implemented by tdx_guest_boot_check.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 4 -s 1 -m 4 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 4 -s 2 -m 4 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 4 -s 2 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 64 -s 8 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 288 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 288 -s 8 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d off -t tdx -e tdx_guest -f tdx -x TD_BOOT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t legacy -e tdx_guest -f tdx -x TD_BOOT -c " " -p off +# case implemented by tdx_attest_check.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_ATTEST_VERIFY_REPORT -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_ATTEST_VERITY_REPORTMAC -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_ATTEST_VERIFY_RTMR_EXTEND -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_ATTEST_VERIFY_QUOTE -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_TSM_ATTEST_QUOTE_PRECHECK -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_TSM_ATTEST_QUOTE -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_TSM_ATTEST_QUOTE_NEG -c "accept_memory=lazy" -p off +# case implemented by tdx_speed_test.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_NET_SPEED -c "accept_memory=lazy" -p off +# case implemented by tdx_mem_test.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_EBIZZY_FUNC -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 8 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_8G_1W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 8 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_8G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 32 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_32G_1W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 32 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_32G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_96G_1W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_1C_96G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 8 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_8G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 8 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_8G_256W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 32 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_32G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 32 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_32G_256W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_96G_32W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 32 -s 1 -m 96 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_T_32C_96G_256W -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_FUNC -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_CAL -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 16 -d on -t tdx -e tdx_guest -f tdx -x TD_MEM_ACPT_NEG -c "accept_memory=eager" -p off +# case implemented by tdx_test_module.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_VE_HALT -c "accept_memory=lazy" -p off +# case implemented by tdx_guest_bat_test.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_CPUINFO -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_KCONFIG -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_DRIVER_KCONFIG -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_LAZY_ACCEPT_KCONFIG -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_TSM_REPORTS_KCONFIG -c "accept_memory=lazy" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_GUEST_ATTEST_DEV -c "accept_memory=lazy" -p off +# case implemented by tdx_device_filter_test.sh +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_ALLOW_ACPI -c "tdx_allow_acpi=WAET" -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_BLOCK_ACPI -c " " -p off +./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e tdx_guest -f tdx -x TD_NO_CCFILTER -c "noccfilter" -p off \ No newline at end of file From a2248f7f23131efffd360c1092431f553e90d3db Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Fri, 2 Feb 2024 13:16:33 +0800 Subject: [PATCH 4/5] [guest-test][tdx_osv_sanity] Test Enhance: revise tdx_osv_sanity test to support $FEATURE_PATH framework change revise tdx_osv_sanity test under lkvs to support $FEATURE_PATH framework change [Test Components] tdx_osv_sanity [Test Types] any [Supported Devices] spr,emr,gnr,srf Signed-off-by: Hongyu Ning --- guest-test/tdx_osv_sanity/test_2.1.1.4 | 4 ---- {guest-test/tdx_osv_sanity => tdx_osv_sanity}/common.json | 0 .../qemu.config.default.json | 0 .../tdx_osv_sanity => tdx_osv_sanity}/qemu.config.tsc.json | 0 .../tdx_osv_sanity => tdx_osv_sanity}/tdx_guest_tsc_check.sh | 0 .../tdx_osv_sanity => tdx_osv_sanity}/tdx_host_tsc_check.sh | 0 .../tdx_osv_sanity.test_executor.sh | 4 ++-- tdx_osv_sanity/test_2.1.1.4 | 4 ++++ 8 files changed, 6 insertions(+), 6 deletions(-) delete mode 100755 guest-test/tdx_osv_sanity/test_2.1.1.4 rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/common.json (100%) rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/qemu.config.default.json (100%) rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/qemu.config.tsc.json (100%) rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/tdx_guest_tsc_check.sh (100%) rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/tdx_host_tsc_check.sh (100%) rename {guest-test/tdx_osv_sanity => tdx_osv_sanity}/tdx_osv_sanity.test_executor.sh (97%) create mode 100755 tdx_osv_sanity/test_2.1.1.4 diff --git a/guest-test/tdx_osv_sanity/test_2.1.1.4 b/guest-test/tdx_osv_sanity/test_2.1.1.4 deleted file mode 100755 index d7342d49..00000000 --- a/guest-test/tdx_osv_sanity/test_2.1.1.4 +++ /dev/null @@ -1,4 +0,0 @@ -# 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 -f tdx_osv_sanity -x TD_TSC_DEFAULT -p off -i "tdx_osv_sanity/common.json" -j "tdx_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 -f tdx_osv_sanity -x TD_TSC_CONFIG -p off -i "tdx_osv_sanity/common.json" -j "tdx_osv_sanity/qemu.config.tsc.json" \ No newline at end of file diff --git a/guest-test/tdx_osv_sanity/common.json b/tdx_osv_sanity/common.json similarity index 100% rename from guest-test/tdx_osv_sanity/common.json rename to tdx_osv_sanity/common.json diff --git a/guest-test/tdx_osv_sanity/qemu.config.default.json b/tdx_osv_sanity/qemu.config.default.json similarity index 100% rename from guest-test/tdx_osv_sanity/qemu.config.default.json rename to tdx_osv_sanity/qemu.config.default.json diff --git a/guest-test/tdx_osv_sanity/qemu.config.tsc.json b/tdx_osv_sanity/qemu.config.tsc.json similarity index 100% rename from guest-test/tdx_osv_sanity/qemu.config.tsc.json rename to tdx_osv_sanity/qemu.config.tsc.json diff --git a/guest-test/tdx_osv_sanity/tdx_guest_tsc_check.sh b/tdx_osv_sanity/tdx_guest_tsc_check.sh similarity index 100% rename from guest-test/tdx_osv_sanity/tdx_guest_tsc_check.sh rename to tdx_osv_sanity/tdx_guest_tsc_check.sh diff --git a/guest-test/tdx_osv_sanity/tdx_host_tsc_check.sh b/tdx_osv_sanity/tdx_host_tsc_check.sh similarity index 100% rename from guest-test/tdx_osv_sanity/tdx_host_tsc_check.sh rename to tdx_osv_sanity/tdx_host_tsc_check.sh diff --git a/guest-test/tdx_osv_sanity/tdx_osv_sanity.test_executor.sh b/tdx_osv_sanity/tdx_osv_sanity.test_executor.sh similarity index 97% rename from guest-test/tdx_osv_sanity/tdx_osv_sanity.test_executor.sh rename to tdx_osv_sanity/tdx_osv_sanity.test_executor.sh index 19f08a31..32d0d36f 100755 --- a/guest-test/tdx_osv_sanity/tdx_osv_sanity.test_executor.sh +++ b/tdx_osv_sanity/tdx_osv_sanity.test_executor.sh @@ -16,7 +16,7 @@ SCRIPT_DIR_LOCAL="$( cd "$( dirname "$0" )" && pwd )" echo "$SCRIPT_DIR_LOCAL" # get test scenario config for $FEATURE tdx test_executor -source "$SCRIPT_DIR_LOCAL"/../test_params.py +source "$SCRIPT_DIR_LOCAL"/../guest-test/test_params.py ## end of common variables example ## ###################### Functions ###################### @@ -25,7 +25,7 @@ source "$SCRIPT_DIR_LOCAL"/../test_params.py ###################### Do Works ###################### ## common works example ## cd "$(dirname "$0")" 2>/dev/null || exit 1 -source ../../.env +source ../.env # get test_executor common functions: # function based on sshpass to scp common.sh and $1 test_script.sh to Guest VM diff --git a/tdx_osv_sanity/test_2.1.1.4 b/tdx_osv_sanity/test_2.1.1.4 new file mode 100755 index 00000000..bfa7ddf4 --- /dev/null +++ b/tdx_osv_sanity/test_2.1.1.4 @@ -0,0 +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 -e tdx_osv_sanity -f tdx_osv_sanity -x TD_TSC_DEFAULT -p off -i "../tdx_osv_sanity/common.json" -j "../tdx_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 -e tdx_osv_sanity -f tdx_osv_sanity -x TD_TSC_CONFIG -p off -i "../tdx_osv_sanity/common.json" -j "../tdx_osv_sanity/qemu.config.tsc.json" \ No newline at end of file From 4a83e6ea62b566d85b16107731f30bd80f7fb249 Mon Sep 17 00:00:00 2001 From: Hongyu Ning Date: Fri, 2 Feb 2024 13:17:55 +0800 Subject: [PATCH 5/5] [guest-test] Doc: update guest-test README based on new framework change update guest-test README to include $FEATURE_PATH framework change info [Test Components] guest-test [Test Types] any [Supported Devices] all-generic Signed-off-by: Hongyu Ning --- guest-test/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guest-test/README.md b/guest-test/README.md index 0b5d5ef8..bddd694a 100644 --- a/guest-test/README.md +++ b/guest-test/README.md @@ -67,7 +67,8 @@ main test entrance, with following key args can be passed to override the values - `-m` $MEM memory size in GB - `-d` $DEBUG debug on/off - `-t` $VM_TYPE vm_type legacy/tdx/tdxio - - `-f` $FEATURE feature sub-folder for new feature vm test extension + - `-e` $FEATURE_PATH feature specific subfolder to address feature tests source BOMs to use in VM + - `-f` $FEATURE feature or sub-feature name to address feature specific $FEATURE.test_executor.sh - `-x` $TESTCASE testcase pass to test_executor - `-c` $CMDLINE guest kernel extra commandline - `-p` $PMU guest pmu off/on @@ -123,8 +124,8 @@ guest VM test execution basic framework implemented in guerst.test_executor.sh, - guest_test_close, function based on sshpass to close VM ## How to add new feature test -as described above, if simply add new TCs to run based on current common.json and qemu.config.json format, just need to implement it in $FEATURE.test_executor.sh under guest-test/$FEATURE subfolder, -please leverage reference code "common variables example" and "common works example" in tdx/tdx.test_executor.sh, further implement "$FEATURE specific Functions" and "$FEATURE specific code path", +as described above, if simply add new TCs to run based on current common.json and qemu.config.json format, just need to implement it in $FEATURE.test_executor.sh under lkvs/$FEATURE subfolder, +please leverage reference code "common variables example" and "common works example" in lkvs/tdx_guest/tdx.test_executor.sh, further implement "$FEATURE specific Functions" and "$FEATURE specific code path", common functions of guest.test_executor.sh should be good enough to prepare/run/close new $FEATURE specific tests implemented in $FEATURE.test_executor.sh; it's allowed to customize and pass $FEATURE standalone common.json and qemu.config.json, please refer to ### common.json and qemu.config.json description and ### guest.test_launcher description for quick rule reference