Nir Soffer has posted comments on this change.

Change subject: fix tests for qemuimg.convert() to allow additional 
capabilities checks
......................................................................


Patch Set 2:

(5 comments)

http://gerrit.ovirt.org/#/c/36366/2/tests/qemuimgTests.py
File tests/qemuimgTests.py:

Line 156
Line 157
Line 158
Line 159
Line 160
Please use the same method to simplify "create" tests above.


Line 246:             with FakeCmd(utils, 'watchCmd', convert):
Line 247:                 qemuimg.convert('src', 'dst', None, dstFormat='qcow2',
Line 248:                                 backing='bak', backingFormat='qcow2')
Line 249: 
Line 250:     def test_qcow2_compat(self, **kw):
This should be different class - it is not related to convert.
Line 251:         def call(cmd, **kw):
Line 252:             expected = [QEMU_IMG, 'convert', '-O', 'qcow2', '-o', '?',
Line 253:                         '/dev/null', '/dev/null']
Line 254:             self.assertEqual(cmd, expected)


Line 251:         def call(cmd, **kw):
Line 252:             expected = [QEMU_IMG, 'convert', '-O', 'qcow2', '-o', '?',
Line 253:                         '/dev/null', '/dev/null']
Line 254:             self.assertEqual(cmd, expected)
Line 255:             return 0, '', ''
You should check both "convert", "create" and maybe invalid input.
Line 256: 
Line 257:         def supported(cmd, **kw):
Line 258:             return 0, 'Supported options:\ncompat ...\n', ''
Line 259: 


Line 263:         with FakeCmd(utils, 'execCmd', call):
Line 264:             qemuimg._supports_qcow2_compat('convert')
Line 265: 
Line 266:         with FakeCmd(utils, 'execCmd', supported):
Line 267:             self.assertTrue(qemuimg._supports_qcow2_compat('convert'))
Should be separate test.
Line 268: 
Line 269:         with FakeCmd(utils, 'execCmd', unsupported):
Line 270:             
self.assertFalse(qemuimg._supports_qcow2_compat('convert'))
Line 271: 


Line 266:         with FakeCmd(utils, 'execCmd', supported):
Line 267:             self.assertTrue(qemuimg._supports_qcow2_compat('convert'))
Line 268: 
Line 269:         with FakeCmd(utils, 'execCmd', unsupported):
Line 270:             
self.assertFalse(qemuimg._supports_qcow2_compat('convert'))
Should be separate test.
Line 271: 
Line 272:     def supported(self, command, result):
Line 273:         def check(arg):
Line 274:             self.assertEqual(command, arg)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I386772bf2a25a880b5ad387f284679eed81c5615
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to