Skip to content

Commit

Permalink
Add a shellscript to test all cases.
Browse files Browse the repository at this point in the history
Signed-off-by: DCyan_Elite <[email protected]>
  • Loading branch information
CrescentLove committed Sep 22, 2023
1 parent 6dc239b commit 3dd13c6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tdx-compliance/testallcase.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3dd13c6

Please sign in to comment.