s3:tests: clean up old log directories of the registry.roundtrip test
authorMichael Adam <obnox@samba.org>
Mon, 21 Feb 2011 11:48:15 +0000 (12:48 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 21 Feb 2011 11:50:06 +0000 (12:50 +0100)
source3/script/tests/test_net_registry_roundtrip.sh

index 7f13bc2f74336a1d0bd6bafb3b8a97058fb5a16d..88919ec93c50034c837beb3cbab0f526fc80013a 100755 (executable)
@@ -44,9 +44,11 @@ conf_roundtrip_step() {
 #    echo -n .
 }
 
+LOGDIR_PREFIX="conf_roundtrip"
+
 conf_roundtrip()
 {
-    local DIR=$(mktemp -d --tmpdir=$PREFIX conf_roundtrip_XXXX)
+    local DIR=$(mktemp -d --tmpdir=$PREFIX ${LOGDIR_PREFIX}_XXXX)
     local LOG=$DIR/log
 
     echo conf_roundtrip $1 > $LOG
@@ -98,6 +100,12 @@ conf_roundtrip()
 
 CONF_FILES=${CONF_FILES:-$(find $SRCDIR/ -name '*.conf' | xargs grep -l "\[global\]")}
 
+# remove old logs:
+for OLDDIR in $(find ${PREFIX} -type d -name "${LOGDIR_PREFIX}_*") ; do
+       echo "removing old directory ${OLDDIR}"
+       rm -rf ${OLDDIR}
+done
+
 for conf_file in $CONF_FILES
 do
     testit "conf_roundtrip $conf_file" \