Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abstract get_baremetal_dir and udpate cmpccxadd tests #395

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions BM/cmpccxadd/tests
Original file line number Diff line number Diff line change
@@ -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
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
27 changes: 27 additions & 0 deletions KVM/qemu/provider/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/python3

# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2024 Intel Corporation

# Author: Xudong Hao <[email protected]>
#
# 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
18 changes: 1 addition & 17 deletions KVM/qemu/tests/x86_cpuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,15 @@
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
sys.path.append(check_dir)
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.
Expand Down
Loading