Martin Sivák has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 6: (2 inline comments)
....................................................
File tests/functional/momTests.py
Line 67: self.assertEqual(bool(run), hostStats['ksmState'])
Line 68: self.assertEqual(pages_to_scan, hostStats['ksmPages'])
Line 69:
Line 70: def _statsOK(self, stats):
Line 71: try:
If bool return bool? I know it might be a bit more explicit, but my teachers
always hated it..
Why don't you use
try:
return stats['status'] == 'Running' and stats['balloonInfo'] and
stats['memoryStats']
except KeyError:
return False
Line 72: if stats['status'] == 'Running' and stats['balloonInfo'] \
Line 73: and stats['memoryStats']:
Line 74: return True
Line 75: else:
Line 100: return candidateStats
Line 101:
Line 102: def _setPolicy(self, operation):
Line 103: curpath = os.path.dirname(__file__)
Line 104: policies = {'Shrink': "60_test_balloon_shrink.policy",
Please move the constant out of the helper method. Class attribute is much
better for this (or at least __init__ or possibly setUp).
Line 105: 'Grow': "70_test_balloon_grow.policy"}
Line 106: file_name = os.path.join(curpath, policies[operation])
Line 107: try:
Line 108: with open(file_name, 'r') as f:
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Mei Liu <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches