Change in vdsm[master]: clientif: add initial tests

fromani at redhat.com fromani at redhat.com
Tue Feb 18 08:57:25 UTC 2014


Francesco Romani has posted comments on this change.

Change subject: clientif: add initial tests
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.ovirt.org/#/c/24614/1/tests/clientifTests.py
File tests/clientifTests.py:

Line 24: from vm import VolumeError
Line 25: import clientIF
Line 26: 
Line 27: 
Line 28: INEXISTENT_PATH = '/this/path/should/not/exist'
> Minor nit - this should be '/this/path/must/not/exist' or simply '/no/such/
You're right. Fixed.
Line 29: FAKE_ISOFS_PATH = '/fake/path/to/isofs'
Line 30: FAKE_FLOPPY_PATH = '/fake/path/to/floppy'
Line 31: ISOFS_PATH = '/rhev/data-center/mnt/A.B.C.D:_ovirt_iso/XXX' \
Line 32:              '/images/11111111-1111-1111-1111-111111111111/' \


Line 33:              'Fedora-Live-Desktop-x86_64-19.iso'
Line 34: 
Line 35: 
Line 36: class FakeSuperVdsm:
Line 37:     def __init__(self, FakeCIF=None):
> FakeCIF parameter can be removed now.
Done
Line 38:         self.calls = []
Line 39: 
Line 40:     def mkIsoFs(self, *args, **kwargs):
Line 41:         self.calls.append(('mkIsoFs', args, kwargs))


Line 66:         'type': 'disk'
Line 67:     }
Line 68: 
Line 69: 
Line 70: def fakePayloadDrive():
> Can be simplified:
Done
Line 71:     return {
Line 72:         'index': '3',
Line 73:         'iface': 'ide',
Line 74:         'specParams': {


Line 97:         def getFakeProxy():
Line 98:             return self.supervdsm
Line 99:         clientIF.supervdsm.getProxy = getFakeProxy
Line 100:         # the supervdsm module uses a global to implement the singleton
Line 101:         # pattern. We need to override the getter function.
> Are you sure that we need this here?
here I'm trying to minimize the changes which need to be injected in clientIF, since prepareVolumePath directly uses

  supervdsm.getProxy()

(see around line 301 in vdsm/clientIF.py)

This way I just need to override one function, while in the former revisions I had to fake a module a runtime (clientIF.supervdsm).
I'm not particulary fond of either approach, so I'll do whatever is cleaner in the end.
Line 102: 
Line 103:     def assertCalled(self, funcName):
Line 104:         name, args, kwargs = self.supervdsm.calls[0]
Line 105:         self.assertEquals(name, funcName)


-- 
To view, visit http://gerrit.ovirt.org/24614
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iad652aed46b9fe985d7143052bd26320970502b5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpoledni at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list