From 52c0f4bb8e2677545ac380cd5c45b116dad3d366 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Fri, 27 Sep 2019 12:22:42 -0400
Subject: [PATCH] report the log on exercise-storage failure too

---
 nixos/modules/tests/private-storage.nix | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/nixos/modules/tests/private-storage.nix b/nixos/modules/tests/private-storage.nix
index cb7203e0..f719d22a 100644
--- a/nixos/modules/tests/private-storage.nix
+++ b/nixos/modules/tests/private-storage.nix
@@ -134,6 +134,15 @@ import <nixpkgs/nixos/tests/make-test.nix> {
       };
 
       # The client should be prepped now.  Make it try to use some storage.
-      $client->succeed('set -eo pipefail; ${exercise-storage} | systemd-cat');
-    '';
+      eval {
+        $client->succeed('set -eo pipefail; ${exercise-storage} /tmp/client | systemd-cat');
+        # nothing succeeds like ... 1.
+        1;
+      } or do {
+        my $error = $@ || 'Unknown failure';
+        my ($code, $log) = $client->execute('cat /tmp/stdout /tmp/stderr');
+        $client->log($log);
+        die $@;
+      };
+      '';
 }
-- 
GitLab