3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Test the "comment" option of "run" command
10 TestName="comment-test"
15 ${rscripts}/copy-test-confs
16 echo "${tmpsrc}" >${tmp}/file-list
18 cp -p ${src}/src/dird/*.c ${tmpsrc}
20 echo "${tmpsrc}/ficheriro1.txt" >restore-list
21 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
24 change_jobname CompressedTest $JobName
27 cat <<END_OF_DATA >${tmp}/bconcmds
31 run comment="This is a comment for $JobName" job=$JobName yes
35 label storage=File volume=TestVolume001
41 SELECT Comment FROM Job WHERE JobId=1;
47 check_for_zombie_jobs storage=File
49 # Now create two new files to be restored later
52 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
53 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
55 cat <<END_OF_DATA >${tmp}/bconcmds
59 @# Force Incremental on the second Volume
60 update volume=TestVolume001 VolStatus=Used
61 run comment="This is the incremental job" level=Differential job=$JobName yes
64 label storage=File volume=TestVolume002
70 SELECT Comment FROM Job WHERE JobId=2;
77 cat <<END_OF_DATA >${tmp}/bconcmds
84 restore comment="Ticket #1220 requested by toto@bacula.org" where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
91 SELECT Comment FROM Job WHERE JobId=3;
97 check_for_zombie_jobs storage=File
102 # Delete .c files because we will only restored the txt files
105 check_restore_tmp_build_diff
107 grep "This is a comment for $JobName" $tmp/log3.out >/dev/null
109 print_debug "ERR: Can't find comment"
112 grep "Ticket #1220 requested by toto@bacula.org" $tmp/log3.out >/dev/null
114 print_debug "ERR: Can't find comment"
117 grep "This is the incremental job" $tmp/log3.out >/dev/null
119 print_debug "ERR: Can't find comment"