]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: pass comment on migration/copy jobs
authorEric Bollengier <eric@baculasystems.com>
Thu, 31 Aug 2023 08:32:28 +0000 (10:32 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 13 Feb 2024 09:36:03 +0000 (10:36 +0100)
regress/tests/copy-job-test

index 7296349fd0497cfb147593ddf8ffd02b20bd52be..678fc1ee40ac56aed0ba70f021b29c20038675e9 100755 (executable)
@@ -116,7 +116,7 @@ list volumes
 @#setdebug level=51 storage=DiskChanger
 @#setdebug level=100 storage=File tags=dedup,asx,network options=h
 dedup rehydra_check_hash=1
-run job=copy-job $run_spooldata yes
+run job=copy-job $run_spooldata comment="from control job" yes
 wait
 messages
 @#purge volume=FileVolume001
@@ -152,6 +152,8 @@ yes
 list volumes
 wait
 messages
+@$out $tmp/log4.out
+.jlist jobid=6
 quit
 END_OF_DATA
 
@@ -168,4 +170,11 @@ if [ $? != 0 ]; then
     print_debug "The incremental job must use copied jobs"
 fi
 
+grep '{' $tmp/log4.out | perl -MJSON -e '$j = decode_json(<>); exit ($j->{data}->[0]->{comment} eq "from control job" && $j->{data}->[0]->{controljobid} == 5);'
+
+if [ $? = 0 ]; then
+    print_debug "Incorrect comment or controljobid SQL field"
+    estat=1
+fi
+
 end_test