summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2023-01-24 11:33:01 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2023-01-24 10:41:58 +0000
commit4abe368206e79cfed88af3edfb15321439e0b763 (patch)
tree2a29cea44e737b45ffea0fdbb7a88785b6f31e94 /tests
parentbe385e614eafdf5f95e35ad3cbd4eaa378b96752 (diff)
downloadalpine-conf-4abe368206e79cfed88af3edfb15321439e0b763.zip
setup-disk: fix detection of EFI directory
Try autodetect the EFI directory instead of hardcoding it to /boot/efi. This is needed when /boot is the EFI directory and no encryption is used.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_disk_test27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/setup_disk_test b/tests/setup_disk_test
index 061caa3..d7951ea 100755
--- a/tests/setup_disk_test
+++ b/tests/setup_disk_test
@@ -10,7 +10,8 @@ init_tests \
setup_disk_func_setup_partitions_gpt \
setup_disk_func_find_efi_size \
setup_disk_non_existing_block_dev \
- setup_disk_install_mounted_root_nvme
+ setup_disk_install_mounted_root_nvme \
+ setup_disk_install_mounted_root_efi_boot
setup_disk_usage_body() {
test_usage setup-disk
@@ -223,3 +224,27 @@ setup_disk_install_mounted_root_nvme_body() {
cat target/etc/default/grub
}
+
+setup_disk_install_mounted_root_efi_boot_body() {
+ init_env
+ mkdir -p target/boot \
+ sys/firmware/efi
+
+ # simulate nvme0n1p2 being mounted
+ fake_mount "/dev/vda2 $PWD/target ext4 rw,noatime,data=ordered 0 0"
+ fake_mount "/dev/vda1 $PWD/target/boot vfat rw,relatime,fmask=0022 0 0"
+
+ atf_check -s exit:0 \
+ -o match:"Installing system on /dev/vda2" \
+ -o match:"grub-install .* --efi-directory=$PWD/target/boot .* --boot-directory=$PWD/target/boot" \
+ -o match:"install -D $PWD/target/boot/EFI/alpine/grub.*efi $PWD/target/boot/EFI/boot/bootaa64.efi" \
+ setup-disk -v target
+
+ atf_check \
+ -o match:"/dev/vda2 / ext4 rw,noatime,data=ordered 0 1" \
+ -o match:"/dev/vda1 /boot vfat rw,relatime,fmask=0022 0 2" \
+ cat target/etc/fstab
+
+ atf_check -o match:"GRUB_CMDLINE_LINUX_DEFAULT=.*ext4" \
+ cat target/etc/default/grub
+}