[Libvirt-cim] [PATCH] [TEST] Fixing 01_forward.py tc of HostedDependency, accomdating sblim-base-provider changes

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Sep 25 23:32:42 UTC 2008


> +
> +    # This below modification is req to accomadate the 
> +    # sblim-base-provider provider related changes
> +    if ret == PASS and len(host_info) == 0:
> +        host = linux_cs
> +    elif ret == FAIL  and len(host_info) == 1:
> +        host = host_info[0]
> +    elif (ret == FAIL and len(host_info) == 0)  or \
> +         (ret == PASS and len(host_info) == 1):
> +        logger.error("Error in getting HostSystem information, Exiting...")
> +        cxml.undefine(options.ip)
> +        return FAIL

This kind of checking isn't needed.  If sblim_check() returns PASS, use 
the instance returned by it.  Otherwise, verify len(host_info) > 1.  If 
it's not, return FAIL.  Continue with the test if it is greater than 1. 
  So, you have:

if ret == PASS:
    host = linux_cs
elif len(host_info) > 1:
    host = host_info[0]
else:
    return FAIL

The reason HostSystem enum_01.py needs to make this check is that it is 
the test we use to very the enumeration of the HostSystem class.  If 
both a SBLIM provider and a HostSystem instance are returned, the 
HostSystem/enum_01.py test will fail.

This test is about verifying the HostedDependency association - so, all 
we need is the instance.  HostSystem instance verification can take 
place in enum_01.py.

And I didn't think of it when I was reviewing Daisy's tests, but we 
could roll the sblim_check() call and the above if/elif/else statement 
info get_host_info().  That way, you only need to call get_host_info() - 
no need to worry about other checks.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list