From b0815bd475a9d3fb3adfae873e9188c0919e6c8c Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Tue, 9 Jul 2024 01:41:12 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20gucc:=20improve=20test=20coverag?= =?UTF-8?q?e=20for=20crypttab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gucc/tests/unit-crypttab_gen.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gucc/tests/unit-crypttab_gen.cpp b/gucc/tests/unit-crypttab_gen.cpp index 43cf5fd..d7b0fd1 100644 --- a/gucc/tests/unit-crypttab_gen.cpp +++ b/gucc/tests/unit-crypttab_gen.cpp @@ -46,8 +46,15 @@ int main() { const std::vector partitions{ gucc::fs::Partition{.fstype = "btrfs"s, .mountpoint = "/"s, .uuid_str = uuid_str, .device = "/dev/nvme0n1p1"s, .mount_opts = btrfs_mountopts, .subvolume = "/@"s}, gucc::fs::Partition{.fstype = "btrfs"s, .mountpoint = "/home"s, .uuid_str = uuid_str, .device = "/dev/nvme0n1p1"s, .mount_opts = btrfs_mountopts, .subvolume = "/@home"s}, - gucc::fs::Partition{.fstype = "btrfs"s, .mountpoint = "/var/cache"s, .uuid_str = uuid_str, .device = "/dev/nvme0n1p1"s, .mount_opts = btrfs_mountopts, .subvolume = "/@cache"s}, - gucc::fs::Partition{.fstype = "fat32"s, .mountpoint = "/boot"s, .uuid_str = "8EFB-4B84"s, .device = "/dev/nvme0n1p2"s, .mount_opts = "defaults,noatime"s}, + gucc::fs::Partition{ + .fstype = "btrfs"s, + .mountpoint = "/var/cache"s, + .uuid_str = uuid_str, + .device = "/dev/nvme0n1p1"s, + .mount_opts = btrfs_mountopts, + .subvolume = "/@cache"s, + }, + gucc::fs::Partition{.fstype = "fat32"s, .mountpoint = "/boot"s, .uuid_str = "8EFB-4B84"s, .device = "/dev/nvme0n1p2"s, .mount_opts = "defaults,noatime"s, .luks_mapper_name = "", .luks_uuid = ""}, }; const auto& crypttab_content = gucc::fs::generate_crypttab_content(partitions, "luks"sv); assert(crypttab_content == CRYPTTAB_EMPTY_TEST); @@ -55,8 +62,8 @@ int main() { // basic xfs { const std::vector partitions{ - gucc::fs::Partition{.fstype = "xfs"s, .mountpoint = "/"s, .uuid_str = "6bdb3301-8efb-4b84-b0b7-4caeef26fd6f"s, .device = "/dev/nvme0n1p1"s, .mount_opts = xfs_mountopts}, - gucc::fs::Partition{.fstype = "fat16"s, .mountpoint = "/boot"s, .uuid_str = "8EFB-4B84"s, .device = "/dev/nvme0n1p2"s, .mount_opts = "defaults,noatime"s}, + gucc::fs::Partition{.fstype = "xfs"s, .mountpoint = "/"s, .uuid_str = "6bdb3301-8efb-4b84-b0b7-4caeef26fd6f"s, .device = "/dev/nvme0n1p1"s, .mount_opts = xfs_mountopts, .luks_mapper_name = ""}, + gucc::fs::Partition{.fstype = "fat16"s, .mountpoint = "/boot"s, .uuid_str = "8EFB-4B84"s, .device = "/dev/nvme0n1p2"s, .mount_opts = "defaults,noatime"s, .luks_uuid = ""}, }; const auto& crypttab_content = gucc::fs::generate_crypttab_content(partitions, "luks"sv); assert(crypttab_content == CRYPTTAB_EMPTY_TEST);