]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/prepare-fake-autochanger.in
update configure
[bacula/bacula] / regress / scripts / prepare-fake-autochanger.in
index f4f394d0af53e5613b0bc178acc52771a5271b2e..f272635142e940ac97993086ed54307ea944e62b 100644 (file)
@@ -5,38 +5,47 @@
 
 . scripts/functions
 
-# check if user wants to run this test
-if test x$USE_VTAPE = x; then
-    exit 1
-fi
-
 adir=@working_dir@/ach
+rm -rf $adir
 
 mkdir $adir 2> /dev/null
-rm -f $adir/log $adir/barcodes $adir/load* $adir/slot* $adir/drive* 2> /dev/null
+
+# work with $1 slots by default
+nb_slot=${1:-80}
 
 # create the autochanger configuration file
 cat > $adir/conf <<EOF
 maxdrive=8
-maxslot=80
+maxslot=$nb_slot
 dbgfile=$adir/log
+
+#case $2 in
+#list|slots)
+#   sleep 2
+#   ;;
+#*)
+#   sleep 5
+#   ;;
+#esac
 EOF
 
 # turn on ach debug
 touch $adir/log
 
-# create 75 volumes
-for i in `seq 1 75`; do
-    echo $i:vol$i >> $adir/barcodes
-    cp /dev/null $adir/slot$i
+nb_vol=`expr $nb_slot - 5`
+# create $nb_vol volumes
+for i in `seq 1 $nb_vol`; do
+   echo $i:vol$i >> $adir/barcodes
+   cp /dev/null $adir/slot$i
 done
 
 # make a cleaning tape
-echo 76:CLN01 >> $adir/barcodes
-cp /dev/null $adir/slot76
+cln_slot=`expr $nb_vol + 1`
+echo $cln_slot:CLN01 >> $adir/barcodes
+cp /dev/null $adir/slot$cnl_slot
 
 # keep other empty
-for i in `seq 77 79`; do
-    echo $i:  >> $adir/barcodes
+next_empty=`expr $cnl_slot + 1`
+for i in `seq $next_empty $nb_slot`; do
+   echo $i:  >> $adir/barcodes
 done
-