Giuseppe Vallarelli has uploaded a new change for review.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
tests: setupNetworks convertVlanNetBridgeness, Mtus
Added a couple of functional tests:
* testSetupNetworksConvertVlanNetBridgeness covering behavior of converstion of a network from bridged to bridgeless and viceversa.
* testSetupNetworksMtus covering behaviour of setupNetworks when used with different mtus.
Change-Id: Ib8723b066228729807f7ab46c9fabad3ebff128b Signed-off-by: Giuseppe Vallarelli gvallare@redhat.com --- M tests/functional/networkTests.py 1 file changed, 102 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/17866/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index 0492189..2b0758d 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -343,3 +343,105 @@ nics=nics, opts={'bridged': bridged}) self.assertEqual(status, neterrors.ERR_BAD_BRIDGE, msg) + + @RequireDummyMod + @ValidateRunningAsRoot + def testSetupNetworksConvertVlanNetBridgeness(self): + "Convert a bridged networks to a bridgeless one and viceversa" + opts = {'connectivityCheck': False} + + def setupNetworkBridged(nic, bridged, opts=opts): + networks = {NETWORK_NAME: dict(vlan=VLAN_ID, + nic=nic, bridged=bridged)} + status, msg = self.vdsm_net.setupNetworks(networks, {}, + opts) + self.assertEqual(status, SUCCESS, msg) + self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME, bridged)) + + with dummyIf(1) as nics: + setupNetworkBridged(nics[0], True) + setupNetworkBridged(nics[0], False) + setupNetworkBridged(nics[0], True) + + status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME: + dict(remove=True)}, + {}, opts) + + self.assertEqual(status, SUCCESS, msg) + + @permutations([[True], [False]]) + @RequireDummyMod + @ValidateRunningAsRoot + def testSetupNetworksMtus(self, bridged): + JUMBO = '9000' + MIDI = '4000' + + def assertMtu(mtu, *elems): + for elem in elems: + self.assertEquals(mtu, self.vdsm_net.getMtu(elem)) + + with dummyIf(3) as nics: + with self.vdsm_net.pinger(): + networks = {NETWORK_NAME + '1': + dict(bonding=BONDING_NAME, bridged=bridged, + vlan='100'), + NETWORK_NAME + '2': + dict(bonding=BONDING_NAME, bridged=bridged, + vlan='200', mtu=MIDI) + } + bondings = {BONDING_NAME: dict(nics=[nics[0], nics[1]])} + elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] + status, msg = self.vdsm_net.setupNetworks(networks, bondings, + {}) + + self.assertEquals(status, SUCCESS, msg) + + assertMtu(MIDI, *elems) + + network = {NETWORK_NAME + '3': + dict(bonding=BONDING_NAME, vlan='300', mtu=JUMBO, + bridged=bridged)} + elems = [NETWORK_NAME + '3', BONDING_NAME, nics[0], nics[1]] + status, msg = self.vdsm_net.setupNetworks(network, {}, {}) + + self.assertEquals(status, SUCCESS, msg) + + self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME + '3', + bridged=bridged)) + assertMtu(JUMBO, *elems) + + elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] + status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '3': + dict(remove=True)}, + {}, {}) + + self.assertEquals(status, SUCCESS, msg) + + assertMtu(MIDI, *elems) + + # Keep last custom MTU on the interfaces + elems = [BONDING_NAME, nics[0], nics[1]] + status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '2': + dict(remove=True)}, + {}, {}) + + self.assertEquals(status, SUCCESS, msg) + + assertMtu(MIDI, *elems) + + # Add additional nic to the bond + elems = [BONDING_NAME, nics[0], nics[1], nics[2]] + status, msg = self.vdsm_net.setupNetworks({}, {BONDING_NAME: + dict(nics=nics)}, {}) + + self.assertEquals(status, SUCCESS, msg) + + assertMtu(MIDI, *elems) + + status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '1': + dict(remove=True)}, + {BONDING_NAME: + dict(remove=True)}, + {}) + + self.assertEquals(status, SUCCESS, msg)
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1: Verified+1
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3822/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3739/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/2931/ : FAILURE
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1:
Jenkins failure unrelated to my patch *sigh*
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1: -Verified
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3830/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3747/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/2941/ : SUCCESS
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1:
Ready to go :-)
Antoni Segura Puimedon has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 1: Code-Review-1
(8 comments)
.................................................... File tests/functional/networkTests.py Line 388: NETWORK_NAME + '2': Line 389: dict(bonding=BONDING_NAME, bridged=bridged, Line 390: vlan='200', mtu=MIDI) Line 391: } Line 392: bondings = {BONDING_NAME: dict(nics=[nics[0], nics[1]])} nics[:2] Line 393: elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] Line 394: status, msg = self.vdsm_net.setupNetworks(networks, bondings, Line 395: {}) Line 396:
Line 389: dict(bonding=BONDING_NAME, bridged=bridged, Line 390: vlan='200', mtu=MIDI) Line 391: } Line 392: bondings = {BONDING_NAME: dict(nics=[nics[0], nics[1]])} Line 393: elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] delete Line 394: status, msg = self.vdsm_net.setupNetworks(networks, bondings, Line 395: {}) Line 396: Line 397: self.assertEquals(status, SUCCESS, msg)
Line 395: {}) Line 396: Line 397: self.assertEquals(status, SUCCESS, msg) Line 398: Line 399: assertMtu(MIDI, *elems) assertMtu(MIDI, NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]) Line 400: Line 401: network = {NETWORK_NAME + '3': Line 402: dict(bonding=BONDING_NAME, vlan='300', mtu=JUMBO, Line 403: bridged=bridged)}
Line 407: self.assertEquals(status, SUCCESS, msg) Line 408: Line 409: self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME + '3', Line 410: bridged=bridged)) Line 411: assertMtu(JUMBO, *elems) or rather just: assertMtu(JUMBO, NETWORK_NAME + '3', BONDING_NAME, nics[0], nics[1]) you're not reusing elems anyway. Line 412: Line 413: elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] Line 414: status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '3': Line 415: dict(remove=True)},
Line 409: self.assertTrue(self.vdsm_net.networkExists(NETWORK_NAME + '3', Line 410: bridged=bridged)) Line 411: assertMtu(JUMBO, *elems) Line 412: Line 413: elems = [NETWORK_NAME + '2', BONDING_NAME, nics[0], nics[1]] move to 430. Line 414: status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '3': Line 415: dict(remove=True)}, Line 416: {}, {}) Line 417:
Line 426: {}, {}) Line 427: Line 428: self.assertEquals(status, SUCCESS, msg) Line 429: Line 430: assertMtu(MIDI, *elems) same as 411. Line 431: Line 432: # Add additional nic to the bond Line 433: elems = [BONDING_NAME, nics[0], nics[1], nics[2]] Line 434: status, msg = self.vdsm_net.setupNetworks({}, {BONDING_NAME:
Line 429: Line 430: assertMtu(MIDI, *elems) Line 431: Line 432: # Add additional nic to the bond Line 433: elems = [BONDING_NAME, nics[0], nics[1], nics[2]] same. Line 434: status, msg = self.vdsm_net.setupNetworks({}, {BONDING_NAME: Line 435: dict(nics=nics)}, {}) Line 436: Line 437: self.assertEquals(status, SUCCESS, msg)
Line 435: dict(nics=nics)}, {}) Line 436: Line 437: self.assertEquals(status, SUCCESS, msg) Line 438: Line 439: assertMtu(MIDI, *elems) add from 433. Line 440: Line 441: status, msg = self.vdsm_net.setupNetworks({NETWORK_NAME + '1': Line 442: dict(remove=True)}, Line 443: {BONDING_NAME:
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 2: Verified+1
Fixed the 'stylistic' issue no intermediate lists are now present.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3840/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3757/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/2951/ : SUCCESS
Antoni Segura Puimedon has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 2: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 2: Code-Review+2
Escalated.
Dan Kenigsberg has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 2: Code-Review-1
Debase required.
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 3: Verified+1
Rebased.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3912/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3829/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3023/ : SUCCESS
Antoni Segura Puimedon has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 3: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 3: Code-Review+2
Dan Kenigsberg has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 3: Code-Review-1
Not again :-(
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4160/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3265/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4081/ : SUCCESS
Giuseppe Vallarelli has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 4:
Rebased at the moment a test is failing testSetupNetworksMtus... Used to work before.
Dan Kenigsberg has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 5: Verified+1 Code-Review+2
copy score after a manual rebase + fixup of whitespace noise.
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
tests: setupNetworks convertVlanNetBridgeness, Mtus
Added a couple of functional tests:
* testSetupNetworksConvertVlanNetBridgeness covering behavior of converstion of a network from bridged to bridgeless and viceversa.
* testSetupNetworksMtus covering behaviour of setupNetworks when used with different mtus.
Change-Id: Ib8723b066228729807f7ab46c9fabad3ebff128b Signed-off-by: Giuseppe Vallarelli gvallare@redhat.com Reviewed-on: http://gerrit.ovirt.org/17866 Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com --- M tests/functional/networkTests.py 1 file changed, 101 insertions(+), 0 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: tests: setupNetworks convertVlanNetBridgeness, Mtus ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4235/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3340/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4156/ : SUCCESS
vdsm-patches@lists.fedorahosted.org