On Thu, Jul 01, 2010 at 05:59:33PM +0100, Luca Bigliardi wrote: > Signed-off-by: Luca Bigliardi <[email protected]> > --- > lib/cmdlib.py | 27 +++++++++++++++++++++++++-- > 1 files changed, 25 insertions(+), 2 deletions(-) > > diff --git a/lib/cmdlib.py b/lib/cmdlib.py
> @@ -1700,6 +1703,21 @@ class LUVerifyCluster(LogicalUnit): > node = ninfo.name > _ErrorIf = self._ErrorIf # pylint: disable-msg=C0103 > > + if drbd_helper: > + helper_result = nresult.get(constants.NV_DRBDHELPER, None) > + test = (helper_result == None) > + _ErrorIf(test, self.ENODEDRBDHELPER, node, > + "no drbd usermode helper returned") > + if helper_result: > + status, payload = helper_result > + test = not status > + _ErrorIf(test, self.ENODEDRBDHELPER, node, > + "drbd usermode helper check unsuccessful: %s", payload) > + if status: > + test = (payload != drbd_helper) > + _ErrorIf(test, self.ENODEDRBDHELPER, node, > + "wrong drbd usermode helper: %s", payload) If you do it like this, the test wrong drbd usermode helper and check unsuccessful won't be run in the simulate errors mode. I think rewriting the if status: … as follows should fix it: test = status and (payload != drbd_helper) _ErrorIf(test, …) LGTM after that. The rationale is that we want to make sure we run (in simulate errors mode) through all the error codes, as we had many times errors in the fail paths, and it's hard to test them otherwise. iustin
