Commit 9eb3c010 authored by Tom Niget's avatar Tom Niget

Cleanup temp net folder between tests

parent 49ed54d8
...@@ -29,12 +29,12 @@ class TestRegistryClientInteract(unittest.TestCase): ...@@ -29,12 +29,12 @@ class TestRegistryClientInteract(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
re6st_wrap.initial()
# if running in net ns, set lo up # if running in net ns, set lo up
subprocess.check_call(("ip", "link", "set", "lo", "up")) subprocess.check_call(("ip", "link", "set", "lo", "up"))
def setUp(self): def setUp(self):
re6st_wrap.initial()
self.port = 18080 self.port = 18080
self.url = "http://localhost:{}/".format(self.port) self.url = "http://localhost:{}/".format(self.port)
# not important, used in network_config check # not important, used in network_config check
......
...@@ -27,8 +27,9 @@ RE6ST_CONF = f"{sys.executable} -m re6st.cli.conf" ...@@ -27,8 +27,9 @@ RE6ST_CONF = f"{sys.executable} -m re6st.cli.conf"
def initial(): def initial():
"""create the workplace""" """create the workplace"""
if not WORK_DIR.exists(): if WORK_DIR.exists():
WORK_DIR.mkdir() shutil.rmtree(str(WORK_DIR))
WORK_DIR.mkdir()
def ip_to_serial(ip6): def ip_to_serial(ip6):
"""convert ipv6 address to serial""" """convert ipv6 address to serial"""
......
...@@ -83,6 +83,8 @@ class TestNet(unittest.TestCase): ...@@ -83,6 +83,8 @@ class TestNet(unittest.TestCase):
def setUpClass(cls): def setUpClass(cls):
"""create work dir""" """create work dir"""
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
def setUp(self):
re6st_wrap.initial() re6st_wrap.initial()
@classmethod @classmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment