Skip to content

Commit

Permalink
nixos/tests/misc: Fix reboot-wtmp subtest
Browse files Browse the repository at this point in the history
From commit b63f65a:

  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
  • Loading branch information
aszlig committed Oct 3, 2018
1 parent 889c720 commit 5e7bf8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nixos/tests/misc.nix
Expand Up @@ -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");
};
Expand Down

0 comments on commit 5e7bf8c

Please sign in to comment.