]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add checks for the json output with unixtime of the .jlist events command
authorEric Bollengier <eric@baculasystems.com>
Thu, 8 Apr 2021 08:42:01 +0000 (10:42 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
regress/tests/events-test

index 6be27f39c715b0f7e46dca469a861be0dc2613f0..9500e5185369ff374a03973016077b1ecb61238a 100755 (executable)
@@ -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