cmd = [
measure_tool,
'calculate',
- *(f"--{s.name.removeprefix('.')}={s.content}" for s in to_measure.values()),
+ *(f'--{s.name.removeprefix(".")}={s.content}' for s in to_measure.values()),
*(f'--bank={bank}' for bank in banks),
# For measurement, the keys are not relevant, so we can lump all the phase paths
# into one call to systemd-measure calculate.
cmd = [
measure_tool,
'sign',
- *(f"--{s.name.removeprefix('.')}={s.content}" for s in to_measure.values()),
+ *(f'--{s.name.removeprefix(".")}={s.content}' for s in to_measure.values()),
*(f'--bank={bank}' for bank in banks),
]
os.umask(umask := os.umask(0))
os.chmod(opts.output, 0o777 & ~umask)
- print(f"Wrote {'signed' if sign_args_present else 'unsigned'} {opts.output}")
+ print(f'Wrote {"signed" if sign_args_present else "unsigned"} {opts.output}')
@contextlib.contextmanager
dropin += textwrap.dedent(
f"""
[Service]
- Environment=TEST_MATCH_SUBTEST={os.environ["TEST_MATCH_SUBTEST"]}
+ Environment=TEST_MATCH_SUBTEST={os.environ['TEST_MATCH_SUBTEST']}
"""
)
dropin += textwrap.dedent(
f"""
[Service]
- Environment=TEST_MATCH_TESTCASE={os.environ["TEST_MATCH_TESTCASE"]}
+ Environment=TEST_MATCH_TESTCASE={os.environ['TEST_MATCH_TESTCASE']}
"""
)
ops += [f'journalctl --file {journal_file} --no-hostname -o short-monotonic -u {args.unit} -p info']
- print("Test failed, relevant logs can be viewed with: \n\n" f"{(' && '.join(ops))}\n", file=sys.stderr)
+ print(f'Test failed, relevant logs can be viewed with: \n\n{(" && ".join(ops))}\n', file=sys.stderr)
# 0 also means we failed so translate that to a non-zero exit code to mark the test as failed.
exit(result.returncode or 1)