From 501972bf72bea1b291afd50e1752cbb007fcd0b6 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 6 Sep 2001 05:57:27 +0000 Subject: [PATCH] Split the 'longdir' test into its own script, and make it work without 'mkdir -p'. --- testsuite/hands.test | 6 ------ testsuite/longdir.test | 18 ++++++++++++++++++ testsuite/rsync.fns | 15 ++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 testsuite/longdir.test diff --git a/testsuite/hands.test b/testsuite/hands.test index aeb208d3..1c321d40 100644 --- a/testsuite/hands.test +++ b/testsuite/hands.test @@ -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 index 00000000..92f9ecfd --- /dev/null +++ b/testsuite/longdir.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Copyright (C) 1998,1999 Philip Hands +# Copyright (C) 2001 by Martin Pool +# +# 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} diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index 8dd91a1b..bb3a6e89 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -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 -- 2.34.1