]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add test for list reviewed command
authorEric Bollengier <eric@baculasystems.com>
Tue, 31 Jan 2023 09:23:57 +0000 (10:23 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
regress/tests/backup-bacula-test

index d5720770b8bbfcc8cfe629cdfb0c83dfcfc0978b..98bbe393906140f1c4a7b8d494c3b8e77c934f58 100755 (executable)
@@ -70,6 +70,12 @@ restore where=$tmp/bacula-restores select all done
 yes
 wait
 messages
+@output $tmp/log31.out
+.jlist jobs reviewed=1
+@output $tmp/log32.out
+update jobid=1 reviewed=1
+@output $tmp/log33.out
+.jlist jobs reviewed=1
 quit
 END_OF_DATA
 
@@ -84,6 +90,18 @@ run_bacula
 check_for_zombie_jobs storage=File1
 stop_bacula
 
+grep '{' $tmp/log31.out | perl -MJSON -e '$l = <>; $obj = JSON::decode_json($l); exit (scalar(@{ $obj->{data} }) == 0);'
+if [ $? != 1 ]; then
+    print_debug "ERROR: Should find 0 job reviewed in $tmp/log/31.out"
+    estat=1
+fi
+
+grep '{' $tmp/log33.out | perl -MJSON -e '$l = <>; $obj = JSON::decode_json($l); exit (scalar(@{ $obj->{data} }) == 1);'
+if [ $? != 1 ]; then
+    print_debug "ERROR: Should find 1 job reviewed in $tmp/log33.out"
+    estat=1
+fi
+
 check_two_logs
 check_restore_diff
 end_test