This patch uses services_setup() in boot/netperf to
setup environment.

We might use disk snapshot in netperf test when boot up
more than one guests, setup would not effect, so
execute a boot test and setup env at that time.

example tests.cfg:
.. variances:
..     - prepare_env:
..         only boot
..         only Linux
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh
..     - reboot host_guest:
..         #host needs reboot
..     - perf_tests:
..         only ntttcp.guest_guest netperf.exhost_guest
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh

Signed-off-by: Amos Kong <[email protected]>
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index bf189e0..852dce3 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
@@ -277,6 +277,9 @@ variants:
         restart_vm = yes
         kill_vm_on_error = yes
         login_timeout = 240
+        # this script is used to setup test env for (linux)guest/host
+        # before performance testing
+        # rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh
 
     - boot_with_usb:
         only Linux
@@ -1248,6 +1251,9 @@ variants:
         # sizes = "64 256 512 1024"
         # sizes_rr = "64 256 512 1024"
         numa_node = -1
+        # this script is used to setup test env for (linux)guest/host
+        # before performance testing
+        # rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh
         variants:
             - guest_guest:
                 vms += " vm2"
diff --git a/client/virt/tests/boot.py b/client/virt/tests/boot.py
index af40d1c..c6a3ff4 100644
--- a/client/virt/tests/boot.py
+++ b/client/virt/tests/boot.py
@@ -3,6 +3,7 @@ import sys
 import re
 
 from autotest.client.shared import error
+from autotest.client.virt import virt_test_utils
 
 
 def _get_function(func_name):
@@ -97,4 +98,7 @@ def run_boot(test, params, env):
             error.context("Verify device(s) after rebooting.")
             _check_device(check_func)
 
+    if params.get("rh_perf_envsetup_script"):
+        virt_test_utils.service_setup(vm, session, test.virtdir)
+
     session.close()
diff --git a/client/virt/tests/netperf.py b/client/virt/tests/netperf.py
index 5fcb2f1..9733c7e 100644
--- a/client/virt/tests/netperf.py
+++ b/client/virt/tests/netperf.py
@@ -22,6 +22,8 @@ def run_netperf(test, params, env):
     vm.verify_alive()
     login_timeout = int(params.get("login_timeout", 360))
     session = vm.wait_for_login(timeout=login_timeout)
+    if params.get("rh_perf_envsetup_script"):
+        virt_test_utils.service_setup(vm, session, test.virtdir)
     server = vm.get_address()
     server_ctl = vm.get_address(1)
     session.close()
@@ -38,6 +40,8 @@ def run_netperf(test, params, env):
         vm2 = env.get_vm("vm2")
         vm2.verify_alive()
         session2 = vm2.wait_for_login(timeout=login_timeout)
+        if params.get("rh_perf_envsetup_script"):
+            virt_test_utils.service_setup(vm2, session2, test.virtdir)
         client = vm2.get_address()
         session2.close()
         if params.get('numa_node'):

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to