Change in vdsm[ovirt-3.5]: tests: Fix unsafe monkeypatching

fromani at redhat.com fromani at redhat.com
Mon Oct 26 11:54:45 UTC 2015


Francesco Romani has submitted this change and it was merged.

Change subject: tests: Fix unsafe monkeypatching
......................................................................


tests: Fix unsafe monkeypatching

mkimage module could be left in bad state if setup failed after it was
patched, or removing temporary files in tearDown failed.

This patch ensures that the module is patched only if all other setUp
code was successful, and is restored first in tearDown.

The manual patching code was replaced with the monkeypatch.Patch.

Change-Id: I479fbd03db65e4c9cfa63fe4fe101f1b4b4c3876
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46388
Reviewed-by: Sandro Bonazzola <sbonazzo at redhat.com>
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/47208
Tested-by: Francesco Romani <fromani at redhat.com>
Continuous-Integration: Francesco Romani <fromani at redhat.com>
---
M tests/mkimageTests.py
1 file changed, 12 insertions(+), 14 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Looks good to me, but someone else must approve
  Francesco Romani: Verified; Looks good to me, approved; Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/47208
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I479fbd03db65e4c9cfa63fe4fe101f1b4b4c3876
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo at redhat.com>


More information about the vdsm-patches mailing list