diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2019-11-11 13:48:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-11 13:48:45 +0000 |
commit | 556a169f14f4970927b8c18a997dbf323ed9a865 (patch) | |
tree | e2118786d1b25648b434e2366b623f6510c32433 /nixos | |
parent | ceb648f66a1ddd27da9319fd0d78e1bd422ac10c (diff) | |
parent | a8e9a93493bca33f59b6c893cd8af459b18ab619 (diff) | |
download | nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar.gz nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar.bz2 nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar.lz nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar.xz nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.tar.zst nixlib-556a169f14f4970927b8c18a997dbf323ed9a865.zip |
Merge pull request #73189 from flokli/python-tests-return-multiple
nixos/tests: fix succeed() with multiple commands
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/test-driver/test-driver.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index c8940d78af4e..c8d4936ac52a 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -381,15 +381,17 @@ class Machine: def succeed(self, *commands): """Execute each command and check that it succeeds.""" + output = "" for command in commands: with self.nested("must succeed: {}".format(command)): - status, output = self.execute(command) + (status, out) = self.execute(command) if status != 0: - self.log("output: {}".format(output)) + self.log("output: {}".format(out)) raise Exception( "command `{}` failed (exit code {})".format(command, status) ) - return output + output += out + return output def fail(self, *commands): """Execute each command and check that it fails.""" |