nixos tests doc: fix example statement

False statements don't cause NixOS tests to fail, we need to throw an
exception or terminate.
This commit is contained in:
Erik Arvstedt 2018-09-17 12:58:12 +02:00
parent 395019b38d
commit b0956b0ae3

View File

@ -108,7 +108,7 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualis
<programlisting>
$machine->start;
$machine->waitForUnit("default.target");
$machine->succeed("uname") =~ /Linux/;
die unless $machine->succeed("uname") =~ /Linux/;
</programlisting>
The first line is actually unnecessary; machines are implicitly started when
you first execute an action on them (such as <literal>waitForUnit</literal>