From 54aa27205b24d16aa149c23de63a0c121c6ca33d Mon Sep 17 00:00:00 2001 From: DCyan_Elite Date: Thu, 21 Sep 2023 15:53:47 +0800 Subject: [PATCH] Add a shellscript to test all cases. Signed-off-by: DCyan_Elite --- tdx-compliance/testallcase.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tdx-compliance/testallcase.sh diff --git a/tdx-compliance/testallcase.sh b/tdx-compliance/testallcase.sh new file mode 100644 index 0000000..9522720 --- /dev/null +++ b/tdx-compliance/testallcase.sh @@ -0,0 +1,21 @@ +#!/bin/bash +case=("msr" "cr" "cpuid" "all") +ver=("1.0" "1.5" "") + +# store test results to a specified folder +script_dir=$(dirname "$0") +result_dir="$script_dir/result" + +if [ ! -d "$result_dir" ]; then + mkdir "$result_dir" +fi + +for c in "${case[@]}"; do + for v in "${ver[@]}"; do + echo $c $v > /sys/kernel/debug/tdx/tdx-tests + OUTPUT="${c}_${v}" + echo "CMD:${c} ${v}" + + cat "/sys/kernel/debug/tdx/tdx-tests" > "${result_dir}/$OUTPUT" + done +done