]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/prepare-fake-autochanger.in
regress: add remote control functions
[bacula/bacula] / regress / scripts / prepare-fake-autochanger.in
1 #!/bin/sh
2 #
3 # This script will prepare a big dummy autochanger 
4 #
5
6 . scripts/functions
7
8 adir=@working_dir@/ach
9 rm -rf $adir
10
11 mkdir $adir 2> /dev/null
12
13 # work with $1 slots by default
14 nb_slot=${1:-80}
15
16 # create the autochanger configuration file
17 cat > $adir/conf <<EOF
18 maxdrive=8
19 maxslot=$nb_slot
20 dbgfile=$adir/log
21
22 #case $2 in
23 #list|slots)
24 #   sleep 2
25 #   ;;
26 #*)
27 #   sleep 5
28 #   ;;
29 #esac
30 EOF
31
32 # turn on ach debug
33 touch $adir/log
34
35 nb_vol=`expr $nb_slot - 5`
36 # create $nb_vol volumes
37 for i in `seq 1 $nb_vol`; do
38    echo $i:vol$i >> $adir/barcodes
39    cp /dev/null $adir/slot$i
40 done
41
42 # make a cleaning tape
43 cln_slot=`expr $nb_vol + 1`
44 echo $cln_slot:CLN01 >> $adir/barcodes
45 cp /dev/null $adir/slot$cnl_slot
46
47 # keep other empty
48 next_empty=`expr $cnl_slot + 1`
49 for i in `seq $next_empty $nb_slot`; do
50    echo $i:  >> $adir/barcodes
51 done