]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/base-job-test
regress: add function to create many dirs
[bacula/bacula] / regress / tests / base-job-test
index be537e858a35664f97de4d0e67158bb47af68638..6eada768e14214ea605a3c4dc07c9f1d50253221 100755 (executable)
@@ -10,8 +10,11 @@ JobName=backup
 $rscripts/cleanup
 
 copy_test_confs
-sed 's/backup_advance/base_backup/' $rscripts/bacula-dir.conf.accurate > $tmp/1
-sed 's/Name = backup/Name = backup; Base = base_backup, backup/' $tmp/1 > $conf/bacula-dir.conf
+echo 's/backup_advance/base_backup/' > $tmp/s
+echo 's/Name = backup/Name = backup; Base = base_backup, backup/' >> $tmp/s
+sed -f $tmp/s $rscripts/bacula-dir.conf.accurate > $conf/bacula-dir.conf
+rm -f $tmp/s
+
 sed s/all,/all,saved,/ $conf/bacula-fd.conf > tmp/1
 cp tmp/1 $conf/bacula-fd.conf
 
@@ -55,37 +58,11 @@ END_OF_DATA
 
 run_bacula
 
-cat <<END_OF_DATA >${cwd}/tmp/bconcmds
-@$out ${cwd}/tmp/log1.out
-run job=backup level=full yes
-wait
-messages
-@# 
-@# now do a restore
-@#
-@$out ${cwd}/tmp/log2.out  
-restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@$out
-END_OF_DATA
-
 ################################################################
-p First :  We just run a full backup and restore
+p Now do a backup using base backup
 ################################################################
 
-run_bconsole
-check_for_zombie_jobs storage=File
-
-check_two_logs
-check_restore_diff
-
-rm -rf ${cwd}/tmp/bacula-restores
-
-################################################################
-p Now do a second backup using base backup
-################################################################
+echo ${cwd}/bin >> ${cwd}/tmp/file-list
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log1.out
@@ -93,6 +70,14 @@ run job=base_backup level=base yes
 wait
 messages
 update volume=TestVolume001 volstatus=Used
+END_OF_DATA
+
+run_bconsole
+
+echo ${cwd}/build > ${cwd}/tmp/file-list
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out ${cwd}/tmp/log4.out
 label volume=TestVolume002 storage=File pool=Default
 run job=backup level=full yes
 wait
@@ -116,8 +101,14 @@ check_restore_diff
 
 rm -rf ${cwd}/tmp/bacula-restores
 
+grep -e 'FD Bytes Written: *0' ${cwd}/tmp/log4.out > /dev/null
+if [ $? -ne 0 ]; then
+    print_debug "The first full job should have 0 byte in log4.out"
+    bstat=2
+fi
+
 ################################################################
-p Now do a third backup after making few changes
+p Now do a backup after making few changes
 ################################################################
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log1.out
@@ -149,7 +140,6 @@ check_files_written ${cwd}/tmp/log1.out 4
 
 rm -rf ${cwd}/tmp/bacula-restores
 
-
 ################################################################
 p Test the job purge
 ################################################################
@@ -170,8 +160,36 @@ run_bconsole
 grep -e ' 0 *|' ${cwd}/tmp/log3.out > /dev/null
 if [ $? -ne 0 ]; then
     print_debug "Can't purge the base job"
-    dstat=2
+    estat=1
+fi
+
+
+################################################################
+p Test list commands
+################################################################
+
+touch ${cwd}/build/po/fr.po
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+run level=full job=backup yes
+wait
+messages
+@out ${cwd}/tmp/log5.out
+list basefiles jobid=6
+@out ${cwd}/tmp/log6.out
+list files jobid=6
+messages
+END_OF_DATA
+
+run_bconsole
+
+grep "po/fr.po^" ${cwd}/tmp/log5.out > /dev/null
+if [ $? -eq 0 ]; then
+    print_debug "Should not display fr.po as basefile"
+    estat=2
 fi
 
+export bstat dstat estat
+
 stop_bacula
 end_test