Kaitlin Rupert wrote:
> - # undefine the vs
> - undefine_test_domain(default_dom, options.ip, options.virt)
> + if status != PASS:
> + destroy_netpool(server, virt, test_network)
> + destroy_and_undefine_domain(default_dom, server, virt)
> + return status
> +
> + # try to suspend already suspended VS
> + rq_state = SUSPND_STATE
> + status = try_request_state_change(default_dom, server,
> + rq_state, TIME, err_no, + err_desc, virt)
I'm not sure I see the benefit of this change. You're not verifying
the state of the guest.
It's possible for RequestStateChange() to return a success and for the
guest to be in an unexpected state.
This particular test case was previously
written with the assumption
that moving an already suspended VS to suspend state will not return any
exception from the provider and is a valid state transition. But this is
not true anymore. Also, the the above test case used to XFAIL sometime
back because of the problem in RequestedStateChange() bug.
The provider now returns an exception when we try to suspend the VS
which is already in suspended state. The exception is checked in the
try_request_state_change() library function.
The part of the code in the loop which we execute is not suppose to
return any exception. Hence the code in the loop and the one in
try_request_state_change() cannot be combined together.
Regarding validating the req_state value after
try_request_state_change() can be done to make sure the state still
remains the same as it was in before calling the RequestStateChange().
Thanks and Regards,
Deepti.
> +
> + destroy_netpool(server, virt, test_network)
> + destroy_and_undefine_domain(default_dom, server, virt)
>
> return status