Change in vdsm[master]: tests: Fix unsafe monkeypatching

danken at redhat.com danken at redhat.com
Fri Sep 25 12:24:17 UTC 2015


Dan Kenigsberg 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>
---
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: Verified
  Sandro Bonazzola: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I479fbd03db65e4c9cfa63fe4fe101f1b4b4c3876
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Jenkins CI
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>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list