diff options
author | ajs124 <git@ajs124.de> | 2023-06-09 13:44:48 +0200 |
---|---|---|
committer | ajs124 <git@ajs124.de> | 2023-06-09 13:44:48 +0200 |
commit | bcb903cce86402edbd8bbdea5645eef3d624a7e3 (patch) | |
tree | fa03c68d1fd2675c5d848c1013b3d8275f57fd47 /nixos | |
parent | 3bf06829ff84303fc7122aada24568a9885ac28c (diff) |
nixos/tests/lvm2/thinpool: fix xfs creation on older kernels
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/lvm2/thinpool.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/tests/lvm2/thinpool.nix b/nixos/tests/lvm2/thinpool.nix index 82c6460a890a..14781a8a6045 100644 --- a/nixos/tests/lvm2/thinpool.nix +++ b/nixos/tests/lvm2/thinpool.nix @@ -1,5 +1,5 @@ { kernelPackages ? null }: -import ../make-test-python.nix ({ pkgs, ... }: { +import ../make-test-python.nix ({ pkgs, lib, ... }: { name = "lvm2-thinpool"; meta.maintainers = with pkgs.lib.maintainers; [ ajs124 ]; @@ -17,11 +17,13 @@ import ../make-test-python.nix ({ pkgs, ... }: { boot = lib.mkIf (kernelPackages != null) { inherit kernelPackages; }; }; - testScript = '' + testScript = let + mkXfsFlags = lib.optionalString (lib.versionOlder kernelPackages.kernel.version "5.10") "-m bigtime=0 -m inobtcount=0"; + in '' machine.succeed("vgcreate test_vg /dev/vdb") machine.succeed("lvcreate -L 512M -T test_vg/test_thin_pool") machine.succeed("lvcreate -n test_lv -V 16G --thinpool test_thin_pool test_vg") - machine.succeed("mkfs.xfs /dev/test_vg/test_lv") + machine.succeed("mkfs.xfs ${mkXfsFlags} /dev/test_vg/test_lv") machine.succeed("mkdir /mnt; mount /dev/test_vg/test_lv /mnt") assert "/dev/mapper/test_vg-test_lv" == machine.succeed("findmnt -no SOURCE /mnt").strip() machine.succeed("dd if=/dev/zero of=/mnt/empty.file bs=1M count=1024") |