Change in vdsm[master]: net: tests: move Dummy class into nettestlib.py

phoracek at redhat.com phoracek at redhat.com
Wed Aug 12 10:30:49 UTC 2015


Petr Horáček has posted comments on this change.

Change subject: net: tests: move Dummy class into nettestlib.py
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/44696/1/tests/nettestlib.py
File tests/nettestlib.py:

Line 141: 
Line 142: 
Line 143: class Dummy(Interface):
Line 144: 
Line 145:     def __init__(self, prefix='dummy_', max_length=10):
in original Dummy() we had max_length=11, why the change?
Line 146:         super(Dummy, self).__init__(prefix, max_length)
Line 147: 
Line 148:     def create(self):
Line 149:         """


Line 149:         """
Line 150:         Create a dummy interface with a pseudo-random suffix, e.g.
Line 151:         dummy_ilXaYiSn7.
Line 152:         Limit the name to 11 characters to make room for VLAN IDs.
Line 153:         This assumes root privileges.
see my comment in previous patch.
Line 154:         """
Line 155:         try:
Line 156:             linkAdd(self.devName, linkType='dummy')
Line 157:         except IPRoute2Error as e:


Line 163:     def remove(self):
Line 164:         """
Line 165:         Remove the dummy interface. This assumes root privileges.
Line 166:         """
Line 167: 
extra empty line
Line 168:         try:
Line 169:             linkDel(self.devName)
Line 170:         except IPRoute2Error as e:
Line 171:             raise SkipTest("Unable to delete the dummy interface %s: %s" %


Line 171:             raise SkipTest("Unable to delete the dummy interface %s: %s" %
Line 172:                            (self.devName, e))
Line 173: 
Line 174:     def set_link_up(self):
Line 175:         self._up()
why do we need two names for one method?
Line 176: 
Line 177:     def set_ip(self, ipaddr, netmask, family=4):
Line 178:         try:
Line 179:             addrAdd(self.devName, ipaddr, netmask, family)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6629e65a11e095378a91ed3f97f6be33b9b56357
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horacek <phoracek at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list