summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2023-03-24 14:32:58 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2023-03-24 14:32:58 +0100
commitf37073e7b6144ee78dcb486e6ff19cd7e9db3a10 (patch)
tree9136a02548a5af450aa1443fe6e57161abd7002d /tests
parent3bb128b908a92fccae0eeda494aff62509a4bf47 (diff)
downloadalpine-conf-f37073e7b6144ee78dcb486e6ff19cd7e9db3a10.zip
setup-disk: find msdos and fat efi partitions
fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10555
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_disk_test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/setup_disk_test b/tests/setup_disk_test
index 028d28e..56ae715 100755
--- a/tests/setup_disk_test
+++ b/tests/setup_disk_test
@@ -12,6 +12,7 @@ init_tests \
setup_disk_func_uuid_or_device \
setup_disk_non_existing_block_dev \
setup_disk_install_mounted_root_nvme \
+ setup_disk_install_mounted_root_efi \
setup_disk_install_mounted_root_efi_boot \
setup_disk_install_mounted_root_bootloader_none \
setup_disk_install_mounted_root_zfs
@@ -265,6 +266,33 @@ setup_disk_install_mounted_root_nvme_body() {
}
+setup_disk_install_mounted_root_efi_body() {
+ init_env
+ for fs in vfat msdos fat; do
+ rm -rf target sys etc proc
+ mkdir -p target/boot/efi \
+ sys/firmware/efi \
+
+ fake_mount "/dev/vda2 $PWD/target ext4 rw,noatime,data=ordered 0 0"
+ fake_mount "/dev/vda1 $PWD/target/boot/efi $fs 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/efi .* --boot-directory=$PWD/target/boot" \
+ -o match:"install -D $PWD/target/boot/efi/EFI/alpine/grub.*efi $PWD/target/boot/efi/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/efi $fs rw,relatime,fmask=0022 0 2" \
+ cat target/etc/fstab
+
+ atf_check -o match:"GRUB_CMDLINE_LINUX_DEFAULT=.*ext4" \
+ cat target/etc/default/grub
+ done
+}
+
+# test case when /boot is the efi vfat partition
setup_disk_install_mounted_root_efi_boot_body() {
init_env
mkdir -p target/boot \