Skip to content

Commit

Permalink
programs/kvm-unit-tests/run: abstract fixup_tests function
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Li <philip.li@intel.com>
  • Loading branch information
rli9 committed Jun 14, 2024
1 parent 02a4a6e commit 29ff63b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
13 changes: 13 additions & 0 deletions lib/tests/kvm-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ setup_test_environment()
return 0
}

fixup_tests()
{
# errata.txt and run_tests.sh are under same directory, using
# absolute path for errata.sh will increase the risk of missing
# file, here we directly use relative path.
sed -i 's/\(ERRATATXT=\).*/\1errata.txt/' config.mak

# Fix timeout issue in kvm-unit-tests-qemu
# 'FAIL vmx_pf_exception_test_reduced_maxphyaddr (timeout; duration=90s)'
# we should keep same setting for bare metal
sed -i '/\[vmx_pf_exception_test_reduced_maxphyaddr\]/a\timeout = 240' x86/unittests.cfg
}

run_tests()
{
log_cmd ./run_tests.sh
Expand Down
17 changes: 6 additions & 11 deletions programs/kvm-unit-tests/run
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@ fi

$QEMU --version

# errata.txt and run_tests.sh are under same directory, using
# absolute path for errata.sh will increase the risk of missing
# file, here we directly use relative path.
sed -i 's/\(ERRATATXT=\).*/\1errata.txt/' config.mak

# below fix timeout issue in kvm-unit-tests-qemu,
# 'FAIL vmx_pf_exception_test_reduced_maxphyaddr (timeout; duration=90s)'
# we should keep same setting for bare metal
sed -i '/\[vmx_pf_exception_test_reduced_maxphyaddr\]/a\timeout = 240' x86/unittests.cfg

fixup_tests
setup_test_environment || die "failed to setup test environment"

run_tests
[ $? -ne 0 ] && dump_qemu
exit_code=$?

upload_test_results

[ $exit_code -ne 0 ] && dump_qemu

exit $exit_code

0 comments on commit 29ff63b

Please sign in to comment.