From c9633501672c8aa21d964d6406e45a17c52d40e4 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Fri, 7 May 2021 00:47:45 +0200
Subject: [PATCH] NEO: save VM system log if the stress test fails

By using '/lib/systemd/systemd-journal-remote --output=...'
the dump can be converted back to a file that is readable with
'journalctl --file=...'
---
 software/neoppod/stress-testing/stress | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/software/neoppod/stress-testing/stress b/software/neoppod/stress-testing/stress
index 7d3b4c131..c9e4c6e7b 100755
--- a/software/neoppod/stress-testing/stress
+++ b/software/neoppod/stress-testing/stress
@@ -31,3 +31,7 @@ if returncode:
     subprocess.call(
         ('tar', '-caf', result('db.tar.xz'), 'neo_tests'),
         cwd=tempfile.gettempdir())
+    p = subprocess.Popen(('journalctl', '-o', 'export'), stdout=subprocess.PIPE)
+    with open(result('journalctl-export.xz'), 'wb') as f:
+        subprocess.call(('xz',), stdin=p.stdout, stdout=f)
+    p.wait()
-- 
2.30.9