mirror of https://github.com/fail2ban/fail2ban
remove lacking [Init] section check ([Init] section not necessary anymore for actions also);
fix sporadic error by shutdown server in with_foreground_server_thread decorator (if shutdown too fast, but end-phase still does not reached the tester-thread);pull/1974/head
parent
b62ab2d51e
commit
55c2a9968a
|
@ -623,8 +623,6 @@ class JailsReaderTest(LogCaptureTestCase):
|
|||
#print('****', actionName, opts.get('actionstart', ''))
|
||||
self.assertIn('f2b-TEST', opts.get('actionstart', ''),
|
||||
msg="Action file %r: interpolation of actionstart does not contains jail-name 'f2b-TEST'" % actionConfig)
|
||||
self.assertIn('Init', actionReader.sections(),
|
||||
msg="Action file %r is lacking [Init] section" % actionConfig)
|
||||
|
||||
def testReadStockJailConf(self):
|
||||
jails = JailsReader(basedir=CONFIG_DIR, share_config=CONFIG_DIR_SHARE_CFG) # we are running tests from root project dir atm
|
||||
|
|
|
@ -312,6 +312,9 @@ def with_foreground_server_thread(startextra={}):
|
|||
finally:
|
||||
DefLogSys.info('=== within server: end. ===')
|
||||
self.pruneLog()
|
||||
# if seems to be down - try to catch end phase (wait a bit for end:True to recognize down state):
|
||||
if not phase.get('end', None) and not os.path.exists(pjoin(tmp, "f2b.pid")):
|
||||
Utils.wait_for(lambda: phase.get('end', None) is not None, MID_WAITTIME)
|
||||
# stop (if still running):
|
||||
if not phase.get('end', None):
|
||||
self.execSuccess(startparams, "stop")
|
||||
|
|
Loading…
Reference in New Issue