Split the 'longdir' test into its own script, and make it work without
authorMartin Pool <mbp@samba.org>
Thu, 6 Sep 2001 05:57:27 +0000 (05:57 +0000)
committerMartin Pool <mbp@samba.org>
Thu, 6 Sep 2001 05:57:27 +0000 (05:57 +0000)
'mkdir -p'.

testsuite/hands.test
testsuite/longdir.test [new file with mode: 0644]
testsuite/rsync.fns

index aeb208d..1c321d4 100644 (file)
@@ -25,12 +25,6 @@ runtest "extra data" 'checkit "$RSYNC -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
 cp ${FROM}/${F1} ${TO}/ThisShouldGo
 runtest " --delete" 'checkit "$RSYNC --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
 
-LONGDIR=${FROM}/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job
-mkdir -p ${LONGDIR}
-date > ${LONGDIR}/1
-ls -la / > ${LONGDIR}/2
-runtest "long paths" 'checkit "$RSYNC --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}'
-
 rm -rf ${TO}
 mkdir -p ${FROM}2/dir/subdir
 cp -a ${FROM}/dir/subdir/subsubdir ${FROM}2/dir/subdir
diff --git a/testsuite/longdir.test b/testsuite/longdir.test
new file mode 100644 (file)
index 0000000..92f9ecf
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Copyright (C) 1998,1999 Philip Hands <phil@hands.com>
+# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
+#
+# This program is distributable under the terms of the GNU GPL (see COPYING)
+
+
+. "$suitedir/rsync.fns"
+
+hands_setup
+
+LONGDIR=${FROM}/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job/This-is-a-directory-with-a-stupidly-long-name-created-in-an-attempt-to-provoke-an-error-found-in-2.0.11-that-should-hopefully-never-appear-again-if-this-test-does-its-job
+
+makepath ${LONGDIR}
+date > ${LONGDIR}/1
+ls -la / > ${LONGDIR}/2
+checkit "$RSYNC --delete -avH ${FROM}/ ${TO}" ${FROM}/ ${TO}
index 8dd91a1..bb3a6e8 100644 (file)
@@ -27,7 +27,14 @@ RSYNC="$rsync_bin"
 
 runtest() {
     echo $ECHO_N "Test $1: $ECHO_C"
-    eval "$2"
+    if eval "$2"
+    then
+       echo "${ECHO_T} done."
+       return 0
+    else
+       echo "${ECHO_T} failed!"
+       return 1
+    fi
 }
 
 printmsg() {
@@ -39,6 +46,10 @@ printmsg() {
 # Build test directories TO and FROM, with FROM full of files.
 
 hands_setup() {
+    # Clean before creation
+    rm -rf $FROM
+    rm -rf $TO
+    
     [ -d $FROM ] || mkdir $FROM
     [ -d $TO ] || mkdir $TO
 
@@ -130,11 +141,9 @@ checkit() {
     ( cd $3 ; ls -laR ) > ${TMP}/ls-to  2>>${log}
     diff -c ${TMP}/ls-from ${TMP}/ls-to >>${log} 2>&1 || failed=YES
     if [ -z "${failed}" ] ; then
-       echo "${ECHO_T} done."
        rm $log
        return 0
     else
-       echo "${ECHO_T} failed!"
        cat ${log}
        rm ${log}
        return 1