Change in vdsm[master]: tests: virt: modernize vm* tests

danken at redhat.com danken at redhat.com
Thu Feb 25 16:04:39 UTC 2016


Dan Kenigsberg has posted comments on this change.

Change subject: tests: virt: modernize vm* tests
......................................................................


Patch Set 2: Code-Review-1

(7 comments)

https://gerrit.ovirt.org/#/c/54022/2/tests/vmApiTests.py
File tests/vmApiTests.py:

Line 51: list
no need to have a list here! I believe it's a python-modernize bug


https://gerrit.ovirt.org/#/c/54022/2/tests/vmOperationsTests.py
File tests/vmOperationsTests.py:

Line 343:         self._offset = offset
Line 344:         self._params = {}
Line 345: 
Line 346:     def setSchedulerParameters(self, params):
Line 347:         for k, v in list(params.items()):
ditto
Line 348:             self._params[k] = int(v) + self._offset
Line 349: 
Line 350:     def schedulerParameters(self):
Line 351:         return self._params


https://gerrit.ovirt.org/#/c/54022/2/tests/vmStatsTests.py
File tests/vmStatsTests.py:

Line 234: self.samples = list(_FAKE_BULK_STATS.values())[0]
self.samples = list(_FAKE_BULK_STATS.values())[0]


Line 284: 
Line 285:     def test_network_missing(self):
Line 286:         # seen using SR-IOV
Line 287: 
Line 288:         bulk_stats = list(_FAKE_BULK_STATS_SRIOV.values())[0]
next(six.itervalues(_FAKE_BULK_STATS_SRIOV)) would be a bit nicer.
Line 289:         indexes = vmstats._find_bulk_stats_reverse_map(
Line 290:             bulk_stats[0], 'net')
Line 291:         self.assertTrue(indexes)
Line 292: 


https://gerrit.ovirt.org/#/c/54022/2/tests/vmTests.py
File tests/vmTests.py:

Line 64: from testValidation import slowtest
Line 65: from vmTestsData import CONF_TO_DOMXML_X86_64
Line 66: from vmTestsData import CONF_TO_DOMXML_PPC64
Line 67: import vmfakelib as fake
Line 68: import six
please import far above
Line 69: from six.moves import zip
Line 70: 
Line 71: 
Line 72: _VM_PARAMS = {


https://gerrit.ovirt.org/#/c/54022/2/tests/vmUtilsTests.py
File tests/vmUtilsTests.py:

Line 24: from virt import vmexitreason
Line 25: 
Line 26: from testlib import permutations, expandPermutations
Line 27: from testlib import VdsmTestCase as TestCaseBase
Line 28: from six.moves import range
import belongs above
Line 29: 
Line 30: 
Line 31: class ExpiringCacheOperationTests(TestCaseBase):
Line 32:     def setUp(self):


https://gerrit.ovirt.org/#/c/54022/2/tests/vmfakelib.py
File tests/vmfakelib.py:

Line 64:             sec.usage_type = usage_type
Line 65:             sec.description = description
Line 66:         else:
Line 67:             # (usage_type, usage_id) pair must be unique
Line 68:             for sec in list(self.secrets.values()):
no need for list() call here.
Line 69:                 if sec.usage_type == usage_type and sec.usage_id == usage_id:
Line 70:                     raise Error(libvirt.VIR_ERR_INTERNAL_ERROR)
Line 71:             sec = Secret(self, uuid, usage_type, usage_id, description)
Line 72:             self.secrets[uuid] = sec


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9324ef9d17df148ea38a03771b896132ec02e22
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
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: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list