]> git.ipfire.org Git - thirdparty/systemd.git/commit
tests: add pytest tests for ukify
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 25 Nov 2022 16:21:40 +0000 (17:21 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Dec 2022 14:52:37 +0000 (15:52 +0100)
commita1d6dbb1c94685d7972f63ed2762fe4ba0251287
treed0dbeff3b4b24b7a093349f0612036ceba9a7072
parent30ec2eaef5f1e3c6639304316a12bf01a5cd7150
tests: add pytest tests for ukify

Some gymnastics were needed to import ukify as a module. Before the file
was templated, this was trivial: insert the directory in sys.path, call import.
But it's a real pain to import the unsuffixed file after processing. Instead,
the untemplated file is imported, which works well enough for tests and is
very simple.

The tests can be called via pytest:
  PATH=build/:$PATH pytest -v src/ukify/test/test_ukify.py
or directly:
  PATH=build/:$PATH src/ukify/test/test_ukify.py
or via the meson test machinery output:
  meson test -C build test-ukify -v
or without verbose output:
  meson test -C build test-ukify

Zekret files are obfuscated using base64.
meson.build
src/ukify/test/example.signing.crt.base64 [new file with mode: 0644]
src/ukify/test/example.signing.key.base64 [new file with mode: 0644]
src/ukify/test/example.tpm2-pcr-private.pem.base64 [new file with mode: 0644]
src/ukify/test/example.tpm2-pcr-private2.pem.base64 [new file with mode: 0644]
src/ukify/test/example.tpm2-pcr-public.pem.base64 [new file with mode: 0644]
src/ukify/test/example.tpm2-pcr-public2.pem.base64 [new file with mode: 0644]
src/ukify/test/meson.build [new file with mode: 0644]
src/ukify/test/setup.cfg [new file with mode: 0644]
src/ukify/test/test_ukify.py [new file with mode: 0755]