nixos/tests/misc: Fix reboot-wtmp subtest

From commit b63f65aea0:

  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
This commit is contained in:
aszlig 2018-10-03 03:48:04 +02:00
parent 889c72032f
commit 5e7bf8c5e9
No known key found for this signature in database
GPG key ID: 684089CE67EBB691

View file

@ -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");
};