mirror of https://github.com/fail2ban/fail2ban
clean all after test setup (removes a build directory in current root of fail2ban)
parent
7d4f071d4b
commit
a71a64733a
|
@ -68,6 +68,7 @@ class SetupTest(unittest.TestCase):
|
||||||
def testSetupInstallRoot(self):
|
def testSetupInstallRoot(self):
|
||||||
if not self.setup: return # if verbose skip didn't work out
|
if not self.setup: return # if verbose skip didn't work out
|
||||||
tmp = tempfile.mkdtemp()
|
tmp = tempfile.mkdtemp()
|
||||||
|
try:
|
||||||
os.system("%s %s install --root=%s >/dev/null"
|
os.system("%s %s install --root=%s >/dev/null"
|
||||||
% (sys.executable, self.setup, tmp))
|
% (sys.executable, self.setup, tmp))
|
||||||
|
|
||||||
|
@ -108,9 +109,12 @@ class SetupTest(unittest.TestCase):
|
||||||
'etc/fail2ban/jail.conf'):
|
'etc/fail2ban/jail.conf'):
|
||||||
self.assertTrue(os.path.exists(os.path.join(tmp, f)),
|
self.assertTrue(os.path.exists(os.path.join(tmp, f)),
|
||||||
msg="Can't find %s" % f)
|
msg="Can't find %s" % f)
|
||||||
|
finally:
|
||||||
# clean up
|
# clean up
|
||||||
shutil.rmtree(tmp)
|
shutil.rmtree(tmp)
|
||||||
|
# remove build directory
|
||||||
|
os.system("%s %s clean --all >/dev/null"
|
||||||
|
% (sys.executable, self.setup))
|
||||||
|
|
||||||
class TestsUtilsTest(unittest.TestCase):
|
class TestsUtilsTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue