Petr Horáček has uploaded a new change for review.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
tests: network: when using bonding, attach at least 2 slaves
In some tests we attach just one slave to a bonding, it works with native linux bonding, but does not allow us to use existing for OVS bonding.
Change-Id: I1763bc3409aa7da91dcd2e3b21dd8540870138ef Signed-off-by: Petr Horacek phoracek@redhat.com --- M tests/functional/networkTests.py 1 file changed, 34 insertions(+), 26 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/40/41840/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index 5702580..352c7c6 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -585,7 +585,7 @@ @cleanupNet @permutations([[True], [False]]) def testFailWithInvalidBondingName(self, bridged): - with dummyIf(1) as nics: + with dummyIf(2) as nics: invalid_bond_names = ('bond', 'bonda', 'bond0a', 'jamesbond007') for bond_name in invalid_bond_names: status, msg = self.vdsm_net.addNetwork(NETWORK_NAME, @@ -690,7 +690,7 @@ VLAN_COUNT = 5 NET_VLANS = [(NETWORK_NAME + str(index), str(index)) for index in range(VLAN_COUNT)] - with dummyIf(1) as nics: + with dummyIf(2) as nics: firstVlan, firstVlanId = NET_VLANS[0] status, msg = self.vdsm_net.addNetwork(firstVlan, vlan=firstVlanId, bond=BONDING_NAME, @@ -719,7 +719,7 @@ @cleanupNet @permutations([[True], [False]]) def testAddNetworkVlanBond(self, bridged): - with dummyIf(1) as nics: + with dummyIf(2) as nics: vlan_id = '42' status, msg = self.vdsm_net.addNetwork(NETWORK_NAME, vlan=vlan_id, @@ -759,7 +759,7 @@ @permutations([[True], [False]]) def testDelNetworkWithMTU(self, bridged): MTU = '1234' - with dummyIf(1) as nics: + with dummyIf(2) as nics: status, msg = self.vdsm_net.addNetwork(NETWORK_NAME, vlan=VLAN_ID, bond=BONDING_NAME, nics=nics, @@ -1334,7 +1334,7 @@
@cleanupNet def testDelNetworkBondAccumulation(self): - with dummyIf(1) as nics: + with dummyIf(2) as nics: for bigBond in ('bond555', 'bond666', 'bond777'): status, msg = self.vdsm_net.addNetwork(NETWORK_NAME, VLAN_ID, bigBond, nics) @@ -1352,15 +1352,15 @@ @cleanupNet @permutations([[True], [False]]) def testSetupNetworksResizeBond(self, bridged): - with dummyIf(3) as nics: + with dummyIf(4) as nics: with self.vdsm_net.pinger(): - bondings = {BONDING_NAME: dict(nics=nics[:1], + bondings = {BONDING_NAME: dict(nics=nics[:2], bridged=bridged)} status, msg = self.vdsm_net.setupNetworks({}, bondings, {})
self.assertEquals(status, SUCCESS, msg)
- self.assertBondExists(BONDING_NAME, nics=nics[:1]) + self.assertBondExists(BONDING_NAME, nics=nics[:2])
# Increase bond size bondings[BONDING_NAME]['nics'] = nics @@ -1372,14 +1372,14 @@
# Reduce bond size REQMODE_BROADCAST = '3' - bondings[BONDING_NAME]['nics'] = nics[:2] + bondings[BONDING_NAME]['nics'] = nics[:3] bondings[BONDING_NAME]['options'] = ('mode=%s' % REQMODE_BROADCAST) status, msg = self.vdsm_net.setupNetworks({}, bondings, {})
self.assertEquals(status, SUCCESS, msg)
- self.assertBondExists(BONDING_NAME, nics[:2], + self.assertBondExists(BONDING_NAME, nics[:3], bondings[BONDING_NAME]['options'])
bondings = {BONDING_NAME: dict(remove=True)} @@ -2079,7 +2079,7 @@ @permutations([[True], [False]]) @cleanupNet def testSetupNetworksEmergencyDevicesCleanupVlanOverwrite(self, bridged): - with dummyIf(1) as nics: + with dummyIf(2) as nics: nic, = nics network = {NETWORK_NAME: {'vlan': VLAN_ID, 'bridged': bridged, 'nic': nic}} @@ -2104,7 +2104,7 @@ @permutations([[True], [False]]) @cleanupNet def testSetupNetworksEmergencyDevicesCleanupBondOverwrite(self, bridged): - with dummyIf(1) as nics: + with dummyIf(2) as nics: nic, = nics network = {NETWORK_NAME: {'bridged': bridged, 'bonding': BONDING_NAME}} @@ -2232,7 +2232,7 @@
@cleanupNet def testSetupNetworksRemoveSlavelessBond(self): - with dummyIf(1) as nics: + with dummyIf(2) as nics: status, msg = self.vdsm_net.setupNetworks( {NETWORK_NAME: {'bonding': BONDING_NAME, 'bridged': False}}, @@ -2241,9 +2241,9 @@ self.assertNetworkExists(NETWORK_NAME) self.assertBondExists(BONDING_NAME, nics)
- nic, = nics with open(BONDING_SLAVES % BONDING_NAME, 'w') as f: - f.write('-%s\n' % nic) + for nic in nics: + f.write('-%s\n' % nic)
status, msg = self.vdsm_net.setupNetworks( {NETWORK_NAME: {'remove': True}}, @@ -2281,19 +2281,20 @@ raise SkipTest( "with ifcfg persistence, vdsm-restore-net-config " "doesn't restore in-kernel state") - with dummyIf(1) as (nic, ): + with dummyIf(2) as nics: with open(BONDING_MASTERS, 'w') as bonds: bonds.write('+%s\n' % BONDING_NAME) try: with open(BONDING_SLAVES % BONDING_NAME, 'w') as f: - f.write('+%s\n' % nic) + for nic in nics: + f.write('+%s\n' % nic) status, msg = self.vdsm_net.setupNetworks( {NETWORK_NAME: {'bonding': BONDING_NAME, 'bridged': False}}, - {BONDING_NAME: {'nics': [nic]}}, NOCHK) + {BONDING_NAME: {'nics': nics}}, NOCHK) self.assertEqual(status, SUCCESS, msg) self.assertNetworkExists(NETWORK_NAME) - self.assertBondExists(BONDING_NAME, [nic]) + self.assertBondExists(BONDING_NAME, nics) finally: with open(BONDING_MASTERS, 'w') as bonds: bonds.write('-%s\n' % BONDING_NAME) @@ -2302,27 +2303,34 @@ self.vdsm_net.restoreNetConfig()
self.assertNetworkExists(NETWORK_NAME) - self.assertBondExists(BONDING_NAME, [nic]) + self.assertBondExists(BONDING_NAME, nics)
status, msg = self.vdsm_net.setupNetworks( {NETWORK_NAME: {'remove': True}}, {BONDING_NAME: {'remove': True}}, NOCHK) self.assertEqual(status, SUCCESS, msg) self.assertNetworkDoesntExist(NETWORK_NAME) - self.assertBondDoesntExist(BONDING_NAME, [nic]) + self.assertBondDoesntExist(BONDING_NAME, nics) self.vdsm_net.save_config()
@cleanupNet @ValidateRunningAsRoot def test_setupNetworks_on_external_vlaned_bond(self): - with dummyIf(1) as (nic, ): - with open(NET_CONF_PREF + nic, 'w') as f: + with dummyIf(2) as nics: + with open(NET_CONF_PREF + nics[0], 'w') as f: f.write("""DEVICE=%s MASTER=%s SLAVE=yes ONBOOT=yes MTU=1500 -NM_CONTROLLED=no""" % (nic, BONDING_NAME)) +NM_CONTROLLED=no""" % (nics[0], BONDING_NAME)) + with open(NET_CONF_PREF + nics[1], 'w') as f: + f.write("""DEVICE=%s +MASTER=%s +SLAVE=yes +ONBOOT=yes +MTU=1500 +NM_CONTROLLED=no""" % (nics[1], BONDING_NAME)) with open(NET_CONF_PREF + BONDING_NAME, 'w') as f: f.write("""DEVICE=%s BONDING_OPTS='mode=802.3ad miimon=150' @@ -2354,7 +2362,7 @@ self.vdsm_net.restoreNetConfig()
self.assertNetworkExists(NETWORK_NAME) - self.assertBondExists(BONDING_NAME, [nic]) + self.assertBondExists(BONDING_NAME, nics) self.assertVlanExists(BONDING_NAME + '.' + VLAN_ID)
status, msg = self.vdsm_net.setupNetworks( @@ -2362,5 +2370,5 @@ {BONDING_NAME: {'remove': True}}, NOCHK) self.assertEqual(status, SUCCESS, msg) self.assertNetworkDoesntExist(NETWORK_NAME) - self.assertBondDoesntExist(BONDING_NAME, [nic]) + self.assertBondDoesntExist(BONDING_NAME, nics) self.vdsm_net.save_config()
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Petr Horáček has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 1: Verified+1
Passed functional tests without a regression. I also run tests with 'raise Exception' in models.py in case when bonding has less than 2 slaves, it passed ok as well.
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 2:
needs a manual rebase, I presume
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 3: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 4: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Petr Horáček has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 5: Verified+1
Passes functional network tests and net* unit tests without a regression.
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 6:
* update_tracker: OK * Check Bug-Url::OK * Check Public Bug::#1234867::OK, public bug * Check Product::#1234867::OK, Correct product oVirt * Check TR::SKIP, not in a monitored branch (ovirt-3.5 ovirt-3.4 ovirt-3.3 ovirt-3.2) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
tests: network: when using bonding, attach at least 2 slaves
In some tests we attach just one slave to a bonding, it works with native linux bonding, but does not allow us to use existing for OVS bonding.
Change-Id: I1763bc3409aa7da91dcd2e3b21dd8540870138ef Signed-off-by: Petr Horacek phoracek@redhat.com Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1234867 Reviewed-on: https://gerrit.ovirt.org/41840 Reviewed-by: Dan Kenigsberg danken@redhat.com Continuous-Integration: Jenkins CI --- M tests/functional/networkTests.py 1 file changed, 34 insertions(+), 26 deletions(-)
Approvals: Jenkins CI: Passed CI tests Petr Horáček: Verified Dan Kenigsberg: Looks good to me, approved
automation@ovirt.org has posted comments on this change.
Change subject: tests: network: when using bonding, attach at least 2 slaves ......................................................................
Patch Set 7:
* Update tracker::#1234867::OK * Set MODIFIED::bug 1234867::::#1234867::::IGNORE, not all related patches are closed, check 43149
vdsm-patches@lists.fedorahosted.org