Antoni Segura Puimedon has posted comments on this change.

Change subject: iproute2 binary wrapper
......................................................................


Patch Set 18: (3 inline comments)

....................................................
File tests/ipwrapperTests.py
Line 23: 
Line 24: from testrunner import VdsmTestCase as TestCaseBase
Line 25: 
Line 26: 
Line 27: class TestIpwrapper(TestCaseBase):
I'm testing those exceptions via the text tests. If you look at it you'll see 
that some bad rules and bad routes contain invalid data that raises ValueError 
in the constructor.
Line 28:     def testRouteFromText(self):
Line 29:         _getRouteAttrs = lambda x: (x.network, x.ipaddr, x.device, 
x.table)
Line 30:         good_routes = {
Line 31:             'default via 192.168.99.254 dev eth0':


Line 25: 
Line 26: 
Line 27: class TestIpwrapper(TestCaseBase):
Line 28:     def testRouteFromText(self):
Line 29:         _getRouteAttrs = lambda x: (x.network, x.ipaddr, x.device, 
x.table)
The thing is that I do not want to create Route objects for the test, as that 
would introduce another point of possible failure. Let's say that a future 
patch touches and breaks the constructor in a small way, then the test might 
not fail, as the failure would be on both sides of the comparison.
Line 30:         good_routes = {
Line 31:             'default via 192.168.99.254 dev eth0':
Line 32:             ('0.0.0.0/0', '192.168.99.254', 'eth0', None),
Line 33:             'default via 192.168.99.254 dev eth0 table foo':


Line 27: class TestIpwrapper(TestCaseBase):
Line 28:     def testRouteFromText(self):
Line 29:         _getRouteAttrs = lambda x: (x.network, x.ipaddr, x.device, 
x.table)
Line 30:         good_routes = {
Line 31:             'default via 192.168.99.254 dev eth0':
The text string can have a few more elements that we should not fail if they 
are provided to us. The only thing that can be said is those bits of 
information that we require in order to use the rules.

That information is already on fromText in the code, those that are required 
will raise a ValueError if they are not provided. I can add it to the docstring.
Line 32:             ('0.0.0.0/0', '192.168.99.254', 'eth0', None),
Line 33:             'default via 192.168.99.254 dev eth0 table foo':
Line 34:             ('0.0.0.0/0', '192.168.99.254', 'eth0', 'foo'),
Line 35:             '200.100.50.0/16 via 11.11.11.11 dev eth2 table foo':


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1d315c3294fd7f058cdc840dea329d91a658a304
Gerrit-PatchSet: 18
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Assaf Muller <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Giuseppe Vallarelli <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to