
On 09/11/2013 05:43 AM, Viktor Mihajlovski wrote:
The number of expected RASDs for the test domain was incorrectly computed by enumerating all RASDs on the hypervisor which will always fail if the test domain doesn't have every possible RASD associated. Fixed by counting the resource settings in the virtual server instance and comparing that against the RASDs actually found.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py index d582ffb..5517a72 100644 --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py @@ -71,10 +71,6 @@ def init_rasd_list(virt, ip, guest_name): if guest == guest_name: rasd_insts[rasd.Classname] = rasd
- if len(rasds) != len(rasd_insts): - logger.error("Expected %d RASDs, got %d", len(rasds), len(rasd_insts)) - return rasd_insts, FAIL - return rasd_insts, PASS
@do_main(sup_types) @@ -106,6 +102,11 @@ def main(): logger.error("Unable to build rasd instance list") return status
+ if len(vsxml.res_settings) != len(rasds): + logger.error("Expected %d RASDs, got %d", len(vsxml.res_settings), + len(rasds)) + return FAIL + expr_values = { 'rc' : CIM_ERR_NOT_FOUND, 'desc' : 'No such instance'
ACK and pushed with the following change to account for the error paths not undefining the guest: diff --git a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py b/suites/libvirt-ci index 5517a72..feec39b 100644 --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py @@ -100,11 +100,13 @@ def main(): rasds, status = init_rasd_list(virt, options.ip, test_dom) if status != PASS: logger.error("Unable to build rasd instance list") + vsxml.undefine(server) return status if len(vsxml.res_settings) != len(rasds): logger.error("Expected %d RASDs, got %d", len(vsxml.res_settings), len(rasds)) + vsxml.undefine(server) return FAIL expr_values = { John