Antoni Segura Puimedon has uploaded a new change for review. Change subject: Cleanup networking functional tests dummy conf ......................................................................
Cleanup networking functional tests dummy conf Due to the fact that the dummies used for the functional tests are treated just like nics, ifcfg files for them remain after the functional tests are completed. This patch adds a module teardown action that restores the networking configuration file status previous to running the tests. Change-Id: I7ad2c1b17f6faf5ba12841a385c7eba72fa51d0b Signed-off-by: Antoni S. Puimedon <[email protected]> --- M tests/functional/networkTests.py M tests/functional/utils.py 2 files changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/16329/1 diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index c9392dd..de6be4f 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -22,7 +22,7 @@ expandPermutations, permutations) from testValidation import RequireDummyMod, ValidateRunningAsRoot -from utils import cleanupNet, dummyIf, VdsProxy, SUCCESS +from utils import cleanupNet, dummyIf, restoreNetConfig, SUCCESS, VdsProxy NETWORK_NAME = 'test-network' @@ -42,6 +42,9 @@ def setUp(self): self.vdsm_net = VdsProxy() + def teardown(self): + restoreNetConfig() + @cleanupNet @permutations([[True], [False]]) @RequireDummyMod diff --git a/tests/functional/utils.py b/tests/functional/utils.py index 557d679..87189ea 100644 --- a/tests/functional/utils.py +++ b/tests/functional/utils.py @@ -108,12 +108,16 @@ func(*args, **kwargs) except Exception: # cleanup - cmd_service = [service.cmd, "vdsm-restore-net-config", "start"] - utils.execCmd(cmd_service, sudo=True) + restoreNetConfig() raise return wrapper +def restoreNetConfig(): + cmd_service = [service.cmd, "vdsm-restore-net-config", "start"] + utils.execCmd(cmd_service, sudo=True) + + class VdsProxy(object): """ Vdscli wrapper to save tests -- To view, visit http://gerrit.ovirt.org/16329 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ad2c1b17f6faf5ba12841a385c7eba72fa51d0b 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
