]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/vtape-test-changer
regress: add function to create many dirs
[bacula/bacula] / regress / tests / vtape-test-changer
index de3fdacc590449c13c0ac3dd3662d6f4cccb22d8..fabbbcb69a4dd6e8e3778664cf31c60ba3d2afa9 100755 (executable)
@@ -19,8 +19,8 @@ require_vtape
 
 scripts/cleanup
 scripts/copy-tape-confs
-cp scripts/bacula-dir-vtape.conf bin/bacula-dir.conf
-cp scripts/bacula-sd-vtape.conf bin/bacula-sd.conf
+cp $rscripts/bacula-dir-vtape.conf $conf/bacula-dir.conf
+cp $rscripts/bacula-sd-vtape.conf $conf/bacula-sd.conf
 scripts/prepare-fake-autochanger
 
 echo "${cwd}/build" >${cwd}/tmp/file-list
@@ -37,7 +37,7 @@ clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir
 
 # Write out bconsole commands
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out ${cwd}/tmp/log6.out
 @#setdebug level=200 storage=LTO1
@@ -50,7 +50,6 @@ list volumes
 END_OF_DATA
 
 run_bacula
-stop_bacula
 
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log7.out
@@ -74,7 +73,7 @@ messages
 quit
 END_OF_DATA
 
-run_bacula
+run_bconsole
 check_for_zombie_jobs storage=LTO1 $clientname
 check_for_zombie_jobs storage=LTO3 $clientname
 check_for_zombie_jobs storage=LTO1-ANSI_6 $clientname
@@ -89,7 +88,7 @@ messages
 @# 
 @# now do a restore
 @#
-restore fileset="Full Set" pool=Diff where=${cwd}/tmp/bacula-restores select all done
+restore client=$clientname fileset="Full Set" pool=Diff where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
 messages
@@ -101,11 +100,34 @@ run_bconsole
 check_for_zombie_jobs storage=LTO1 $clientname
 check_for_zombie_jobs storage=LTO3 $clientname
 check_for_zombie_jobs storage=LTO1-ANSI_6 $clientname
+
+# test update slots
+# remove volume vol20 from autochanger
+grep -v vol20 ${cwd}/working/ach/barcodes > ${cwd}/tmp/1
+cp ${cwd}/tmp/1 ${cwd}/working/ach/barcodes
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out ${cwd}/tmp/log3.out
+list volume=vol20
+update slots slots=5-40 storage=LTO1 drive=3
+list volume=vol20
+END_OF_DATA
+
+run_bconsole
+
 stop_bacula
 
 check_two_logs
 check_restore_diff
 
+# get InChanger flag
+RES=`awk -F'|' '/vol20.+Append/ { print $11 }' ${cwd}/tmp/log3.out`
+set $RES
+if [ $1 -eq $2 ]; then
+    echo "Error in update slots"
+    bstat=1
+fi
+
 grep LTO1_5 tmp/log1.out > /dev/null
 if test $? = 0; then
     echo "AutoSelect option broken"
@@ -119,4 +141,3 @@ if test $? = 0; then
 fi
 
 end_test
-