# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1237383716 25200
# Node ID 783c9510aaf930a05766707da9a5569f491cad60
# Parent cfc6d625e43e7e78161da8eaf3364bd117e2ff3f
[TESTAdding option to main.py to accept target machine info for Migration Tests.
New option can be specified as below:
CIM_NS=root/virt CIM_USER=userid CIM_PASS=pass ./runtests libvirt-cim -i localhost -c -v
KVM -g VirtualSystemMigrationService -t 06_remote_migration.py --target_url
<hostname>
or
CIM_NS=root/virt CIM_USER=userid CIM_PASS=pass ./runtests libvirt-cim -i localhost -c -v
KVM -g VirtualSystemMigrationService -t 06_remote_migration.py -m <hostname>
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r cfc6d625e43e -r 783c9510aaf9 suites/libvirt-cim/main.py
--- a/suites/libvirt-cim/main.py Wed Mar 18 06:39:53 2009 -0700
+++ b/suites/libvirt-cim/main.py Wed Mar 18 06:41:56 2009 -0700
@@ -44,6 +44,8 @@
parser = OptionParser()
parser.add_option("-i", "--ip", dest="ip",
default="localhost",
help="IP address of machine to test (default: localhost)")
+parser.add_option("-m", "--target_url", dest="t_url",
default="localhost:5988",
+ help="URL of destination host for remote migration ")
parser.add_option("-p", "--port", dest="port",
type="int", default=5988,
help="CIMOM port (default: 5988)")
parser.add_option("-g", "--group", dest="group",
@@ -199,6 +201,14 @@
# with a different port
if options.port:
os.environ['CIMOM_PORT'] = str(options.port)
+
+ # src and target host info to be able to use
+ # in the tc for comparison in remote migration case
+ if ":" in options.ip:
+ (options.ip, port) = options.ip.split(":")
+
+ if ":" in options.t_url:
+ (options.t_url, port) = options.t_url.split(":")
if options.report:
to_addr = options.report
@@ -243,8 +253,9 @@
t_path = os.path.join(TEST_SUITE, test['group'])
os.environ['CIM_TC'] = test['test']
cdto = 'cd %s' % t_path
- run = 'python %s -i %s -v %s %s' % (test['test'], options.ip,
- options.virt, dbg)
+ run = 'python %s -i %s -v %s %s -m %s' % (test['test'],
options.ip,
+ options.virt, dbg,
+ options.t_url)
cmd = cdto + ' && ' + ' ' + run
status, output = commands.getstatusoutput(cmd)