1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
commit a1aa54ba8adbf2e12043b7d91161ee6302e7584c
Author: Jonas Eriksson <jonas.eriksson@enea.com>
Date: Wed Mar 26 14:08:54 2014 +0100
cpuflags: Migrate cpuflags test case to provider
The provider module has a install_cpuflags_util_on_vm function that does
the very same thing as the internal implementation: Use that instead.
Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
Upstream-Status: Pending
diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py
index 7b2dca6..eecbf16 100644
--- a/qemu/tests/cpuflags.py
+++ b/qemu/tests/cpuflags.py
@@ -11,6 +11,7 @@ from autotest.client.shared import error, utils
from virttest import qemu_vm, virt_vm
from virttest import utils_misc, utils_test, aexpect
from autotest.client.shared.syncdata import SyncData
+from provider import cpuflags
def run(test, params, env):
@@ -385,21 +386,6 @@ def run(test, params, env):
return set(online) - set(disabled_cpu)
- def install_cpuflags_test_on_vm(vm, dst_dir):
- """
- Install stress to vm.
-
- :param vm: virtual machine.
- :param dst_dir: Installation path.
- """
- session = vm.wait_for_login()
- vm.copy_files_to(cpuflags_src, dst_dir)
- session.cmd("sync")
- session.cmd("cd %s; make EXTRA_FLAGS='';" %
- os.path.join(dst_dir, "cpu_flags"))
- session.cmd("sync")
- session.close()
-
def check_cpuflags_work(vm, path, flags):
"""
Check which flags work.
@@ -433,7 +419,7 @@ def run(test, params, env):
"""
ret = False
install_path = "/tmp"
- install_cpuflags_test_on_vm(vm, install_path)
+ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path)
flags = check_cpuflags_work(vm, install_path, guest_flags)
dd_session = vm.wait_for_login()
stress_session = vm.wait_for_login()
@@ -614,7 +600,7 @@ def run(test, params, env):
logging.info("Check main instruction sets.")
install_path = "/tmp"
- install_cpuflags_test_on_vm(self.vm, install_path)
+ cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path)
Flags = check_cpuflags_work(self.vm, install_path,
flags.all_possible_guest_flags)
@@ -815,7 +801,7 @@ def run(test, params, env):
(self.vm, _) = start_guest_with_cpuflags(cpuf_model, smp)
install_path = "/tmp"
- install_cpuflags_test_on_vm(self.vm, install_path)
+ cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path)
flags = check_cpuflags_work(self.vm, install_path,
flags.guest_flags)
dd_session = self.vm.wait_for_login()
@@ -931,7 +917,7 @@ def run(test, params, env):
vm = env.get_vm("vm1")
session = vm.wait_for_login(timeout=self.login_timeout)
- install_cpuflags_test_on_vm(vm, install_path)
+ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path)
Flags = check_cpuflags_work(vm, install_path,
flags.all_possible_guest_flags)
@@ -1060,7 +1046,7 @@ def run(test, params, env):
vm = env.get_vm("vm1")
session = vm.wait_for_login(timeout=self.login_timeout)
- install_cpuflags_test_on_vm(vm, install_path)
+ cpuflags.install_cpuflags_util_on_vm(test, vm, install_path)
Flags = check_cpuflags_work(vm, install_path,
flags.all_possible_guest_flags)
|