3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos
aszlig d7c7fc4603 nixos/tests/systemd: Fix x-initrd-mount flakiness (#67798)
It turns out that checking for the last mount time of an ext4 file
system isn't a very reliable way to check whether the file system was
properly unmounted.

When creating that test in the first place (88530e02b6),
I was reluctant to inspect the file system when the VM is down and was
searching for a way to check for a clean unmount *after* the file system
was mounted again to make sure we don't need to create a 512 MB raw
image on the host.

Fortunately however, when converting from qcow2, qemu-img actually
writes a sparse file, so for most file systems (that is, file systems
supporting sparse files) this shouldn't waste a lot of disk space.

So when investigating the flakiness, I found that whenever the test is
failing, the unmount of /test-x-initrd-mount was done *before* the final
step during which systemd remounts+unmounts all the remaining file
systems.

I haven't investigated why this is the case, but the test is a
regression test for https://github.com/NixOS/nixpkgs/issues/35268, which
actually didn't unmount the file system *at* *all*, so really all we
need to take care here is whether the unmount has happened and not
*how*.

To make sure that checking the filesystem state is enough for this, I
temporarily replaced the $machine->shutdown call with $machine->crash
and verified that the file system state is "not clean".

Signed-off-by: aszlig <aszlig@nix.build>
Fixes: https://github.com/NixOS/nixpkgs/issues/67555
2019-08-31 00:30:50 -04:00
..
doc Merge pull request #63773 from flokli/installation-device-fixes 2019-08-31 02:59:23 +02:00
lib Merge branch 'master' into flip-map-foreach 2019-08-18 18:00:25 +03:00
maintainers mass replace "flip map -> forEach" 2019-08-05 14:03:38 +03:00
modules Merge pull request #63773 from flokli/installation-device-fixes 2019-08-31 02:59:23 +02:00
tests nixos/tests/systemd: Fix x-initrd-mount flakiness (#67798) 2019-08-31 00:30:50 -04:00
COPYING
default.nix
README
release-combined.nix nixosTests.xfce4-14: init 2019-08-21 22:04:29 -04:00
release-small.nix release-small.nix: Don't depend on currentSystem 2019-06-19 14:07:37 +02:00
release.nix nixos/sd-image-aarch64-new-kernel: Added to release 2018-12-26 11:03:32 +00:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.