From c06084d7d98ccd8a7ce28d18fc0f81402fc9752d Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 28 Nov 2016 11:04:37 +0100 Subject: [PATCH] _start_params - fix: symlinks should be absolute paths --- fail2ban/tests/fail2banclienttestcase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fail2ban/tests/fail2banclienttestcase.py b/fail2ban/tests/fail2banclienttestcase.py index b64ecb38..e6cc46cb 100644 --- a/fail2ban/tests/fail2banclienttestcase.py +++ b/fail2ban/tests/fail2banclienttestcase.py @@ -138,8 +138,8 @@ def _start_params(tmp, use_stock=False, logtarget="/dev/null", db=":memory:"): """Filters list of 'files' to contain only directories (under dir)""" return [f for f in files if isdir(pjoin(dir, f))] shutil.copytree(STOCK_CONF_DIR, cfg, ignore=ig_dirs) - os.symlink(pjoin(STOCK_CONF_DIR, "action.d"), pjoin(cfg, "action.d")) - os.symlink(pjoin(STOCK_CONF_DIR, "filter.d"), pjoin(cfg, "filter.d")) + os.symlink(os.path.abspath(pjoin(STOCK_CONF_DIR, "action.d")), pjoin(cfg, "action.d")) + os.symlink(os.path.abspath(pjoin(STOCK_CONF_DIR, "filter.d")), pjoin(cfg, "filter.d")) # replace fail2ban params (database with memory): r = re.compile(r'^dbfile\s*=') for line in fileinput.input(pjoin(cfg, "fail2ban.conf"), inplace=True): @@ -424,7 +424,7 @@ class Fail2banClientTest(Fail2banClientServerBase): self.execSuccess(startparams, "-vvd") self.assertLogged("Loading files") self.assertLogged("logtarget") - + @with_tmpdir @with_kill_srv def testClientStartBackgroundInside(self, tmp):