From 92e062733cf9ab840555400d99a5e094a8fe64c6 Mon Sep 17 00:00:00 2001 From: Xudong Hao Date: Wed, 4 Sep 2024 16:21:30 +0800 Subject: [PATCH 1/2] cmpccxadd: correct the content in tests file Signed-off-by: Xudong Hao --- BM/cmpccxadd/tests | 80 +++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/BM/cmpccxadd/tests b/BM/cmpccxadd/tests index fd914e90..ba5e35ca 100644 --- a/BM/cmpccxadd/tests +++ b/BM/cmpccxadd/tests @@ -1,41 +1,41 @@ # This file collects the CMPccXADD cases -./cmpccxadd -t 1 # cmpbexadd_above -./cmpccxadd -t 2 # cmpbexadd_below -./cmpccxadd -t 3 # cmpbexadd_equal -./cmpccxadd -t 4 # cmpbxadd_above -./cmpccxadd -t 5 # cmpbxadd_below -./cmpccxadd -t 6 # cmpbxadd_equal -./cmpccxadd -t 7 # cmplexadd_equal -./cmpccxadd -t 8 # cmplexadd_less -./cmpccxadd -t 9 # cmplexadd_more -./cmpccxadd -t 10 # cmplxadd_equal -./cmpccxadd -t 11 # cmplxadd_less -./cmpccxadd -t 12 # cmplxadd_more -./cmpccxadd -t 13 # cmpnbexadd_above -./cmpccxadd -t 14 # cmpnbexadd_below -./cmpccxadd -t 15 # cmpnbexadd_equal -./cmpccxadd -t 16 # cmpnbxadd_above -./cmpccxadd -t 17 # cmpnbxadd_below -./cmpccxadd -t 18 # cmpnbxadd_equal -./cmpccxadd -t 19 # cmpnlexadd_equal -./cmpccxadd -t 20 # cmpnlexadd_less -./cmpccxadd -t 21 # cmpnlexadd_more -./cmpccxadd -t 22 # cmpnlxadd_equal -./cmpccxadd -t 23 # cmpnlxadd_less -./cmpccxadd -t 24 # cmpnlxadd_more -./cmpccxadd -t 25 # cmpnoxadd_not_overflow -./cmpccxadd -t 26 # cmpnoxadd_overflow -./cmpccxadd -t 27 # cmpnpxadd_even -./cmpccxadd -t 28 # cmpnpxadd_odd -./cmpccxadd -t 29 # cmpnsxadd_negative -./cmpccxadd -t 30 # cmpnsxadd_positive -./cmpccxadd -t 31 # cmpnzxadd_not_zero -./cmpccxadd -t 32 # cmpnzxadd_zero -./cmpccxadd -t 33 # cmpoxadd_not_overflow -./cmpccxadd -t 34 # cmpoxadd_overflow -./cmpccxadd -t 35 # cmppxadd_even -./cmpccxadd -t 36 # cmppxadd_odd -./cmpccxadd -t 37 # cmpsxadd_negative -./cmpccxadd -t 38 # cmpsxadd_positive -./cmpccxadd -t 39 # cmpzxadd_not_zero -./cmpccxadd -t 40 # cmpzxadd_zero \ No newline at end of file +cmpccxadd -t 1 # cmpbexadd_above +cmpccxadd -t 2 # cmpbexadd_below +cmpccxadd -t 3 # cmpbexadd_equal +cmpccxadd -t 4 # cmpbxadd_above +cmpccxadd -t 5 # cmpbxadd_below +cmpccxadd -t 6 # cmpbxadd_equal +cmpccxadd -t 7 # cmplexadd_equal +cmpccxadd -t 8 # cmplexadd_less +cmpccxadd -t 9 # cmplexadd_more +cmpccxadd -t 10 # cmplxadd_equal +cmpccxadd -t 11 # cmplxadd_less +cmpccxadd -t 12 # cmplxadd_more +cmpccxadd -t 13 # cmpnbexadd_above +cmpccxadd -t 14 # cmpnbexadd_below +cmpccxadd -t 15 # cmpnbexadd_equal +cmpccxadd -t 16 # cmpnbxadd_above +cmpccxadd -t 17 # cmpnbxadd_below +cmpccxadd -t 18 # cmpnbxadd_equal +cmpccxadd -t 19 # cmpnlexadd_equal +cmpccxadd -t 20 # cmpnlexadd_less +cmpccxadd -t 21 # cmpnlexadd_more +cmpccxadd -t 22 # cmpnlxadd_equal +cmpccxadd -t 23 # cmpnlxadd_less +cmpccxadd -t 24 # cmpnlxadd_more +cmpccxadd -t 25 # cmpnoxadd_not_overflow +cmpccxadd -t 26 # cmpnoxadd_overflow +cmpccxadd -t 27 # cmpnpxadd_even +cmpccxadd -t 28 # cmpnpxadd_odd +cmpccxadd -t 29 # cmpnsxadd_negative +cmpccxadd -t 30 # cmpnsxadd_positive +cmpccxadd -t 31 # cmpnzxadd_not_zero +cmpccxadd -t 32 # cmpnzxadd_zero +cmpccxadd -t 33 # cmpoxadd_not_overflow +cmpccxadd -t 34 # cmpoxadd_overflow +cmpccxadd -t 35 # cmppxadd_even +cmpccxadd -t 36 # cmppxadd_odd +cmpccxadd -t 37 # cmpsxadd_negative +cmpccxadd -t 38 # cmpsxadd_positive +cmpccxadd -t 39 # cmpzxadd_not_zero +cmpccxadd -t 40 # cmpzxadd_zero From 43c8593267ed4b72806b94f1bcd2e30aca1ac094 Mon Sep 17 00:00:00 2001 From: Xudong Hao Date: Thu, 5 Sep 2024 13:14:19 +0800 Subject: [PATCH 2/2] KVM: move get_baremetal_dir in common library Signed-off-by: Xudong Hao --- KVM/qemu/provider/test_utils.py | 27 +++++++++++++++++++++++++++ KVM/qemu/tests/x86_cpuid.py | 18 +----------------- 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 KVM/qemu/provider/test_utils.py diff --git a/KVM/qemu/provider/test_utils.py b/KVM/qemu/provider/test_utils.py new file mode 100644 index 00000000..24dbf310 --- /dev/null +++ b/KVM/qemu/provider/test_utils.py @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (c) 2024 Intel Corporation + +# Author: Xudong Hao +# +# History: Sept. 2024 - Xudong Hao - creation + +import os +from virttest import data_dir, asset + + +def get_baremetal_dir(params): + """ + Get the test provider's BM absolute path. + :param params: Dictionary with the test parameters + """ + provider = params["provider"] + provider_info = asset.get_test_provider_info(provider) + if provider_info["uri"].startswith("file://"): + provider_dir = provider_info["uri"][7:] + else: + provider_dir = data_dir.get_test_provider_dir(provider) + baremetal_dir = os.path.join(provider_dir, "BM") + + return baremetal_dir diff --git a/KVM/qemu/tests/x86_cpuid.py b/KVM/qemu/tests/x86_cpuid.py index 315d29ee..4364c00c 100644 --- a/KVM/qemu/tests/x86_cpuid.py +++ b/KVM/qemu/tests/x86_cpuid.py @@ -12,8 +12,8 @@ from avocado.utils import process from avocado.core import exceptions from virttest import error_context, env_process -from virttest import data_dir, asset from virttest import utils_package +from provider.test_utils import get_baremetal_dir curr_dir = os.path.dirname(os.path.abspath(__file__)) check_dir = "%s/../../../BM/instruction-check" % curr_dir @@ -21,22 +21,6 @@ from feature_list import cpuid_info -def get_baremetal_dir(params): - """ - Get the test provider's BM absolute path. - :param params: Dictionary with the test parameters - """ - provider = params["provider"] - provider_info = asset.get_test_provider_info(provider) - if provider_info["uri"].startswith("file://"): - provider_dir = provider_info["uri"][7:] - else: - provider_dir = data_dir.get_test_provider_dir(provider) - baremetal_dir = os.path.join(provider_dir, "BM") - - return baremetal_dir - - def prepare_cpuid(test, params, src_dir, vm=None, session=None): """ Compile cpuid test tool in host or guest.