TestName="auto-label-test"
JobName=AutoLabel
. scripts/functions
-set_debug 0
+
copy_test_confs
-echo "${cwd}/build" >/tmp/file-list
+echo "${cwd}/build" >${cwd}/tmp/file-list
cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
sed "s%# Label Format% Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
change_jobname CompressedTest $JobName
start_test
-cat <<END_OF_SCRIPT >tmp/bconcmds
+cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
@output /dev/null
messages
-@$out tmp/log1.out
+@$out ${cwd}/tmp/log1.out
status all
status all
list pools
list pools
list volumes
wait
+sql
+SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia
+FROM JobMedia join Job using (JobId) join Client using (ClientId)
+where Client.Name = 'localhost-fd' group by JobId, Level, StartTime,
+JobFiles order by JobId desc ;
+
messages
@#
@# now do a restore
@#
-@$out tmp/log2.out
+@$out ${cwd}/tmp/log2.out
+@#setdebug level=400 storage=File
restore where=${cwd}/tmp/bacula-restores select storage=File
unmark *
mark *
END_OF_SCRIPT
run_bacula
-check_for_zombie_jobs storage=File
+check_for_zombie_jobs storage=File || exit 1
stop_bacula
check_two_logs