Change in vdsm[master]: Functional Tests [1/3]: Added module for dummy nics

asegurap at redhat.com asegurap at redhat.com
Mon Aug 19 07:50:26 UTC 2013


Antoni Segura Puimedon has posted comments on this change.

Change subject: Functional Tests [1/3]: Added module for dummy nics
......................................................................


Patch Set 2: Code-Review-1

(4 comments)

I think Mark is adding some of these in ipwrapper in one of his patches. Maybe a rebase on top of his patch is in order.

....................................................
File tests/functional/dummy.py
Line 35: 
Line 36:     rc = -1
Line 37:     for i in random.sample(range(100), 100):
Line 38:         dummy_name = 'dummy_%s' % i
Line 39:         ip_add_dummy = [ip.cmd, 'link', 'add', dummy_name,
this should be a call to a linkAdd method in ipwrapper.
Line 40:                         'type', 'dummy']
Line 41:         rc, out, err = utils.execCmd(ip_add_dummy, sudo=True)
Line 42:         if rc == SUCCESS:
Line 43:             return dummy_name


Line 50:     """
Line 51:     Removes dummy interface dummyName. Assumes root privileges.
Line 52:     """
Line 53: 
Line 54:     ip_rm_dummy = [ip.cmd, 'link', 'delete',
this should be a call to a linkDelete method in ipwrapper.
Line 55:                    dummyName, 'type', 'dummy']
Line 56:     rc, out, err = utils.execCmd(ip_rm_dummy, sudo=True)
Line 57:     if rc != SUCCESS:
Line 58:         raise SkipTest("Unable to delete dummy interface:"


Line 59:                        " %s see %s %s" % (dummyName, out, err))
Line 60: 
Line 61: 
Line 62: def setIP(dummyName, ipaddr):
Line 63:     setDeviceIP = [ip.cmd, 'address', 'add', ipaddr, 'dev', dummyName]
this should be a call to a addrAdd method in ipwrapper.
Line 64:     rc, _, _ = utils.execCmd(setDeviceIP, sudo=True)
Line 65:     if rc == SUCCESS:
Line 66:         return
Line 67: 


Line 76:     _setLinkState(dummyName, 'down')
Line 77: 
Line 78: 
Line 79: def _setLinkState(dummyName, state):
Line 80:     activateDevice = [ip.cmd, 'link', 'set', 'dev', dummyName, state]
this should be a call to a linkSet method in ipwrapper.
Line 81:     rc, _, _ = utils.execCmd(activateDevice, sudo=True)
Line 82:     if rc == SUCCESS:
Line 83:         return
Line 84: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c7ed4110cd8d45a3fb7a9cc2cd2dc07004e96b9
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list