summaryrefslogtreecommitdiff
path: root/tests/setup_disk_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup_disk_test')
-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 1fee4aa..061caa3 100755
--- a/tests/setup_disk_test
+++ b/tests/setup_disk_test
@@ -9,7 +9,8 @@ init_tests \
setup_disk_func_setup_partitions_dos \
setup_disk_func_setup_partitions_gpt \
setup_disk_func_find_efi_size \
- setup_disk_non_existing_block_dev
+ setup_disk_non_existing_block_dev \
+ setup_disk_install_mounted_root_nvme
setup_disk_usage_body() {
test_usage setup-disk
@@ -198,3 +199,27 @@ setup_disk_non_existing_block_dev_body() {
setup-disk -m sys /dev/vda
}
+setup_disk_install_mounted_root_nvme_body() {
+ init_env
+ mkdir -p target/boot/efi \
+ sys/firmware/efi
+
+ # simulate nvme0n1p2 being mounted
+ fake_mount "/dev/nvme0n1p2 $PWD/target ext4 rw,noatime,data=ordered 0 0"
+ fake_mount "/dev/nvme0n1p3 $PWD/target/boot/efi vfat rw,relatime,fmask=0022 0 0"
+
+ atf_check -s exit:0 \
+ -o match:"Installing system on /dev/nvme0n1p2" \
+ -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 target
+
+ atf_check \
+ -o match:"/dev/nvme0n1p2 / ext4 rw,noatime,data=ordered 0 1" \
+ -o match:"/dev/nvme0n1p3 /boot/efi vfat rw,relatime,fmask=0022 0 2" \
+ cat target/etc/fstab
+
+ atf_check -o match:"GRUB_CMDLINE_LINUX_DEFAULT=.*ext4,nvme" \
+ cat target/etc/default/grub
+
+}