test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
test_env.set('PATH', project_build_root + ':' + path)
test_env.set('PROJECT_BUILD_ROOT', project_build_root)
+test_env.set('SYSTEMD_SLOW_TESTS', slow_tests ? '1' : '0')
if efi_addon != ''
test_env.set('EFI_ADDON', efi_addon)
import ukify
build_root = os.getenv('PROJECT_BUILD_ROOT')
+try:
+ slow_tests = bool(int(os.getenv('SYSTEMD_SLOW_TESTS', '1')))
+except ValueError:
+ slow_tests = True
+
arg_tools = ['--tools', build_root] if build_root else []
def systemd_measure():
uname = ukify.Uname.scrape(kernel_initrd[1])
assert re.match(r'\d+\.\d+\.\d+', uname)
+@pytest.mark.skipif(not slow_tests, reason='slow')
@pytest.mark.parametrize("days", [365*10, None])
def test_efi_signing_sbsign(days, kernel_initrd, tmp_path):
if kernel_initrd is None:
shutil.rmtree(tmp_path)
+@pytest.mark.skipif(not slow_tests, reason='slow')
def test_efi_signing_pesign(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
uname_arg='1.2.3'
osrel_arg='Linux'
cmdline_arg='ARG1 ARG2 ARG3'
- opts = ukify.parse_args([
+
+ args = [
'build',
*kernel_initrd,
f'--cmdline={cmdline_arg}',
f'--os-release={osrel_arg}',
f'--uname={uname_arg}',
f'--output={output}',
- f'--secureboot-certificate={cert.name}',
- f'--secureboot-private-key={key.name}',
- ])
+ ]
+ if slow_tests:
+ args += [
+ f'--secureboot-certificate={cert.name}',
+ f'--secureboot-private-key={key.name}',
+ ]
+
+ opts = ukify.parse_args(args)
ukify.check_inputs(opts)
ukify.make_uki(opts)
shutil.rmtree(tmp_path)
+@pytest.mark.skipif(not slow_tests, reason='slow')
def test_pcr_signing(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')
shutil.rmtree(tmp_path)
+@pytest.mark.skipif(not slow_tests, reason='slow')
def test_pcr_signing2(kernel_initrd, tmp_path):
if kernel_initrd is None:
pytest.skip('linux+initrd not found')