diff --git a/example/gpt-name-with-whitespace.nix b/example/gpt-name-with-whitespace.nix new file mode 100644 index 0000000..dc29558 --- /dev/null +++ b/example/gpt-name-with-whitespace.nix @@ -0,0 +1,41 @@ +{ + disko.devices = { + disk = { + vdb = { + device = "/dev/disk/by-id/some-disk-id"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "100M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + "name with spaces" = { + type = "EF00"; + size = "100M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/name_with_spaces"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/example/legacy-table-with-whitespace.nix b/example/legacy-table-with-whitespace.nix new file mode 100644 index 0000000..aa13eca --- /dev/null +++ b/example/legacy-table-with-whitespace.nix @@ -0,0 +1,50 @@ +{ + disko.devices = { + disk = { + vdb = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "ESP"; + start = "1MiB"; + end = "100MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "name with spaces"; + start = "1MiB"; + end = "100MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/name_with_spaces"; + }; + } + { + name = "root"; + start = "100MiB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + }; +} diff --git a/tests/gpt-name-with-whitespace.nix b/tests/gpt-name-with-whitespace.nix new file mode 100644 index 0000000..21954e4 --- /dev/null +++ b/tests/gpt-name-with-whitespace.nix @@ -0,0 +1,12 @@ +{ pkgs ? import { } +, diskoLib ? pkgs.callPackage ../lib { } +}: +diskoLib.testLib.makeDiskoTest { + inherit pkgs; + name = "gpt-name-with-whitespace"; + disko-config = ../example/gpt-name-with-whitespace.nix; + extraTestScript = '' + machine.succeed("mountpoint /"); + machine.succeed("mountpoint /name_with_spaces"); + ''; +} diff --git a/tests/legacy-table-with-whitespace.nix b/tests/legacy-table-with-whitespace.nix new file mode 100644 index 0000000..300c641 --- /dev/null +++ b/tests/legacy-table-with-whitespace.nix @@ -0,0 +1,12 @@ +{ pkgs ? import { } +, diskoLib ? pkgs.callPackage ../lib { } +}: +diskoLib.testLib.makeDiskoTest { + inherit pkgs; + name = "legacy-table-with-whitespace"; + disko-config = ../example/legacy-table-with-whitespace.nix; + extraTestScript = '' + machine.succeed("mountpoint /"); + machine.succeed("mountpoint /name_with_spaces"); + ''; +}