Change in vdsm[master]: tests: Unify fake execCmd mechanism
danken at redhat.com
danken at redhat.com
Wed Sep 17 21:05:16 UTC 2014
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: Unify fake execCmd mechanism
......................................................................
tests: Unify fake execCmd mechanism
qemuimg tests were using two mechanisms for faking utils.execCmd. The
old one was supporting faking a single command, no arguments validation,
and no way to control the retruned values of the call. This also used
textwrap module and partial functions where simpler ways can be used.
Now all tests are using the new mechanism, supporting:
- faking multiple commands, (e.g. call foo and then call bar based on
foo return value)
- checking input arguments (e.g. was it called with -foo "bar"?)
- returning any value from the call (e.g return 0, '', '' on success,
or return 1, '', 'error' on errors).
Sine this change requires rewriting of all the tests, I also normalized
the tests names to pep8 style, as they were very hard to read. This
could be a separate patch, but I don't think we would like to waste time
reviewing and verifying another patch for this.
Change-Id: I1b52d49047ebcced644ef39f256d8fac863a426c
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/32884
Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
Reviewed-by: Adam Litke <alitke at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/qemuimgTests.py
1 file changed, 73 insertions(+), 93 deletions(-)
Approvals:
Nir Soffer: Verified
Adam Litke: Looks good to me, but someone else must approve
Federico Simoncelli: Looks good to me, but someone else must approve
Dan Kenigsberg: Looks good to me, approved
--
To view, visit http://gerrit.ovirt.org/32884
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1b52d49047ebcced644ef39f256d8fac863a426c
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list