This patch uses services_setup() in reboot/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 reboot test and setup env at that time.

example tests.cfg:
.. variances:
..     - prepare_env:
..         only reboot
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh
..         rebooted = none
..     - reboot_host:
..         # host needs reboot, client test doesn't support it, you can
..         # submit two jobs, one for env preparation, one for real test)
..     - perf_tests:
..         only netperf.exhost_guest
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh

Signed-off-by: Amos Kong <[email protected]>
---
 client/virt/tests/boot.py    |    5 +++--
 client/virt/tests/netperf.py |    4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index cd8298e..7eaf702 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
@@ -277,10 +277,6 @@ variants:
         restart_vm = yes
         kill_vm_on_error = yes
         login_timeout = 240
-        # those two scripts are used to setup test env for guest/host
-        # before performance testing
-        # stop_services_script = scripts/rh_stop_services.sh
-        # off_services_script = scripts/rh_off_services.sh
 
     - boot_with_usb:
         only Linux
@@ -358,6 +354,9 @@ variants:
         reboot_method = shell
         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
 
     - reboot_with_usb:
         only Linux
@@ -1252,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 555c402..0a003ac 100644
--- a/client/virt/tests/boot.py
+++ b/client/virt/tests/boot.py
@@ -88,6 +88,9 @@ def run_boot(test, params, env):
         error.context("Verify device(s) before rebooting.")
         _check_device(check_func)
 
+    if params.get("rh_perf_envsetup_script"):
+        virt_test_utils.service_setup(vm, session, test.virtdir)
+
     if params.get("reboot_method"):
         error.context("Reboot guest.")
         if params["reboot_method"] == "system_reset":
@@ -98,6 +101,4 @@ def run_boot(test, params, env):
             error.context("Verify device(s) after rebooting.")
             _check_device(check_func)
 
-    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