Skip to content
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
4 changes: 4 additions & 0 deletions BM/pmu/tests_3fix_counters
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file collects the CWF 3 new Fix counters test cases
pmu_tests.sh -t counting
pmu_tests.sh -t sampling
pmu_tests.sh -t counting_multi
8 changes: 8 additions & 0 deletions BM/pmu/tests_arch_pebs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file collects the ARCH PBES test cases
pmu_tests.sh -t arch_pebs_cpuid
pmu_tests.sh -t arch_pebs_gp_reg_group
pmu_tests.sh -t arch_pebs_xer_group
pmu_tests.sh -t arch_pebs_counter_group
pmu_tests.sh -t arch_pebs_counter_group_stress
pmu_tests.sh -t arch_pebs_gp_counter
pmu_tests.sh -t arch_pebs_basic_group
6 changes: 6 additions & 0 deletions BM/pmu/tests_arch_perfmon_v6
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file collects the ARCH PerfMon v6 test cases
pmu_tests.sh -t bitmap_6
pmu_tests.sh -t umask2_cpuid
pmu_tests.sh -t zbit_cpuid
pmu_tests.sh -t umask2
pmu_tests.sh -t zbit
21 changes: 21 additions & 0 deletions KVM/qemu/feature_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
auto_cpu_model = "no"
cpu_model = host
variants:
- arch_pebs:
no tdvm
feature_dir_names = "pmu"
disable_parallel_run = yes
pre_command = 'echo 0 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel enable_mediated_pmu=Y'
post_command = 'echo 1 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel'
test_scen = "tests_arch_pebs"
- arch_perfmon_v6:
no tdvm
feature_dir_names = "pmu"
disable_parallel_run = yes
pre_command = 'echo 0 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel enable_mediated_pmu=Y'
post_command = 'echo 1 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel'
test_scen = "tests_arch_perfmon_v6"
- 3_fix_counters:
no tdvm
feature_dir_names = "pmu"
disable_parallel_run = yes
pre_command = 'echo 0 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel enable_mediated_pmu=Y'
post_command = 'echo 1 > /proc/sys/kernel/nmi_watchdog && modprobe -r kvm_intel && modprobe kvm_intel'
test_scen = "tests_3fix_counters"
- cmpccxadd:
feature_dir_names = "cmpccxadd"
- lam:
Expand Down
36 changes: 35 additions & 1 deletion KVM/qemu/tests/feature_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def prepare_test_suite(test, vm_test_path, session):
:param vm_test_path: The absolute path of test suite in guest
:param session: Guest session
"""
if not os.path.exists(os.path.join(vm_test_path, 'Makefile')):
return

if not utils_package.package_install("gcc", session):
test.cancel("Failed to install package gcc.")

Expand Down Expand Up @@ -61,6 +64,29 @@ def avocado_install(test, params, guest_bm_path, vm, session):
raise exceptions.TestError("Dependence test tool compile failed.")


def disable_parallel_run(test, session):
"""
Disable parallel execution in guest.
:param test: QEMU test object
:param session: Guest session
"""
conf_file = "/etc/avocado/avocado.conf"
cmd = "ls %s" % conf_file
if session.cmd_status(cmd):
cmd = "mkdir -p /etc/avocado && touch %s" % conf_file
status, output = session.cmd_status_output(cmd)
if status:
test.error("Fail to create config file in guest: %s" % output)

cmd = "cat %s | grep max_parallel_tasks=1" % conf_file
if session.cmd_status(cmd):
conf_content = "[run]\\nmax_parallel_tasks=1"
cmd = "echo -e '%s' > %s" % (conf_content, conf_file)
status, output = session.cmd_status_output(cmd)
if status:
test.error("Fail to add configurations in guest file: %s" % output)


def get_test_results(test, output, vm, session):
"""
Install test framework avocado in guest.
Expand Down Expand Up @@ -104,6 +130,9 @@ def run(test, params, env):
vm.copy_files_to(bm_dir, test_dir)
guest_bm_path = os.path.join(test_dir, "BM")
avocado_install(test, params, guest_bm_path, vm, session)
vm_config = params.get_boolean("disable_parallel_run")
if vm_config:
disable_parallel_run(test, session)

try:
for feature_dir_name in feature_dir_names.split():
Expand All @@ -112,8 +141,11 @@ def run(test, params, env):
cmd_timeout = params.get_numeric("cmd_timeout", 240)
if params.get("cmd_timeout"):
cmd_timeout = params.get_numeric("cmd_timeout")
cases_file = params.get("test_scen")
if cases_file is None:
cases_file = "tests"
#run_cmd = "cd %s && ./runtests -f %s/tests" % (guest_bm_path, feature_dir_name)
run_cmd = "cd %s && ./runtests.py -f %s -t %s/tests" % (guest_bm_path, feature_dir_name, feature_dir_name)
run_cmd = "cd %s && ./runtests.py -f %s -t %s/%s " % (guest_bm_path, feature_dir_name, feature_dir_name, cases_file)
s, o = session.cmd_status_output(run_cmd, timeout=cmd_timeout)

get_test_results(test, o, vm, session)
Expand All @@ -129,4 +161,6 @@ def run(test, params, env):
test.log.info("Guest feature %s test pass." % feature_dir_name)
finally:
session.cmd("rm %s -rf" % guest_bm_path, ignore_all_errors=True)
if vm_config:
session.cmd("rm /etc/avocado -rf", ignore_all_errors=True)
session.close()
Loading