Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guest test enhance 0201 #177

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 ######################
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions guest-test/amx/tests → amx/tests
Original file line number Diff line number Diff line change
@@ -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
./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
7 changes: 4 additions & 3 deletions guest-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion guest-test/guest.test_executor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions guest-test/guest.test_launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
51 changes: 0 additions & 51 deletions guest-test/tdx/tests

This file was deleted.

4 changes: 0 additions & 4 deletions guest-test/tdx_osv_sanity/test_2.1.1.4

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ######################
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions tdx_guest/tests
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ######################
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tdx_osv_sanity/test_2.1.1.4
Original file line number Diff line number Diff line change
@@ -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"
Loading