From 515aea6ccbe5f6de7f2934cbc1fa1916f5448c99 Mon Sep 17 00:00:00 2001 From: Xudong Hao Date: Fri, 27 Feb 2026 10:42:07 +0800 Subject: [PATCH] KVM: improve feature_test case in abnormal condition Guest running feature test may result with terminate for some reason, for example: guest doesn't support feature cpuid while KVM doesn't support. With above case, the test case should be "FAIL" result but not script "ERROR", fix it to avoid result confusion. Signed-off-by: Xudong Hao --- KVM/qemu/tests/feature_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KVM/qemu/tests/feature_test.py b/KVM/qemu/tests/feature_test.py index be16589..8158a9a 100644 --- a/KVM/qemu/tests/feature_test.py +++ b/KVM/qemu/tests/feature_test.py @@ -90,12 +90,17 @@ def disable_parallel_run(test, session): def get_test_results(test, output, vm, session): """ - Install test framework avocado in guest. + Copy guest avocado run result to host. :param test: QEMU test object :param output: The output in guest test :param vm: The vm object :param session: Guest session """ + # BM test may be terminated with some reasons, then no valid result. + test_terminate = "Terminate the test" + if test_terminate in output: + test.fail("Guest %s " % output) + remove_str = "job.log" guest_log = re.sub(remove_str, "", re.search(r'.*JOB LOG\s*:\s(.*)', output).group(1)) # Delete the symbolic link to avoid remote copy failure