From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 09/10] test: Log debugging output from test script Date: Thu, 18 Aug 2022 16:13:57 +1000 Message-ID: <20220818061358.1775944-10-david@gibson.dropbear.id.au> In-Reply-To: <20220818061358.1775944-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0550726153190210893==" --===============0550726153190210893== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The test scripts run with sh -e, which means they will stop if any commands return an error. That's generally desirable, because we won't continue after things are hopeless due to an earlier step failing. Unfortunately, the tmux setup we run the script in means it's not obvious where any error messages related to such a failure will go. Depending on exactly where the error occurs they might go to the original terminal hidden behind tmux, or they might go to a tmux panel that's not visible in the normal layouts. To make it easier to find such error message, redirect direct output and errors from the test script itself to a 'script.log' file in the logs directory. When in DEBUG=1 mode, additionaly 'set -x' so we log all the commands we execute to that file. Signed-off-by: David Gibson --- test/run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/run b/test/run index 609d91d..aa9a380 100755 --- a/test/run +++ b/test/run @@ -161,6 +161,8 @@ demo() { [ "$(basename "${0}")" = "run_demo" ] && DEMO=1 if [ "${1}" = "from_term" ]; then + exec > ${LOGDIR}/script.log 2>&1 + [ ${DEBUG} -eq 1 ] && set -x cd .. if [ ${DEMO} -eq 1 ]; then demo -- 2.37.2 --===============0550726153190210893==--