diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-08-03 08:06:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-03 08:06:07 +0200 |
commit | 7560e2d64f2a367c128f4baf76155bc33f13a77d (patch) | |
tree | f7468f48147578f2477b82ea01948cd6389d47e2 /nixos/tests/systemd.nix | |
parent | 8fa3fb092e5839abbe6a61023162914f4f47a1db (diff) | |
parent | 717b8b3219e0a207e16e28f828f88060b0477d0b (diff) | |
download | nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar.gz nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar.bz2 nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar.lz nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar.xz nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.tar.zst nixlib-7560e2d64f2a367c128f4baf76155bc33f13a77d.zip |
Merge pull request #65376 from abbradar/mdadm-upstream
Use upstream units for mdadm
Diffstat (limited to 'nixos/tests/systemd.nix')
-rw-r--r-- | nixos/tests/systemd.nix | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix index 4d470126abee..fadea52f1dbc 100644 --- a/nixos/tests/systemd.nix +++ b/nixos/tests/systemd.nix @@ -1,4 +1,4 @@ -import ./make-test.nix { +import ./make-test.nix ({ pkgs, ... }: { name = "systemd"; machine = { lib, ... }: { @@ -21,6 +21,14 @@ import ./make-test.nix { services.journald.extraConfig = "Storage=volatile"; services.xserver.displayManager.auto.user = "alice"; + systemd.shutdown.test = pkgs.writeScript "test.shutdown" '' + #!${pkgs.stdenv.shell} + PATH=${lib.makeBinPath (with pkgs; [ utillinux coreutils ])} + mount -t 9p shared -o trans=virtio,version=9p2000.L /tmp/shared + touch /tmp/shared/shutdown-test + umount /tmp/shared + ''; + systemd.services.testservice1 = { description = "Test Service 1"; wantedBy = [ "multi-user.target" ]; @@ -69,5 +77,20 @@ import ./make-test.nix { # has a last mount time, because the file system wasn't checked. $machine->fail('dumpe2fs /dev/vdb | grep -q "^Last mount time: *n/a"'); }; + + # Regression test for https://github.com/NixOS/nixpkgs/issues/35268 + subtest "file system with x-initrd.mount is not unmounted", sub { + $machine->shutdown; + $machine->waitForUnit('multi-user.target'); + # If the file system was unmounted during the shutdown the file system + # has a last mount time, because the file system wasn't checked. + $machine->fail('dumpe2fs /dev/vdb | grep -q "^Last mount time: *n/a"'); + }; + + subtest "systemd-shutdown works", sub { + $machine->shutdown; + $machine->waitForUnit('multi-user.target'); + $machine->succeed('test -e /tmp/shared/shutdown-test'); + }; ''; -} +}) |