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
sebres 2017-11-28 16:13:37 +01:00
parent b62ab2d51e
commit 55c2a9968a
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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")