summaryrefslogtreecommitdiffstatshomepage
path: root/tests/test_nvpcr_masks.py
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-30 08:54:59 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-30 08:54:59 +0100
commitc1f7133be790a972400ba63ca40f92ed699d216e (patch)
tree12e36f95ff1e87998c1028a6e2c3242cad32aa3a /tests/test_nvpcr_masks.py
parent76db86a22a23ccfed07d6160cfdab4ef60067ef0 (diff)
downloaddotfiles-c1f7133be790a972400ba63ca40f92ed699d216e.tar.gz
dotfiles-c1f7133be790a972400ba63ca40f92ed699d216e.tar.bz2
dotfiles-c1f7133be790a972400ba63ca40f92ed699d216e.zip
Enable signed initrd and NvPCR measurements
Diffstat (limited to 'tests/test_nvpcr_masks.py')
-rw-r--r--tests/test_nvpcr_masks.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/test_nvpcr_masks.py b/tests/test_nvpcr_masks.py
deleted file mode 100644
index b2ec429..0000000
--- a/tests/test_nvpcr_masks.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import subprocess
-import unittest
-from pathlib import Path
-
-ROOT = Path(__file__).resolve().parents[1]
-MASKS = [
- *(
- f"etc/nvpcr/{name}.nvpcr"
- for name in ("cryptsetup", "hardware", "login", "verity")
- ),
- "etc/systemd/system/systemd-pcrlogin@.service",
- "etc/systemd/system/systemd-pcrproduct.service",
-]
-
-
-class NvPCRTests(unittest.TestCase):
- def test_masks_are_empty_regular_files(self):
- for name in MASKS:
- path = ROOT / name
- self.assertFalse(path.is_symlink())
- self.assertEqual(path.read_bytes(), b"")
-
- def test_initramfs_keeps_existing_files_and_includes_masks(self):
- config = ROOT / "etc/mkinitcpio.conf.d/60-no-nvpcr.conf"
- output = subprocess.check_output(
- [
- "bash",
- "-c",
- 'FILES=(existing); source "$1"; printf "%s\\n" "${FILES[@]}"',
- "bash",
- str(config),
- ],
- text=True,
- ).splitlines()
- self.assertEqual(output, ["existing", *(f"/{name}" for name in MASKS)])
-
- def test_srk_setup_and_pcr7_policy_remain_enabled(self):
- for name in ("systemd-tpm2-setup.service", "systemd-tpm2-setup-early.service"):
- self.assertFalse((ROOT / "etc/systemd/system" / name).exists())
- policy = (
- ROOT / "etc/systemd/system/systemd-pcrlock-make-policy.service.d/pcr7.conf"
- )
- self.assertIn("--pcr=7 --location=770", policy.read_text())