Dan Kenigsberg has posted comments on this change.
Change subject: Added tests for _addNetworkValidation and helpers.
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(8 inline comments)
Thanks; this time there are more interesting comments I hope.
....................................................
File tests/configNetworkTests.py
Line 52: confNetError = configNetwork.ConfigNetworkError
I do not see any benefit of defining a variable that is to be used only once within this
function.
btw, since this variable is a class, it should begin with an uppercase letter.
Line 58: for valueTuple in values:
having
for (vlan, msg) in values:
is prettier. Finding a clearer name for "values" would be cool.
However, in my opinion, the exact string of the message is not part of the API. We free to
change it, and it should not be part of the test.
Line 71: values = ['badValue', ' bond14', 'bond14 ',
'bond14a', 'bond0 0']
bondNames, maybe?
Line 74: msg = '%r is not a valid bonding device name' % value
again, no need to test the message text.
Line 87: addresses = ['10.18.1.254', '10.50.25.177',
'250.0.0.1',
since these list never change, it is better to use tuples.
Line 119: def _fakeBondingOptsPath(self, path):
I think _bondingOptExists is a better name.
Line 120: opt = path[path.rindex('/') + 1:]
this is os.path.basename, I believe.
Line 121: p = subprocess.Popen(['modinfo', 'bonding'],
It would be better to run modinfo only once, and memoize the result, over running it every
time this function is called.
and I wouldn't mind having such a function in vdsm proper (in an unrelated patch of
course).
--
To view, visit
http://gerrit.ovirt.org/6198
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd8bb649685fac00640e894a4484cdb0cc0b2f1c
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer(a)redhat.com>