From: tangchen <tangchen@cn.fujitsu.com>
To: Lucas Meneghel Rodrigues <lmr@redhat.com>,
autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 0/3] Add migration function and test for libvirt.
Date: Tue, 17 Jan 2012 11:24:53 +0800 [thread overview]
Message-ID: <4F14EA05.9040506@cn.fujitsu.com> (raw)
In-Reply-To: <4F14E93A.1080902@cn.fujitsu.com>
This patch tests the "virsh migrate" command with --live parameter.
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
---
client/tests/libvirt/tests/virsh_migrate.py | 33 +++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
create mode 100644 client/tests/libvirt/tests/virsh_migrate.py
diff --git a/client/tests/libvirt/tests/virsh_migrate.py b/client/tests/libvirt/tests/virsh_migrate.py
new file mode 100644
index 0000000..5576e78
--- /dev/null
+++ b/client/tests/libvirt/tests/virsh_migrate.py
@@ -0,0 +1,33 @@
+import re, os, logging, commands, shutil
+from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.virt import virt_vm, virt_utils, virt_env_process
+
+def run_virsh_migrate(test, params, env):
+ """
+ Test the migrate command with parameter --live.
+ """
+
+ vm_name = params.get("main_vm")
+ vm = env.get_vm(params["main_vm"])
+ vm.verify_alive()
+
+ destuser = params.get("destuser")
+ destpwd = params.get("destpwd")
+ destip = params.get("destip")
+ destprompt = params.get("destprompt")
+
+ # Migrate the guest.
+ ret = vm.migrate()
+ if ret == False:
+ raise error.TestFail("Migration of %s failed." % vm_name)
+
+ session = virt_utils.remote_login("ssh", destip, "22", destuser, destpwd, destprompt)
+ status, output = session.cmd_status_output("virsh domstate %s" % vm_name)
+ logging.info("Out put of virsh domstate %s: %s" % (vm_name, output))
+
+ if status == 0 and output.find("running") >= 0:
+ logging.info("Running guest %s is found on destination." % vm_name)
+ session.cmd("virsh destroy %s" % vm_name)
+ else:
+ raise error.TestFail("Destination has no running guest named %s." % vm_name)
+
--
1.7.3.1
--
Best Regards,
Tang chen
next prev parent reply other threads:[~2012-01-17 3:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 3:21 [PATCH 0/3] Add migration function and test for libvirt tangchen
2012-01-17 3:24 ` [Autotest] [PATCH 1/3] " tangchen
2012-01-17 3:24 ` tangchen [this message]
2012-01-17 3:25 ` [PATCH 3/3] " tangchen
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=4F14EA05.9040506@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=lmr@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.