mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-devtest
synced 2026-01-15 10:23:32 +01:00
os.CmdTestOs: Add support for --phases argument
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
174286e3cc
commit
3fba1c2a89
1 changed files with 8 additions and 4 deletions
|
|
@ -94,7 +94,9 @@ class CmdTestOs(MachineCmd): # export
|
|||
machine = await Machine.create(env)
|
||||
case_filter = None if not env.args.cases else env.args.cases.split(',')
|
||||
test_cases = TestCases(env.args.test_case_path, include=case_filter, dummies=env.args.dummy_tests)
|
||||
for phase in TestPhases.Phase:
|
||||
phases = TestPhases.parse(env.args.phases)
|
||||
slog(INFO, "Running phases: {}".format(', '.join([p.name for p in phases])))
|
||||
for phase in phases:
|
||||
if not machine.clear_for_tests():
|
||||
raise Exception("machine is not clear for running tests")
|
||||
delim = '-' * 60 + " Phase {} -- ".format(phase.name)
|
||||
|
|
@ -118,8 +120,9 @@ class CmdTestOs(MachineCmd): # export
|
|||
raise
|
||||
finally:
|
||||
if machine is not None:
|
||||
await machine.request_shutdown(env)
|
||||
await machine.wait_poweroff(env)
|
||||
if TestPhases.Phase.Shutdown in phases:
|
||||
await machine.request_shutdown(env)
|
||||
await machine.wait_poweroff(env)
|
||||
await machine.cleanup(env)
|
||||
for conn in env.connections:
|
||||
if conn.instance:
|
||||
|
|
@ -136,6 +139,7 @@ class CmdTestOs(MachineCmd): # export
|
|||
|
||||
def add_parser(self, parsers):
|
||||
p = super().add_parser(parsers)
|
||||
p.add_argument( "--cases", help="List of dedicated test cases to run, wildcards are supported", default='')
|
||||
p.add_argument("--cases", help="List of dedicated test cases to run, wildcards are supported", default='')
|
||||
p.add_argument("--phases", help="List of phases the test should pass", default='all')
|
||||
self.__results.add_arguments(p)
|
||||
return p
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue