]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test_ukify: no stinky root needed for signing
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Jun 2023 10:18:56 +0000 (12:18 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Jun 2023 13:41:04 +0000 (15:41 +0200)
C.f. b2efe286587e11e2aa4a6c7e4a2c15da3bb58a2a.

src/ukify/test/test_ukify.py

index ab89e11b73d0b723f3460d585c28eda27ad093f2..05e2668d5493095e054db6e755a3adee4eae2761 100755 (executable)
@@ -501,10 +501,6 @@ def test_efi_signing_pesign(kernel_initrd, tmpdir):
 def test_pcr_signing(kernel_initrd, tmpdir):
     if kernel_initrd is None:
         pytest.skip('linux+initrd not found')
-    if os.getuid() != 0:
-        pytest.skip('must be root to access tpm2')
-    if subprocess.call(['systemd-creds', 'has-tpm2', '-q']) != 0:
-        pytest.skip('tpm2 is not available')
 
     ourdir = pathlib.Path(__file__).parent
     pub = unbase64(ourdir / 'example.tpm2-pcr-public.pem.base64')
@@ -562,10 +558,6 @@ def test_pcr_signing(kernel_initrd, tmpdir):
 def test_pcr_signing2(kernel_initrd, tmpdir):
     if kernel_initrd is None:
         pytest.skip('linux+initrd not found')
-    if os.getuid() != 0:
-        pytest.skip('must be root to access tpm2')
-    if subprocess.call(['systemd-creds', 'has-tpm2', '-q']) != 0:
-        pytest.skip('tpm2 is not available')
 
     ourdir = pathlib.Path(__file__).parent
     pub = unbase64(ourdir / 'example.tpm2-pcr-public.pem.base64')