
if ret == PASS and len(hs) == 0: + name = 'Linux_ComputerSystem' + system = linux_cs + if ret == FAIL and len(hs) == 1: + name = hostname + system = hs[0] + if system.CreationClassName != name or system.Name != host: + logger.error("Exp %s, got %s" % (name, system.CreationClassName)) + logger.error("Exp %s, got %s" % (host, system.Name)) + status = FAIL + else: + logger.info("%s is %s" % (name, host)) + status = PASS + + if ret == PASS and len(hs) == 1: + if linux_cs.CreationClassName != 'Linux_ComputerSystem' \ + or linux_cs.Name != host \ + or hs[0].CreationClassName != hostname\ + or hs[0].Name != host: + logger.error("Exp Linux_ComputerSystem, got %s" % linux_cs.CreationClassName) + logger.error("Exp %s, got %s" % (host, linux_cs.Name)) + logger.error("Exp %s, got %s" % (hostname, hs[0].CreationClassName)) + logger.error("Exp %s, got %s" % (host, hs[0].Name)) + status = FAIL
When sblim-base-provider is installed, I dont think we will have HostSystem and Linux_ComputerSystem both returning the info. If both of them return values, then in that case the above check should return a FAIL instead of verifying the values, thoughts ?? Also, if my understanding is not complete, atleast the above checks should be separated.
Agreed. If ret == PASS and len(hs) == 1, you'll need to return FAIL. Really, this should look like the following: 1) Call check_sblim() 2) Enum HostSystem 3) If check SBLIM returns PASS: a) If enum of HostSystem returned an instance, return FAIL b) Else, the test can return PASS 4) Else: a) Verify enum of HostSystem returned one instance. If len(hs) != 1, return FAIL b) Verify the HostSystem attributes - return FAIL if any of the attributes don't match. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com