Please ignore this patch.
Regards,
Deepti.
Deepti B. Kalakeri wrote:
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207917822 -19800
# Node ID 970eaf6adde2704888d914c45c0aba19aff7f4dc
# Parent ee931f10e1f0b83d410f8e1c13d320b23bba7f1e
[TEST] #2 Fixing 01_netport.py tc failure.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r ee931f10e1f0 -r 970eaf6adde2
suites/libvirt-cim/cimtest/NetworkPort/01_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 16:58:23 2008
+0530
+++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Apr 11 18:13:42 2008
+0530
@@ -30,12 +30,9 @@
# Date : 24-10-2007
import sys
-import pywbem
-from VirtLib import utils
-from VirtLib import live
from XenKvmLib import devices
from XenKvmLib.classes import get_typed_class
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
+from XenKvmLib.vxml import get_class
from CimTest.Globals import log_param, logger
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
@@ -51,55 +48,54 @@ def main():
def main():
options = main.options
log_param()
+ status = PASS
vsxml = get_class(options.virt)(test_dom, mac=test_mac)
vsxml.define(options.ip)
devid = "%s/%s" % (test_dom, test_mac)
key_list = { 'DeviceID' : devid,
- 'CreationClassName' : get_typed_class(options.virt,
"NetworkPort"),
+ 'CreationClassName' : get_typed_class(options.virt,
+
"NetworkPort"),
'SystemName' : test_dom,
- 'SystemCreationClassName' : get_typed_class(options.virt,
"ComputerSystem")
+ 'SystemCreationClassName' : get_typed_class(options.virt,
+
"ComputerSystem")
}
-
dev = None
-
try:
- dev = eval('devices.' + get_typed_class(options.virt,
"NetworkPort"))(options.ip, key_list)
+ dev = eval('devices.' + get_typed_class(options.virt,
"NetworkPort")) \
+ (options.ip, key_list)
except Exception, detail:
logger.error("Exception: %s" % detail)
vsxml.undefine(options.ip)
return XFAIL_RC(bug)
- if dev == None:
+ if devid != dev.DeviceID :
logger.error("Error retrieving instance for devid %s" % devid)
vsxml.undefine(options.ip)
return FAIL
-
- status = PASS
if dev.LinkTechnology != devices.LinkTechnology_Ethernet:
- logger.error("LinkTechnology should be set to `%i' instead of
`%s'" % \
- (devices.LinkTechnology_Ethernet, dev.LinkTechnology))
+ logger.error("LinkTechnology should be set to `%i' instead of
`%s'"
+ % (devices.LinkTechnology_Ethernet, dev.LinkTechnology))
status = FAIL
addrs = dev.NetworkAddresses
if len(addrs) != 1:
- logger.error("Too many NetworkAddress entries (%i instead of %i)" % \
- (len(addrs), 1))
+ logger.error("Too many NetworkAddress entries (%i instead of %i)"
+ % (len(addrs), 1))
status = FAIL
if addrs[0] != test_mac:
- logger.error("MAC address reported incorrectly (%s instead of %s)" %
\
- (addrs[0], test_mac))
+ logger.error("MAC address reported incorrectly (%s instead of %s)"
+ % (addrs[0], test_mac))
status = FAIL
if status == FAIL:
logger.error("Checked interface %s" % test_mac)
vsxml.undefine(options.ip)
-
return status
if __name__ == "__main__":
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim