Test remote dumping with a user specified as well.
[xfstests-dev.git] / common.dump
index 05a7ca789279ebd05a487926370e359274e47812..a0fa43ce1859059d8447b944773efe342d9afb13 100644 (file)
@@ -43,9 +43,11 @@ if [ -n "$DEBUGDUMP" ]; then
   _invutil_debug=-d
 fi
  
-# Use dump/restore out of workareas
-PATH="../dump/dump:../dump/restore:../dump/invutil:$PATH"
-export PATH
+# Use dump/restore in qa directory for debugging
+#PATH=".:$PATH"
+#export PATH
+#which xfsdump
+#which xfsrestore
 
 # status returned for not run tests
 NOTRUNSTS=2
@@ -85,11 +87,17 @@ _mt()
     op=$1
     if _isrmt; then  
        # REMOTE
-       _rmthost=`echo $dumptape | awk -F: '{print $1}'`
        _rmtdev=`echo $dumptape | awk -F: '{print $2}'`
-       rsh -n $_rmthost "mt -t $_rmtdev $op"
-       # Would have used src/testrmt but get
-        # permission denied from linux to linux for erase !?! 
+
+        if echo $dumptape | grep '@' >/dev/null; then
+           _spec=`echo $dumptape | awk -F: '{print $1}'`
+           _rmtuser=`echo $_spec | awk -F@ '{print $1}'`
+           _rmthost=`echo $_spec | awk -F@ '{print $2}'`
+           rsh -n -l $_rmtuser $_rmthost "mt -t $_rmtdev $op"
+       else
+           _rmthost=`echo $dumptape | awk -F: '{print $1}'`
+           rsh -n $_rmthost "mt -t $_rmtdev $op"
+       fi
     else
        #LOCAL
        mt -t $dumptape $op
@@ -170,7 +178,6 @@ _erase_soft()
     echo "Erasing tape" | tee -a $seq.full
     _rewind
     _mt weof 3
-#   src/testrmt -f $dumptape write
     _rewind
 }
 
@@ -201,11 +208,7 @@ _set_variable()
 
 _require_tape()
 {
-    if [ $# -eq 0 ]; then
-       dumptape=$TAPE_DEV
-    else
-       dumptape=$1
-    fi
+    dumptape=$1
 
     if [ -z "$dumptape" ]; then
         echo "This test requires a dump tape - none was specified"
@@ -254,7 +257,7 @@ _cleanup()
 
     # put inventory dir back
     if [ -d /var/xfsdump/inventory.$seq ]; then
-        rm -rf /var/xfsdump/inventory # get rid of new one
+       rm -rf /var/xfsdump/inventory # get rid of new one
        mv /var/xfsdump/inventory.$seq /var/xfsdump/inventory
     fi
 
@@ -275,10 +278,10 @@ _stable_fs()
 }
 
 #
-# Run stress/src/fsstress to create a mixture of 
+# Run src/fsstress to create a mixture of 
 # files,dirs,links,symlinks
 #
-# Pinched from stress/013.
+# Pinched from test 013.
 #
 _create_dumpdir_stress()
 {
@@ -375,7 +378,7 @@ End-of-File
 # Create a bunch of directories/files of different sizes
 # filled with data.
 #
-# Pinched from stress/001.
+# Pinched from test 001.
 #
 _do_create_dumpdir_fill()
 {