summary refs log tree commit diff
diff options
context:
space:
mode:
authorajs124 <git@ajs124.de>2020-05-31 23:31:11 +0200
committerFlorian Klink <flokli@flokli.de>2020-07-14 12:00:33 +0200
commit53a34361afe7b58db95c77cd99f268fd933e4053 (patch)
tree381dafadf96d574ae18bcae5bae8f72838bb845d
parentd056f6e86d39f803eacc8b70501cead76d58c069 (diff)
downloadnixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar.gz
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar.bz2
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar.lz
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar.xz
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.tar.zst
nixpkgs-53a34361afe7b58db95c77cd99f268fd933e4053.zip
nixos/tests/installer: lvm: test lvm2-pvscan@ units
Also, add some sleep statements in between, which seems to at least feel
like it causes

> WARNING: Device /dev/vda* not initialized in udev database even after waiting 10000000 microseconds.

To occur less frequently.

This eventually still succeeds after some amount of waiting, I suspect
some racyness in the way lvm's udev-triggered scripts trigger other
units.
-rw-r--r--nixos/tests/installer.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 158a19925c2..22132073142 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -555,16 +555,26 @@ in {
           + " mkpart primary 2048M -1s"  # PV2
           + " set 2 lvm on",
           "udevadm settle",
+          "sleep 1",
           "pvcreate /dev/vda1 /dev/vda2",
+          "sleep 1",
           "vgcreate MyVolGroup /dev/vda1 /dev/vda2",
+          "sleep 1",
           "lvcreate --size 1G --name swap MyVolGroup",
+          "sleep 1",
           "lvcreate --size 2G --name nixos MyVolGroup",
+          "sleep 1",
           "mkswap -f /dev/MyVolGroup/swap -L swap",
           "swapon -L swap",
           "mkfs.xfs -L nixos /dev/MyVolGroup/nixos",
           "mount LABEL=nixos /mnt",
       )
     '';
+    postBootCommands = ''
+      assert "loaded active" in machine.succeed(
+          "systemctl list-units 'lvm2-pvscan@*' -ql --no-legend | tee /dev/stderr"
+      )
+    '';
   };
 
   # Boot off an encrypted root partition with the default LUKS header format