Change in vdsm[master]: tests: setupNetworks with invalid params.

gvallare at redhat.com gvallare at redhat.com
Fri Aug 2 16:43:58 UTC 2013


Giuseppe Vallarelli has posted comments on this change.

Change subject: tests: setupNetworks with invalid params.
......................................................................


Patch Set 1: No score

(4 inline comments)

....................................................
File tests/functional/networkTests.py
Line 379: 
Line 380:     @permutations([[True], [False]])
Line 381:     @RequireDummyMod
Line 382:     @ValidateRunningAsRoot
Line 383:     def testSetupNetworksAddBadBondingName(self, brdgd):
Done
Line 384:         with dummyIf(1) as nics:
Line 385:             for badName in ('bond', 'bonda', 'bond0a', 'jamesbond007'):
Line 386:                 status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME:
Line 387:                                                           dict(bond=badName,


Line 392:                 self.assertEqual(status, neterrors.ERR_BAD_BONDING, msg)
Line 393: 
Line 394:     @RequireDummyMod
Line 395:     @ValidateRunningAsRoot
Line 396:     def testSetupNetworksAddBadBridgeName(self):
Done
Line 397:         with dummyIf(1) as nics:
Line 398:             attrs = dict(nic=nics[0], bridged=True)
Line 399:             status, msg = self.vdsm_net.setupNetworks({'---': attrs},
Line 400:                                                       {}, {})


Line 401:             self.assertEqual(status, neterrors.ERR_BAD_BRIDGE, msg)
Line 402: 
Line 403:     @permutations([[True], [False]])
Line 404:     def testSetupNetworksAddBadNic(self, bridged):
Line 405:         attrs = dict(nic='whatever', bridged=bridged)
I've added a new test in netmodelsTest instead to cover the raise of ERR_BAD_NIC.
Line 406:         status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME: attrs},
Line 407:                                                   {}, {})
Line 408: 
Line 409:         self.assertEqual(status, neterrors.ERR_BAD_NIC, msg)


Line 420:         attrs['bonding'] = 'nonexistingbond'
Line 421:         status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME: attrs},
Line 422:                                                   {}, {})
Line 423: 
Line 424:         self.assertTrue(status != SUCCESS, msg)
for the second assertion I've located the exact point where the exception is raised and written the related test, unluckily for the first one I've got a generic "Unexcepted exception".


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic77b3a9c0d84e38e8b9060191b138c3e09104dc6
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