aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-26 19:23:15 -0500
committerCraig Jennings <c@cjennings.net>2026-04-26 19:23:15 -0500
commit9f62328988e83413eb819ac1ab2021a414188a67 (patch)
tree9ea06850663aa4f941fd0de8982b9019c6d2f983 /tests/unit
parentf02ba03c12599bdd61b5208c9a65f458ae05aa15 (diff)
downloadarchangel-9f62328988e83413eb819ac1ab2021a414188a67.tar.gz
archangel-9f62328988e83413eb819ac1ab2021a414188a67.zip
refactor: extract EFI_DIR constant for the install-time EFI mount point
The literal /mnt/efi appeared at 17 sites across installer/archangel and installer/lib/btrfs.sh. Renaming it (or pointing tests at a different mount) meant touching every site and risking incomplete sweeps. One canonical name in installer/lib/common.sh now backs every reference. EFI_DIR has no trailing slash so the three expansion patterns in the codebase compose cleanly. Bare ($EFI_DIR), sub-path ($EFI_DIR/EFI/ZBM), and the index-suffix used by install_grub_all_efi for secondary EFI mounts (${EFI_DIR}${i}). The sync_efi_partitions staging path also moves from the literal /mnt/efi_sync to ${EFI_DIR}_sync, so it follows EFI_DIR if anyone ever changes the base. Two follow-ups filed as separate :techdebt: items. MNTPOINT=/mnt extraction across the 50+ /mnt/... sites (pacstrap, arch-chroot, fstab writes), and the related /mnt${chroot_efi_dir} composition pattern at btrfs.sh:681-682. Both ship together when MNTPOINT lands. Verified: bats 134 → 135 (+1 pinning EFI_DIR=/mnt/efi). Lint clean. All four expansion patterns smoke-tested at runtime and produce the original literal byte-for-byte. VM run skipped, pure constant substitution with zero behavior change.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_common.bats8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/test_common.bats b/tests/unit/test_common.bats
index 0bb76a1..4d58bd9 100644
--- a/tests/unit/test_common.bats
+++ b/tests/unit/test_common.bats
@@ -324,3 +324,11 @@ Boot0001* ZFSBootMenu"
[ "$status" -eq 1 ]
[ -z "$output" ]
}
+
+#############################
+# Path constants
+#############################
+
+@test "EFI_DIR is defined and equals /mnt/efi" {
+ [ "$EFI_DIR" = "/mnt/efi" ]
+}