[Autotest][PATCH 09/12] virt: Adds funtion to virt_utils install_cpuflags_util_on_vm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiří Župka <jzupka@xxxxxxxxxx>
---
 client/virt/virt_utils.py |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/client/virt/virt_utils.py b/client/virt/virt_utils.py
index 17963fb..a2a73ec 100644
--- a/client/virt/virt_utils.py
+++ b/client/virt/virt_utils.py
@@ -3934,6 +3934,31 @@ def install_host_kernel(job, params):
                      install_type)
 
 
+def install_cpuflags_util_on_vm(test, vm, dst_dir, extra_flags=None):
+    """
+    Install stress to vm.
+
+    @param vm: virtual machine.
+    @param dst_dir: Installation path.
+    @param extra_flags: Extraflags for gcc compiler.
+    """
+    if not extra_flags:
+        extra_flags = ""
+
+    cpuflags_src = os.path.join(test.virtdir, "deps", "test_cpu_flags")
+    cpuflags_dst = os.path.join(dst_dir, "test_cpu_flags")
+    session = vm.wait_for_login()
+    session.cmd("rm -rf %s" %
+                (cpuflags_dst))
+    session.cmd("sync")
+    vm.copy_files_to(cpuflags_src, dst_dir)
+    session.cmd("sync")
+    session.cmd("cd %s; make EXTRA_FLAGS='%s';" %
+                    (cpuflags_dst, extra_flags))
+    session.cmd("sync")
+    session.close()
+
+
 def if_nametoindex(ifname):
     """
     Map an interface name into its corresponding index.
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux