]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test_ukify: fix two failing tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Apr 2023 06:32:09 +0000 (08:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 May 2023 10:29:41 +0000 (12:29 +0200)
Fixup for 22ad038ac6e4fe5e4a68555f0e70bd0a16fb5616 and
3fc5eed47091363247012454df458e1a3303bf12. It seems that the tests are
not executed properly in CI. Nevertheless, test-ukify appears in logs:

rpm-build:fedora-rawhide-x86_64:
 409/1191 systemd / test-ukify    OK   0.16s

This is strange.

src/ukify/test/test_ukify.py

index 1f468906d313deef4f6a2a87142f3ef923907fed..7b9f855ff3ca8682d526a4006f7c7b0b20618928 100755 (executable)
@@ -91,7 +91,7 @@ def test_parse_args_many():
     assert opts.sb_key == 'SBKEY'
     assert opts.sb_cert == 'SBCERT'
     assert opts.sign_kernel is False
-    assert opts.tools == pathlib.Path('TOOLZ/')
+    assert opts.tools == [pathlib.Path('TOOLZ/')]
     assert opts.output == pathlib.Path('OUTPUT')
     assert opts.measure is False
 
@@ -109,13 +109,11 @@ def test_parse_sections():
     assert opts.sections[0].name == 'test'
     assert isinstance(opts.sections[0].content, pathlib.Path)
     assert opts.sections[0].tmpfile
-    assert opts.sections[0].offset is None
     assert opts.sections[0].measure is False
 
     assert opts.sections[1].name == 'test2'
     assert opts.sections[1].content == pathlib.Path('FILE')
     assert opts.sections[1].tmpfile is None
-    assert opts.sections[1].offset is None
     assert opts.sections[1].measure is False
 
 def test_help(capsys):
@@ -242,7 +240,6 @@ def test_uname_scraping(kernel_initrd):
     uname = ukify.Uname.scrape(kernel_initrd[0])
     assert re.match(r'\d+\.\d+\.\d+', uname)
 
-
 def test_efi_signing(kernel_initrd, tmpdir):
     if kernel_initrd is None:
         pytest.skip('linux+initrd not found')