All of lore.kernel.org
 help / color / mirror / Atom feed
From: supriya kannery <supriyak@in.ibm.com>
To: Uri Lublin <uril@redhat.com>, kvm@vger.kernel.org
Subject: [KVM-AUTOTEST] [PATCH] Iterate over reboot
Date: Tue, 21 Apr 2009 00:09:20 +0530	[thread overview]
Message-ID: <49ECC158.9070003@in.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 69 bytes --]

A patch for iterating over VM reboot

- Supriya Kannery,
  LTC, IBM


[-- Attachment #2: reboot-iterate --]
[-- Type: text/plain, Size: 2636 bytes --]

diff -Naurp kvm-autotest/client/tests/kvm_runtest_2/kvm_tests.cfg.sample kvm-autotest.mod/client/tests/kvm_runtest_2/kvm_tests.cfg.sample
--- kvm-autotest/client/tests/kvm_runtest_2/kvm_tests.cfg.sample	2009-04-13 17:20:56.000000000 +0530
+++ kvm-autotest.mod/client/tests/kvm_runtest_2/kvm_tests.cfg.sample	2009-04-20 23:22:33.000000000 +0530
@@ -50,6 +50,7 @@ variants:
         reboot = yes
         extra_params += " -snapshot"
         kill_vm_on_error = yes
+        reboot_iterations = 1
 
     - migrate:      install setup
         type = migration
diff -Naurp kvm-autotest/client/tests/kvm_runtest_2/kvm_tests.py kvm-autotest.mod/client/tests/kvm_runtest_2/kvm_tests.py
--- kvm-autotest/client/tests/kvm_runtest_2/kvm_tests.py	2009-04-13 17:20:56.000000000 +0530
+++ kvm-autotest.mod/client/tests/kvm_runtest_2/kvm_tests.py	2009-04-20 23:28:08.000000000 +0530
@@ -31,25 +31,28 @@ def run_boot(test, params, env):
     kvm_log.info("Logged in")
 
     if params.get("reboot") == "yes":
-        session.sendline(params.get("cmd_reboot"))
-        kvm_log.info("Reboot command sent; waiting for guest to go down...")
+        iteration = int(params.get("reboot_iterations",1))
+        while iteration:
+            session.sendline(params.get("cmd_reboot"))
+            kvm_log.info("Reboot command sent; waiting for guest to go down...")
+
+            if not kvm_utils.wait_for(lambda: not session.is_responsive(), 120, 0, 1):
+                message = "Guest refuses to go down"
+                kvm_log.error(message)
+                raise error.TestFail, message
+
+            session.close()
+
+            kvm_log.info("Guest is down; waiting for it to go up again...")
+
+            session = kvm_utils.wait_for(vm.ssh_login, 120, 0, 2)
+            if not session:
+                message = "Could not log into guest after reboot"
+                kvm_log.error(message)
+                raise error.TestFail, message
 
-        if not kvm_utils.wait_for(lambda: not session.is_responsive(), 120, 0, 1):
-            message = "Guest refuses to go down"
-            kvm_log.error(message)
-            raise error.TestFail, message
-
-        session.close()
-
-        kvm_log.info("Guest is down; waiting for it to go up again...")
-
-        session = kvm_utils.wait_for(vm.ssh_login, 120, 0, 2)
-        if not session:
-            message = "Could not log into guest after reboot"
-            kvm_log.error(message)
-            raise error.TestFail, message
-
-        kvm_log.info("Guest is up again")
+            kvm_log.info("Guest is up again")
+            iteration -= 1
 
     session.close()
 

             reply	other threads:[~2009-04-20 18:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 18:39 supriya kannery [this message]
2009-04-20 19:38 ` [KVM-AUTOTEST] [PATCH] Iterate over reboot Ryan Harper
2009-04-22  7:54   ` supriya kannery
2009-04-22 14:47 ` Uri Lublin
2009-05-01  9:18   ` supriya kannery
     [not found] <670003666.547921241172530227.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-05-01 10:13 ` Michael Goldish
2009-05-04 12:08   ` supriya kannery
2009-05-25 11:21     ` Uri Lublin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49ECC158.9070003@in.ibm.com \
    --to=supriyak@in.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=uril@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.