Change in vdsm[master]: tests: Adding functional tests for networking

danken at redhat.com danken at redhat.com
Wed May 22 18:11:20 UTC 2013


Dan Kenigsberg has posted comments on this change.

Change subject: tests: Adding functional tests for networking
......................................................................


Patch Set 8: I would prefer that you didn't submit this

(5 inline comments)

....................................................
File tests/functional/networkTests.py
Line 26: 
Line 27: NETWORK_NAME = 'test-network'
Line 28: VLAN_ID = '27'
Line 29: BONDING_NAME = 'bond0'
Line 30: 
Don't you need to modprobe here?

(First check if the dummy device already exists)
Line 31: 
Line 32: @expandPermutations
Line 33: class NetworkTestShould(TestCaseBase):
Line 34: 


Line 34: 
Line 35:     def setUp(self):
Line 36:         self.vdsm_net = VdsProxy()
Line 37: 
Line 38:     def testAddDeleteANetwork(self):
This is the  test case where bridgedness is the most important.
Line 39:         status, msg = self.vdsm_net.addNetwork(NETWORK_NAME)
Line 40:         self.assertEqual(status, SUCCESS, msg)
Line 41:         self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME))
Line 42: 


Line 36:         self.vdsm_net = VdsProxy()
Line 37: 
Line 38:     def testAddDeleteANetwork(self):
Line 39:         status, msg = self.vdsm_net.addNetwork(NETWORK_NAME)
Line 40:         self.assertEqual(status, SUCCESS, msg)
We should skip the test if the net already exists, or include cleanup code somewhere. I fear one test failing causing failure to all future tests.
Line 41:         self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME))
Line 42: 
Line 43:         status, msg = self.vdsm_net.delNetwork(NETWORK_NAME)
Line 44:         self.assertEqual(status, SUCCESS, msg)


....................................................
File tests/functional/utils.py
Line 16: #
Line 17: # Refer to the README and COPYING files for full details of the license
Line 18: #
Line 19: from vdsm import netinfo
Line 20: from vdsm import vdscli
I'd love to hear what others think about this new module (/me not sure)
Line 21: 
Line 22: 
Line 23: SUCCESS = 0
Line 24: 


Line 24: 
Line 25: 
Line 26: class VdsProxy(object):
Line 27: 
Line 28:     def __init__(self):
Why not let vdscli guess if SSL is true or false?
Line 29:         self.vdscli = vdscli.connect(useSSL=False)
Line 30: 
Line 31:     def _get_net_args(self, vlan, bond, nics, opts):
Line 32:         if vlan is None:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3be71db9dc0b92c443b87e22fe06f920055c4d3
Gerrit-PatchSet: 8
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: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list