From: Eric Bollengier Date: Thu, 8 Apr 2021 08:42:01 +0000 (+0200) Subject: regress: Add checks for the json output with unixtime of the .jlist events command X-Git-Tag: Release-11.3.2~596 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e396bc095eb2b0f18344765e2cdca74021e5e1e8;p=thirdparty%2Fbacula.git regress: Add checks for the json output with unixtime of the .jlist events command --- 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