From e396bc095eb2b0f18344765e2cdca74021e5e1e8 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 8 Apr 2021 10:42:01 +0200 Subject: [PATCH] regress: Add checks for the json output with unixtime of the .jlist events command --- regress/tests/events-test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/regress/tests/events-test b/regress/tests/events-test index 6be27f39c..9500e5185 100755 --- a/regress/tests/events-test +++ b/regress/tests/events-test @@ -76,6 +76,9 @@ llist events type=bweb llist events source=*Console* @$out $tmp/log8.out llist events code=DJ0001 +@# Sending .jlist output only in log9.out +@output $tmp/log9.out +.jlist events quit END_OF_DATA @@ -173,4 +176,19 @@ if [ $? != 0 ]; then print_debug "ERROR: Should find messages from the FD in the catalog in $tmp/log5.out" estat=1 fi + +grep -i unixtime $tmp/log9.out > /dev/null +if [ $? != 0 ]; then + print_debug "ERROR: Should find unixtime in json output in $tmp/log9.out" + estat=1 +fi + +grep "\[{" $tmp/log9.out > $tmp/log-json.out +$bperl -e "check_json('$tmp/log-json.out')" +if [ $? != 0 ]; then + print_debug "ERROR: Should find valid json output in $tmp/log-json.out and $tmp/log9.out" + estat=1 +fi + + end_test -- 2.47.3