From 805e7975f59e34ada9e276d75179e079de200d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sat, 9 Mar 2019 17:16:37 +0200 Subject: [PATCH] Fix log truncation Syslog wasn't truncated which caused massive disk space usage when the full test set was run. Also removed the creation of empty log files if no messages were logged during the run. --- maxscale-system-test/testconnections.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index cd50061e8..a64436423 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -801,11 +801,16 @@ void TestConnections::copy_one_mariadb_log(int i, std::string filename) for (auto cmd : log_retrive_commands) { - std::ofstream outfile(filename + std::to_string(j++)); + auto output = repl->ssh_output(cmd, i).second; - if (outfile) + if (!output.empty()) { - outfile << repl->ssh_output(cmd, i).second; + std::ofstream outfile(filename + std::to_string(j++)); + + if (outfile) + { + outfile << output; + } } } }