summaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-07-08 01:31:25 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-07-08 01:31:25 +0000
commitcead9a3d0571b8afc5ed680475e9bc3ea92c7d79 (patch)
tree7815463e32d54a69cf8f406dd94452638e3716a0 /testcases/testcase.py
parent26a7262cee1a2961ed5aa76bd969dddeff8ea472 (diff)
parentfc09b7f0b6e036651fd4c101d9b8492c4cccfe0c (diff)
Merge "Namespace_veth: Add funtionality for network namespace, veth ports"
Diffstat (limited to 'testcases/testcase.py')
-rw-r--r--testcases/testcase.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py
index e5f8a14c..5f5c9358 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -234,6 +234,26 @@ class TestCase(object):
# restore original settings
S.load_from_dict(self._settings_original)
+ # cleanup any namespaces created
+ if os.path.isdir('/tmp/namespaces'):
+ import tools.namespace
+ namespace_list = os.listdir('/tmp/namespaces')
+ if len(namespace_list):
+ self._logger.info('Cleaning up namespaces')
+ for name in namespace_list:
+ tools.namespace.delete_namespace(name)
+ os.rmdir('/tmp/namespaces')
+ # cleanup any veth ports created
+ if os.path.isdir('/tmp/veth'):
+ import tools.veth
+ veth_list = os.listdir('/tmp/veth')
+ if len(veth_list):
+ self._logger.info('Cleaning up veth ports')
+ for eth in veth_list:
+ port1, port2 = eth.split('-')
+ tools.veth.del_veth_port(port1, port2)
+ os.rmdir('/tmp/veth')
+
def run_report(self):
""" Report test results
"""