All of lore.kernel.org
 help / color / mirror / Atom feed
* [KVM-AUTOTEST PATCH 1/5] KVM test: remote_login(): if rss.exe says "Please wait", wait
@ 2010-03-23 19:09 Michael Goldish
  2010-03-23 19:09 ` [KVM-AUTOTEST PATCH 2/5] KVM test: tests_base.cfg.sample: add /f option to all Windows shutdown commands Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Goldish @ 2010-03-23 19:09 UTC (permalink / raw)
  To: autotest, kvm

Recognize rss.exe's "Please wait" message and give the login procedure more
time to complete.  The message is sent before spawning cmd.exe, which may take
some time under heavy load.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_utils.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 5834539..8531c79 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -482,7 +482,8 @@ def remote_login(command, password, prompt, linesep="\n", timeout=10):
     while True:
         (match, text) = sub.read_until_last_line_matches(
                 [r"[Aa]re you sure", r"[Pp]assword:\s*$", r"^\s*[Ll]ogin:\s*$",
-                 r"[Cc]onnection.*closed", r"[Cc]onnection.*refused", prompt],
+                 r"[Cc]onnection.*closed", r"[Cc]onnection.*refused",
+                 r"[Pp]lease wait", prompt],
                  timeout=timeout, internal_timeout=0.5)
         if match == 0:  # "Are you sure you want to continue connecting"
             logging.debug("Got 'Are you sure...'; sending 'yes'")
@@ -510,7 +511,11 @@ def remote_login(command, password, prompt, linesep="\n", timeout=10):
             logging.debug("Got 'Connection refused'")
             sub.close()
             return None
-        elif match == 5:  # prompt
+        elif match == 5:  # "Please wait"
+            logging.debug("Got 'Please wait'")
+            timeout = 30
+            continue
+        elif match == 6:  # prompt
             logging.debug("Got shell prompt -- logged in")
             return sub
         else:  # match == None
-- 
1.5.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH 2/5] KVM test: tests_base.cfg.sample: add /f option to all Windows shutdown commands
  2010-03-23 19:09 [KVM-AUTOTEST PATCH 1/5] KVM test: remote_login(): if rss.exe says "Please wait", wait Michael Goldish
@ 2010-03-23 19:09 ` Michael Goldish
  2010-03-23 19:09   ` [KVM-AUTOTEST PATCH 3/5] KVM test: timedrift: first open ssh/rss sessions with the guest, then start load Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Goldish @ 2010-03-23 19:09 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

It seems that when Windows is locked it refuses to shutdown unless given the /f
option.

- Add /f to all Windows shutdown and reboot commands.
- Remove duplicate shutdown and reboot commands for Win2003, Win2008 and Win7.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/tests_base.cfg.sample |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index 2a36687..bacbcee 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -687,8 +687,8 @@ variants:
     # Windows section
     - @Windows:
         no autotest linux_s3 vlan_tag
-        shutdown_command = shutdown /s /t 0
-        reboot_command = shutdown /r /t 0
+        shutdown_command = shutdown /s /f /t 0
+        reboot_command = shutdown /r /f /t 0
         status_test_command = echo %errorlevel%
         shell_prompt = "^\w:\\.*>\s*$"
         username = Administrator
@@ -808,8 +808,6 @@ variants:
             - Win2003:
                 image_name = win2003
                 image_size = 20G
-                shutdown_command = shutdown /s /f /t 0
-                reboot_command = shutdown /r /f /t 0
 
                 variants:
                     - 32:
@@ -908,8 +906,6 @@ variants:
             - Win2008:
                 image_name = win2008
                 image_size = 20G
-                shutdown_command = shutdown /s /f /t 0
-                reboot_command = shutdown /r /f /t 0
 
                 variants:
                     - 32sp1:
@@ -985,8 +981,6 @@ variants:
             - Win7:
                 image_name = win7
                 image_size = 20G
-                shutdown_command = shutdown /s /f /t 0
-                reboot_command = shutdown /r /f /t 0
 
                 variants:
                     - 32:
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH 3/5] KVM test: timedrift: first open ssh/rss sessions with the guest, then start load
  2010-03-23 19:09 ` [KVM-AUTOTEST PATCH 2/5] KVM test: tests_base.cfg.sample: add /f option to all Windows shutdown commands Michael Goldish
@ 2010-03-23 19:09   ` Michael Goldish
  2010-03-23 19:10     ` [KVM-AUTOTEST PATCH 4/5] KVM test: stress_boot: make boot timeout controllable Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Goldish @ 2010-03-23 19:09 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Currently, for each guest "load session", a login is performed, followed
immediately by sending the command that initiates the load.  When the second
login is attempted, the guest is already loaded by the first session, and
therefore may respond slowly to the login request.
This patch makes the test open all load sessions first, and then send the load
command to all open sessions.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/tests/timedrift.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
index b3e8770..194f09c 100644
--- a/client/tests/kvm/tests/timedrift.py
+++ b/client/tests/kvm/tests/timedrift.py
@@ -98,8 +98,9 @@ def run_timedrift(test, params, env):
                     raise error.TestFail("Could not log into guest")
                 load_session.set_output_prefix("(guest load %d) " % i)
                 load_session.set_output_func(logging.debug)
-                load_session.sendline(guest_load_command)
                 guest_load_sessions.append(load_session)
+            for load_session in guest_load_sessions:
+                load_session.sendline(guest_load_command)
 
             # Run some load on the host
             logging.info("Starting load on host...")
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH 4/5] KVM test: stress_boot: make boot timeout controllable
  2010-03-23 19:09   ` [KVM-AUTOTEST PATCH 3/5] KVM test: timedrift: first open ssh/rss sessions with the guest, then start load Michael Goldish
@ 2010-03-23 19:10     ` Michael Goldish
  2010-03-23 19:10       ` [KVM-AUTOTEST PATCH 5/5] KVM test: abort-on-error mode Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Goldish @ 2010-03-23 19:10 UTC (permalink / raw)
  To: autotest, kvm

Use parameter 'boot_timeout'.  Defaults to 240.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH 5/5] KVM test: abort-on-error mode
  2010-03-23 19:10     ` [KVM-AUTOTEST PATCH 4/5] KVM test: stress_boot: make boot timeout controllable Michael Goldish
@ 2010-03-23 19:10       ` Michael Goldish
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Goldish @ 2010-03-23 19:10 UTC (permalink / raw)
  To: autotest, kvm

If 'abort_on_error' is set to 'yes' for a test, the entire job will be aborted
when that test fails.  If the parameter is set for all tests, the job will be
aborted as soon as the first test fails.  Before aborting, the filename of the
monitor unix socket of each VM will be printed, as well as the command line
used to start that VM.

Currently this is only supported in serial exceution mode.  Behavior in
parallel mode is undefined.

To enable abort-on-error, and to prevent the postprocessor from killing any
VMs, set the following options:

abort_on_error = yes
kill_vm.* ?= no
kill_unresponsive_vms.* ?= no

These options appear commented out near the end of tests.cfg.sample.

They can also be set for specific tests, either by writing an exception like

WinXP.32\b.*\bmigrate:
    abort_on_error = yes
    ...

in tests.cfg, or by setting the parameters in the test variant itself
(somewhere in tests_base.cfg).

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_preprocessing.py |   13 +++++++++++++
 client/tests/kvm/tests.cfg.sample     |    5 +++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index b3fef9d..50db65c 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -347,6 +347,19 @@ def postprocess(test, params, env):
                         int(params.get("post_command_timeout", "600")),
                         params.get("post_command_noncritical") == "yes")
 
+    # Abort on error?
+    if params.get("abort") == "yes":
+        exc_string = str(sys.exc_info()[1])
+        logging.info("Aborting job (%s)", exc_string)
+        for vm in kvm_utils.env_get_all_vms(env):
+            if not vm.is_dead():
+                logging.info("VM '%s' is alive.", vm.name)
+                logging.info("The monitor unix socket of '%s' is: %s",
+                             vm.name, vm.monitor_file_name)
+                logging.info("The command line used to start '%s' was:\n%s",
+                             vm.name, vm.make_qemu_command())
+        raise error.JobError("Abort requested (%s)" % exc_string)
+
 
 def postprocess_on_error(test, params, env):
     """
diff --git a/client/tests/kvm/tests.cfg.sample b/client/tests/kvm/tests.cfg.sample
index b86b6c4..2c17454 100644
--- a/client/tests/kvm/tests.cfg.sample
+++ b/client/tests/kvm/tests.cfg.sample
@@ -74,5 +74,10 @@ variants:
         only Fedora.12.64
         only unattended_install boot shutdown
 
+# Uncomment the following lines to enable abort-on-error mode:
+#abort_on_error = yes
+#kill_vm.* ?= no
+#kill_unresponsive_vms.* ?= no
+
 # Choose your test list from the testsets defined
 only qemu_kvm_f12_quick
-- 
1.5.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-23 19:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23 19:09 [KVM-AUTOTEST PATCH 1/5] KVM test: remote_login(): if rss.exe says "Please wait", wait Michael Goldish
2010-03-23 19:09 ` [KVM-AUTOTEST PATCH 2/5] KVM test: tests_base.cfg.sample: add /f option to all Windows shutdown commands Michael Goldish
2010-03-23 19:09   ` [KVM-AUTOTEST PATCH 3/5] KVM test: timedrift: first open ssh/rss sessions with the guest, then start load Michael Goldish
2010-03-23 19:10     ` [KVM-AUTOTEST PATCH 4/5] KVM test: stress_boot: make boot timeout controllable Michael Goldish
2010-03-23 19:10       ` [KVM-AUTOTEST PATCH 5/5] KVM test: abort-on-error mode Michael Goldish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.