diff --git a/tests/directorycpr.sh b/tests/directorycpr.sh index 2b6a7bd..0ee2b9e 100755 --- a/tests/directorycpr.sh +++ b/tests/directorycpr.sh @@ -14,7 +14,7 @@ echo 'test' > "${WORKSOURCE}"/a/a/file ./lsyncd --logfile "${LOGFILE}" --pidfile "${PIDFILE}" "${WORKSOURCE}" "${WORKTARGET}" -# try to wait until lsyncd starts and rsyncs initial file, hope 1s is enough. +# try to wait until lsyncd starts and rsyncs initial file, hope 4s is enough. sleep 4s # cp -r the directory, this sometimes succeeds, sometimes fails. diff --git a/tests/directorymv.sh b/tests/directorymv.sh index 9a89f74..cbf62bf 100755 --- a/tests/directorymv.sh +++ b/tests/directorymv.sh @@ -8,6 +8,9 @@ WORKTARGET=$(mktemp -d) PIDFILE=$(mktemp) LOGFILE=$(mktemp) +echo $WORKSOURCE +echo $WORKTARGET +echo $PIDFILE # populate the filesystem. mkdir "${WORKSOURCE}"/a @@ -15,22 +18,28 @@ mkdir "${WORKSOURCE}"/b touch "${WORKSOURCE}"/a/f touch "${WORKSOURCE}"/b/g +echo ./lsyncd --logfile "${LOGFILE}" --pidfile "${PIDFILE}" "${WORKSOURCE}" "${WORKTARGET}" ./lsyncd --logfile "${LOGFILE}" --pidfile "${PIDFILE}" "${WORKSOURCE}" "${WORKTARGET}" +LSYNCPID=$(cat "${PIDFILE}") -# try to wait until lsyncd starts and rsyncs initial file, hope 1s is enough. +# try to wait until lsyncd starts and rsyncs initial file, hope 2s is enough. sleep 2s # move a file +echo "moving a directory" mv "${WORKSOURCE}"/a "${WORKSOURCE}"/c +echo "create a file there" touch "${WORKSOURCE}"/c/h +echo "and delete a directory" #lsyncd 1.0 dies here rm -r "${WORKSOURCE}"/b +echo "wait for events to trigger" # try to wait until lsyncd does the job. -sleep 2s +sleep 10s +echo "killing daemon" -LSYNCPID=$(cat "${PIDFILE}") if ! kill "${LSYNCPID}"; then cat "${LOGFILE}" diff -ur "${WORKSOURCE}" "${WORKTARGET}" || true @@ -46,7 +55,7 @@ cat "${LOGFILE}" diff -ur "${WORKSOURCE}" "${WORKTARGET}" -rm "${PIDFILE}" -rm "${LOGFILE}" -rm -rf "${WORKTARGET}" -rm -rf "${WORKSOURCE}" +#rm "${PIDFILE}" +#rm "${LOGFILE}" +#rm -rf "${WORKTARGET}" +#rm -rf "${WORKSOURCE}" diff --git a/tests/wrong-logfile.sh b/tests/wrong-logfile.sh index 53d38df..256b06f 100755 --- a/tests/wrong-logfile.sh +++ b/tests/wrong-logfile.sh @@ -6,7 +6,7 @@ # message WORKTARGET=$(mktemp -d) -if [[ $( ./lsyncd --logfile /nonexisting/path/name . "${WORKTARGET}" 2>&1 ) =~ "cannot open logfile [/nonexisting/path/name]!" ]]; then +if [[ $( ./lsyncd --logfile /nonexisting/path/name . "${WORKTARGET}" 2>&1 ) == "cannot open logfile [/nonexisting/path/name]!" ]]; then rmdir "${WORKTARGET}" exit 0; else