Antoni Segura Puimedon has uploaded a new change for review. Change subject: net_func_tests: add test for reconfiguring broken bridged network ......................................................................
net_func_tests: add test for reconfiguring broken bridged network This test checks that bridged networks with missing ports are successfully redefined on command. Change-Id: I1e1895d0b6724870f38529a3c04224103d60828d Signed-off-by: Antoni S. Puimedon <[email protected]> --- M tests/functional/networkTests.py 1 file changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/28529/1 diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index f528541..38c21fe 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -38,7 +38,8 @@ ruleExists, Route, Rule, addrFlush, LinkType, getLinks) -from vdsm.utils import RollbackContext +from vdsm.constants import EXT_BRCTL +from vdsm.utils import RollbackContext, execCmd from vdsm.netinfo import (bridges, operstate, prefix2netmask, getRouteDeviceTo, getDhclientIfaces) from vdsm import ipwrapper @@ -1891,6 +1892,37 @@ self.assertEqual(status, SUCCESS, msg) self.assertNetworkDoesntExist(NETWORK_NAME) + @cleanupNet + @RequireDummyMod + @ValidateRunningAsRoot + def testReconfigureBrNetWithVanishedPort(self): + """Test for re-defining a bridged network for which the device + providing connectivity to the bridge had been removed from it""" + with dummyIf(1) as nics: + nic, = nics + network = {NETWORK_NAME: {'nic': nic, 'bridged': True}} + status, msg = self.vdsm_net.setupNetworks(network, {}, NOCHK) + self.assertEqual(status, SUCCESS, msg) + self.assertNetworkExists(NETWORK_NAME) + + # Remove the nic from the bridge + execCmd([EXT_BRCTL, 'delif', NETWORK_NAME, nic]) + self.assertEqual(len( + self.vdsm_net.netinfo.networks[NETWORK_NAME]['ports']), 0) + + # Attempt to reconfigure the network + status, msg = self.vdsm_net.setupNetworks(network, {}, NOCHK) + self.assertEqual(status, SUCCESS, msg) + self.assertEqual( + self.vdsm_net.netinfo.networks[NETWORK_NAME]['ports'], [nic]) + + # cleanup + network[NETWORK_NAME] = {'remove': True} + status, msg = self.vdsm_net.setupNetworks(network, {}, + NOCHK) + self.assertEqual(status, SUCCESS, msg) + self.assertNetworkDoesntExist(NETWORK_NAME) + @RequireDummyMod @ValidateRunningAsRoot def testNoBridgeLeftovers(self): -- To view, visit http://gerrit.ovirt.org/28529 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e1895d0b6724870f38529a3c04224103d60828d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
