From: <mik...@us...> - 2008-08-19 20:34:43
|
Revision: 867 http://omc.svn.sourceforge.net/omc/?rev=867&view=rev Author: mike-brasher Date: 2008-08-19 20:34:53 +0000 (Tue, 19 Aug 2008) Log Message: ----------- Beginnings of profile test. Modified Paths: -------------- cmpiprofiles/test/trunk/ProviderList.txt Added Paths: ----------- cmpiprofiles/test/trunk/ProfileTest.py Added: cmpiprofiles/test/trunk/ProfileTest.py =================================================================== --- cmpiprofiles/test/trunk/ProfileTest.py (rev 0) +++ cmpiprofiles/test/trunk/ProfileTest.py 2008-08-19 20:34:53 UTC (rev 867) @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# Author: Mike Brasher +# Date: Wed Aug 13 2008 +'''Testing ProfileTest''' +################################################################################ +## +## ProfileTest +## +################################################################################ + +import pywbem +import unittest +import sys +import traceback + +sys.path.append("./lib") + +import wbem_connection +from optparse import OptionParser +import ProviderSanityTest + +globalVerbose = False +globalNamespace = 'root/cimv2' +globalClass = None +globalParser = None +globalListFile = 'ProviderList.txt' + +################################################################################ +## +## __main__ +## +################################################################################ + +if __name__ == "__main__": + p = OptionParser() + wbem_connection.getWBEMConnParserOptions(p) + + options, arguments = p.parse_args() + + if options.namespace != None: + globalNamespace = options.namespace + + globalParser=p + + # Get centralClassName argument: + if (len(arguments) == 0): + print "missing central class argument\n" + sys.exit(1) + + centralClassName = arguments[0]; + + # Create connection. + c = wbem_connection.WBEMConnFromOptions(p) + + # For each instance of the central class. + names = c.EnumerateInstanceNames(centralClassName) + + if len(names) == 0: + print "no instances of the central class found: %s" %(centralClassName) + sys.exit(1) + + # Each instance of central class must have exactly one associator of type + # CIM_Registered profile. + + for name in names: + inst = c.GetInstance(name) + assocs = c.Associators(name, AssocClass='CIM_ElementConformsToProfile') + + if len(assocs) != 1: + print "error: expected instance of central class to have 1 " \ + "associator through CIM_ElementConformsToProfile but found %d" \ + %(len(assocs)) + sys.exit(1) Property changes on: cmpiprofiles/test/trunk/ProfileTest.py ___________________________________________________________________ Added: svn:executable + * Modified: cmpiprofiles/test/trunk/ProviderList.txt =================================================================== --- cmpiprofiles/test/trunk/ProviderList.txt 2008-08-19 19:40:52 UTC (rev 866) +++ cmpiprofiles/test/trunk/ProviderList.txt 2008-08-19 20:34:53 UTC (rev 867) @@ -38,17 +38,17 @@ Linux_FanRegisteredProfile root/cimv2 Linux_FanSystemDevice root/cimv2 -Linux_PowerElementConformsToProfile root/cimv2 -Linux_PowerElementConformsToProfile root/interop -Linux_PowerHostedCollection root/cimv2 -Linux_PowerIsSpare root/cimv2 -Linux_PowerMemberOfCollection root/cimv2 -Linux_PowerOwningCollectionElement root/cimv2 +Linux_PowerSupplyElementConformsToProfile root/cimv2 +Linux_PowerSupplyElementConformsToProfile root/interop +Linux_PowerSupplyHostedCollection root/cimv2 +Linux_PowerSupplyIsSpare root/cimv2 +Linux_PowerSupplyMemberOfCollection root/cimv2 +Linux_PowerSupplyOwningCollectionElement root/cimv2 Linux_PowerSupply root/cimv2 -Linux_PowerRedundancySet root/cimv2 -Linux_PowerReferencedProfile root/interop -Linux_PowerRegisteredProfile root/interop -Linux_PowerSystemDevice root/cimv2 +Linux_PowerSupplyRedundancySet root/cimv2 +Linux_PowerSupplyReferencedProfile root/interop +Linux_PowerSupplyRegisteredProfile root/interop +Linux_PowerSupplySystemDevice root/cimv2 Linux_SSHCapabilities root/cimv2 Linux_SSHElementCapabilities root/cimv2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |