]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/copy-time-test
Verify if the Exclude Dir Containing directive does his job
[bacula/bacula] / regress / tests / copy-time-test
index bdea3274947b31651f90379851c17595cb3ba97b..f5d926024fdf047b2b0059fa8493eb13b81c37e7 100755 (executable)
@@ -14,8 +14,8 @@ scripts/cleanup
 scripts/copy-migration-confs
 scripts/prepare-disk-changer
 echo "${cwd}/build" >${cwd}/tmp/file-list
-sed -i 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf
-sed -i 's/Migrate/Copy/g' ${cwd}/bin/bacula-dir.conf
+sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
+sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
 
 change_jobname NightlySave $JobName
 start_test
@@ -28,7 +28,7 @@ start_test
 
 # Write out bconsole commands
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
-@output
+@$out /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
 label storage=File volume=FileVolume001 Pool=Default
@@ -69,7 +69,6 @@ done
 yes
 wait
 messages
-@output
 quit
 END_OF_DATA
 
@@ -77,14 +76,16 @@ run_bacula
 check_for_zombie_jobs storage=File
 stop_bacula
 
-print_debug "We must find 3 copy jobs into the log"
-for i in 0 1 2; do
+for i in 1 2 3; do
     get_mig_info $i ${cwd}/tmp/log1.out
-    set $RET >/dev/null
 
-    if [ -n "$1" -a "$1" != 1 ]; then
+    if [ "$i" -eq 1 -a -n "$RET" ]; then
         bstat=2
-        print_debug "The first job should not been copied"
+        print_debug "The first job should not have been copied"
+
+    elif [ "$i" -ne 1 -a -z "$RET" ]; then
+        bstat=2
+        print_debug "Other job should have been copied"
     fi
 done