[KVM-AUTOTEST PATCH 4/5] KVM test: stress_boot: make boot timeout controllable

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

 



Use parameter 'boot_timeout'.  Defaults to 240.

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/tests/stress_boot.py  |    9 +++++----
 client/tests/kvm/tests_base.cfg.sample |    1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/tests/kvm/tests/stress_boot.py b/client/tests/kvm/tests/stress_boot.py
index 0b5ec02..24a005c 100644
--- a/client/tests/kvm/tests/stress_boot.py
+++ b/client/tests/kvm/tests/stress_boot.py
@@ -21,7 +21,8 @@ def run_stress_boot(tests, params, env):
 
     logging.info("Waiting for first guest to be up...")
 
-    session = kvm_utils.wait_for(vm.remote_login, 240, 0, 2)
+    boot_timeout = float(params.get("boot_timeout", 240))
+    session = kvm_utils.wait_for(vm.remote_login, boot_timeout, 0, 2)
     if not session:
         raise error.TestFail("Could not log into first guest")
 
@@ -32,9 +33,8 @@ def run_stress_boot(tests, params, env):
     # boot the VMs
     while num <= int(params.get("max_vms")):
         try:
-            vm_name = "vm" + str(num)
-
             # clone vm according to the first one
+            vm_name = "vm" + str(num)
             vm_params = vm.get_params().copy()
             vm_params["address_index"] = str(address_index)
             curr_vm = vm.clone(vm_name, vm_params)
@@ -43,7 +43,8 @@ def run_stress_boot(tests, params, env):
             kvm_preprocessing.preprocess_vm(tests, vm_params, env, vm_name)
             params['vms'] += " " + vm_name
 
-            curr_vm_session = kvm_utils.wait_for(curr_vm.remote_login, 240, 0, 2)
+            curr_vm_session = kvm_utils.wait_for(curr_vm.remote_login,
+                                                 boot_timeout, 0, 2)
             if not curr_vm_session:
                 raise error.TestFail("Could not log into guest #%d" % num)
 
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index bacbcee..249f1b4 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -179,6 +179,7 @@ variants:
         max_vms = 5    
         alive_test_cmd = uname -a
         clone_address_index_base = 10
+        boot_timeout = 240
         kill_vm = yes
         kill_vm_vm1 = no
         kill_vm_gracefully = no
-- 
1.5.4.1

--
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