]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/cleanup-tape.in
ebl update for next-vol test
[bacula/bacula] / regress / scripts / cleanup-tape.in
index e5ebe56344bf27fbea19c4f949826f96f5c06915..936540289db983a13199aa913ac319d654e000ef 100755 (executable)
@@ -1,16 +1,26 @@
 #!/bin/sh
 #
-# Cleanup left over files -- both before and after test run
+# Cleanup left over files, then load $SLOT1 into drive and    
+#   write an EOF on it.
 #
-. ./config
+
+. scripts/functions
 
 scripts/cleanup
 
-if test "x@autochanger@" != "x/dev/null" ; then
-   a=`bin/mtx-changer @autochanger@ loaded $SLOT1 @tape_drive@ 0`
-   if test $a = 0 ; then
-     bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ 0
-   fi
+if test x@autochanger@ != x/dev/null; then
+   slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
+   case $slot in
+   0)
+      bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+      ;;
+   $SLOT1)
+      ;;
+   default)
+      bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+      bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+      ;;
+  esac
 fi
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
+
+init_drive @tape_drive@