From 931b7b47a279b7e566ef487ee1bc1a8002bd1212 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 26 Nov 2018 19:36:02 +0100 Subject: nixos tests doc: minor fixes This fixes some quirks I introduced in previous commits. 1. No need for an extra newline when printing the output of shell commands. 2. 'or die' is what's already used in the NixOS test sources, while 'die unless' has no occurrences. --- nixos/doc/manual/development/running-nixos-tests-interactively.xml | 2 +- nixos/doc/manual/development/writing-nixos-tests.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/doc/manual') diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.xml b/nixos/doc/manual/development/running-nixos-tests-interactively.xml index b25d3dcb9116..c15ad448317f 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.xml +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.xml @@ -19,7 +19,7 @@ starting VDE switch for network 1 > startAll > testScript > $machine->succeed("touch /tmp/foo") -> print($machine->succeed("pwd"), "\n") # Show stdout of command +> print($machine->succeed("pwd")) # Show stdout of command The function testScript executes the entire test script and drops you back into the test driver command line upon its completion. diff --git a/nixos/doc/manual/development/writing-nixos-tests.xml b/nixos/doc/manual/development/writing-nixos-tests.xml index 983f8f9cbe3e..4a2615c9407b 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.xml +++ b/nixos/doc/manual/development/writing-nixos-tests.xml @@ -108,7 +108,7 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualis $machine->start; $machine->waitForUnit("default.target"); -die unless $machine->succeed("uname") =~ /Linux/; +$machine->succeed("uname") =~ /Linux/ or die; The first line is actually unnecessary; machines are implicitly started when you first execute an action on them (such as waitForUnit -- cgit 1.4.1