Commit 03af0f84 authored by Petr Špaček's avatar Petr Špaček

Merge branch 'keeplog' into 'master'

deckard: add option --noclean to keep working directory

See merge request !80
parents d43b0c89 12b96869
Pipeline #19877 passed with stage
in 1 minute and 22 seconds
......@@ -3,6 +3,7 @@ TESTS ?= sets/resolver
DAEMON ?= kresd
TEMPLATE ?= template/kresd.j2
CONFIG ?= config
OPTS ?=
PYTHON ?= python3
LIBEXT := .so
......@@ -45,7 +46,7 @@ depend: $(libfaketime) $(libcwrap)
# Generic rule to run test
$(SOURCES): depend
%.out: %.rpl
@$(preload_syms) $(PYTHON) $(abspath ./deckard.py) $< one $(DAEMON) $(TEMPLATE) $(CONFIG) -- $(ADDITIONAL)
@$(preload_syms) $(PYTHON) $(abspath ./deckard.py) $(OPTS) $< one $(DAEMON) $(TEMPLATE) $(CONFIG) -- $(ADDITIONAL)
# Synchronize submodules
submodules: .gitmodules
......
......@@ -308,7 +308,11 @@ def process_file(path, args, prog_cfgs):
template_ctx['ROOT_ADDR'],
template_ctx['_SOCKET_FAMILY'],
prog_under_test_ip)
shutil.rmtree(tmpdir)
if prog_cfgs.get('noclean'):
logging.getLogger('deckard.hint').info(
'test working directory %s', tmpdir)
else:
shutil.rmtree(tmpdir)
except:
logging.getLogger('deckard.hint').info(
'test failed, inspect working directory %s', tmpdir)
......@@ -403,6 +407,8 @@ def deckard():
action=EnvDefault, envvar='VERBOSE',
type=loglevel2number, required=False)
argparser.add_argument('scenario', help='path to test scenario')
argparser.add_argument('--noclean', action='store_true',
help='don\'t delete working directory')
subparsers = argparser.add_subparsers(
dest='cmd', title='sub-commands',
......@@ -456,7 +462,9 @@ def deckard():
'configs': args.configs,
'additional': args.additional,
'name': os.path.basename(args.binary),
}]}
}],
'noclean': args.noclean,
}
mandatory_keys = {'name', 'binary', 'templates', 'configs', 'additional'}
for cfg in config['programs']:
......
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