# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1236948993 25200
# Node ID c504e1a011d7891cb974702ca249bc7b5ab1fffa
# Parent b50635aae0979d8770435cc1d5e6b478ef0d8853
[TEST[RFC] Adding 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 b50635aae097 -r c504e1a011d7 suites/libvirt-cim/main.py
--- a/suites/libvirt-cim/main.py Fri Mar 13 05:50:45 2009 -0700
+++ b/suites/libvirt-cim/main.py Fri Mar 13 05:56:33 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)