summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-10-03 03:48:04 +0200
committeraszlig <aszlig@nix.build>2018-10-03 03:57:28 +0200
commit5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e (patch)
tree7612ada2e365933012a6692e63c3ca08e0aa9d03 /nixos/tests
parent889c72032f8595fcd7542c6032c208f6b8033db6 (diff)
downloadnixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar.gz
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar.bz2
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar.lz
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar.xz
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.tar.zst
nixlib-5e7bf8c5e9da260c912e8abda5fb8a407ee3da7e.zip
nixos/tests/misc: Fix reboot-wtmp subtest
From commit b63f65aea0dea11c20e9299210af1d2ee4299b58:

  I used tmpfiles.d instead of activation snippets to create the logs.
  It's good enough for upstream and other distros; it's probably good
  enough for us.

The "reboot-wtmp" subtest fails because it it assumes that there is a
reboot record even on the initial boot. This is only the case if wtmp is
created within the activation script, but the implementation now uses
tmpfiles.d, so the creation of the file is done at a much later stage.

Apart from that, if you think about the state after the installation as
"first boot", using the term "reboot" wouldn't probably make sense
either.

So in our subtest, we now reboot the machine and check the wtmp record
afterwards as we did before.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edolstra, @jameysharp, @Mic92
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/misc.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix
index 6d72ac997f8d..3ad55651b112 100644
--- a/nixos/tests/misc.nix
+++ b/nixos/tests/misc.nix
@@ -78,6 +78,8 @@ import ./make-test.nix ({ pkgs, ...} : rec {
 
       # Test whether we have a reboot record in wtmp.
       subtest "reboot-wtmp", sub {
+          $machine->shutdown;
+          $machine->waitForUnit('multi-user.target');
           $machine->succeed("last | grep reboot >&2");
       };