Change in vdsm[master]: tests: delNetwork with invalid bond/vlan and mtu.

gvallare at redhat.com gvallare at redhat.com
Sat Aug 3 18:44:33 UTC 2013


Giuseppe Vallarelli has posted comments on this change.

Change subject: tests: delNetwork with invalid bond/vlan and mtu.
......................................................................


Patch Set 1: (3 inline comments)

....................................................
File tests/functional/networkTests.py
Line 245: 
Line 246:     @permutations([[True], [False]])
Line 247:     @RequireDummyMod
Line 248:     @ValidateRunningAsRoot
Line 249:     def testDelNetworkBadBondingName(self, brdgd):
Searching for the error message  "... not a valid bonding device name" I've found that validateName within Bond class raises the related exception - this is already covered by a unit test in netmodelsTest. I will drop this test.
Line 250:         with dummyIf(1) as nics:
Line 251:             for badName in ('bond', 'bonda', 'bond0a', 'jamesbond007'):
Line 252:                 status, msg = self.vdsm_net.delNetwork(NETWORK_NAME,
Line 253:                                                        bond=badName,


Line 256:                 self.assertEqual(status, neterrors.ERR_BAD_BONDING, msg)
Line 257: 
Line 258:     @RequireDummyMod
Line 259:     @ValidateRunningAsRoot
Line 260:     def testDelNetworkBadVlanName(self):
A similar consideration to the first comment can be applied here - the covering unit test for this behaviour is testIsVlanIdValid.
Line 261:         with dummyIf(1) as nics:
Line 262:             for badName in ('a', '4096'):
Line 263:                 status, msg = self.vdsm_net.delNetwork(NETWORK_NAME,
Line 264:                                                        vlan=badName,


....................................................
File tests/functional/utils.py
Line 189: 
Line 190:     def vlanExists(self, vlan_name):
Line 191:         return vlan_name in self.netinfo.vlans
Line 192: 
Line 193:     def getMtu(self, name, obj_type):
Question is it guaranteed that bridges/bonds/nics can't have the same name?in that case your version couldn't work properly.

These if types read from here or there are due to the actual design where the mtu is not attached to the related entity...

For now I will refactor as you suggest.
Line 194:         mtu = None
Line 195:         try:
Line 196:             if obj_type == 'network':
Line 197:                 return self.netinfo.networks[name]['mtu']


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfbe14ca3597551c4582d07aa8215825e25daeea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list