s3:tests: move the log directory of the smbclient_s3 test to st/
authorMichael Adam <obnox@samba.org>
Mon, 21 Feb 2011 11:48:48 +0000 (12:48 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 21 Feb 2011 12:39:06 +0000 (13:39 +0100)
And use a proper mktemp call to create a unique name.
The old location under /tmp/ was bad.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Feb 21 13:39:06 CET 2011 on sn-devel-104

source3/script/tests/test_smbclient_s3.sh

index 08ed3b7729fa3eea2b40022d5b2890466e2d52ab..a7c07753ade29511bb48264e074913bab161c60b 100755 (executable)
@@ -389,15 +389,16 @@ test_ccache_access()
     $WBINFO --logoff
 }
 
-LOGDIR=/tmp/log.test_smbclient_s3.$$
+LOGDIR_PREFIX=test_smbclient_s3
 
-testit "rm -rf $LOGDIR" \
-    rm -rf $LOGDIR || \
-    exit 1
+# possibly remove old logdirs:
+
+for OLDDIR in $(find ${PREFIX} -type d -name "${LOGDIR_PREFIX}_*") ;  do
+       echo "removing old directory ${OLDDIR}"
+       rm -rf ${OLDDIR}
+done
 
-testit "mkdir -p $LOGDIR" \
-    mkdir -p $LOGDIR || \
-    exit 1
+LOGDIR=$(mktemp -d --tmpdir=$PREFIX ${LOGDIR_PREFIX}_XXXX)
 
 
 testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`