From b63129fe8c467802c1f5fe8fff3eda66e61bbeaa Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Tue, 21 Nov 2023 10:22:02 +0100 Subject: [PATCH] Create query log to stdout --- clt_tests/tests/query_log_to_stdout.rep | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 clt_tests/tests/query_log_to_stdout.rep diff --git a/clt_tests/tests/query_log_to_stdout.rep b/clt_tests/tests/query_log_to_stdout.rep new file mode 100644 index 0000000..9de0b12 --- /dev/null +++ b/clt_tests/tests/query_log_to_stdout.rep @@ -0,0 +1,31 @@ +You can use regex in the output sections. +More info here: https://github.com/manticoresoftware/clt#refine +––– input ––– +(dockerd > /var/log/dockerd.log 2>&1 &) > /dev/null +––– output ––– +––– input ––– +timeout 60 tail -n 100 -f /var/log/dockerd.log | grep -qm1 'API listen on /var/run/docker.sock' && echo 'Done' || echo 'Timeout failed' +––– output ––– +Done +––– input ––– +docker ps +––– output ––– +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +––– input ––– +docker build --build-arg="DEV=1" -t manticoresoftware/manticore:current /docker/ > /dev/null 2>&1; echo $? +––– output ––– +0 +––– input ––– +docker run -d -e QUERY_LOG_TO_STDOUT=true --name manticore manticoresoftware/manticore:current +––– output ––– +c69dee4f8b086e26e492beca535317b489e3357d0ccc581bdf74320cc6dc11a9 +––– input ––– +sleep 5;docker logs manticore | grep "accepting connections" +––– output ––– +accepting connections +––– input ––– +docker exec manticore mysql -e "CREATE TABLE a; SELECT * FROM a;" +––– output ––– +––– input ––– +docker logs manticore | grep "SELECT * FROM a;" +––– output –––