# let's check that objdump likes the resulting file
subprocess.check_output(['objdump', '-h', output])
+ shutil.rmtree(tmp_path)
+
def test_sections(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
for sect in 'text osrel cmdline linux initrd uname test'.split():
assert re.search(fr'^\s*\d+\s+\.{sect}\s+[0-9a-f]+', dump, re.MULTILINE)
+ shutil.rmtree(tmp_path)
+
def test_addon(tmp_path):
output = f'{tmp_path}/addon.efi'
args = [
assert 'Signature verification OK' in dump
+ shutil.rmtree(tmp_path)
+
def test_efi_signing_pesign(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
assert f"The signer's common name is {author}" in dump
+ shutil.rmtree(tmp_path)
+
def test_inspect(kernel_initrd, tmp_path, capsys):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
expected_linux = '.linux:\n size:'
assert expected_linux in text
+ shutil.rmtree(tmp_path)
def test_pcr_signing(kernel_initrd, tmp_path):
if kernel_initrd is None:
assert list(sig.keys()) == ['sha1']
assert len(sig['sha1']) == 4 # four items for four phases
+ shutil.rmtree(tmp_path)
+
def test_pcr_signing2(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
assert list(sig.keys()) == ['sha1']
assert len(sig['sha1']) == 6 # six items for six phases paths
+ shutil.rmtree(tmp_path)
+
def test_key_cert_generation(tmp_path):
opts = ukify.parse_args([
'genkey',