From f3df2d7b806989902777651a3cdd498d47e40faf Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Wed, 17 Nov 2010 13:58:31 +0000 Subject: [PATCH] --- Makefile.am | 17 +++++++++++++---- tests/l4-rsync-data.sh | 40 +++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index 046ae76..0959cdd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,8 @@ dist_example_DATA = \ examples/limagemagic.lua \ examples/lrsync.lua \ examples/lrsyncssh.lua +TESTS = tests/l4-rsync-data.sh + if RUNNER @@ -21,11 +23,18 @@ else # or compiles it into the binary lsyncd: luac.o $(lsyncd_LDADD) -architecture: | lsyncd.o - objdump -f lsyncd.o | grep architecture | sed -e "s/,.*$$//" -e "s/[^ ]* \(.*\)/\1/" > $@ || rm architecture +objarch: | lsyncd.o + objdump -f lsyncd.o | grep architecture | \ + sed -e "s/,.*$$//" -e "s/[^ ]* \(.*\)/\1/" > $@ || rm $@ -luac.o: luac.out architecture - objcopy --input-target=binary --output-target=`gcc -dumpmachine` --binary-architecture=`cat architecture` $< $@ +objtarget: | lsyncd.o + objdump -f lsyncd.o | grep "file format" | \ + sed -e "s/.* \(.*\)/\1/" > $@ || rm $@ + +luac.o: luac.out objarch objtarget + objcopy --input-target=binary \ + --output-target=`cat objtarget` \ + --binary-architecture=`cat objarch` $< $@ luac.out: lsyncd.lua luac $< diff --git a/tests/l4-rsync-data.sh b/tests/l4-rsync-data.sh index fdfa56a..1580176 100755 --- a/tests/l4-rsync-data.sh +++ b/tests/l4-rsync-data.sh @@ -1,4 +1,8 @@ #!/bin/bash + +RANGE=1 +LOG="-log all" + set -e C1="\E[47;34m" C0="\033[0m" @@ -25,28 +29,29 @@ mkdir -p "$S"/d/e echo 'test' > "$S"/d/e/f1 echo -e "$C1* starting lsyncd$C0" # lets bash detatch Lsyncd instead of itself; lets it log stdout as well. -./lsyncd -logfile "$L" -pidfile "$P" -rsync -nodaemon "$S" "$T" & +echo ./lsyncd $LOG -logfile "$L" -pidfile "$P" -nodaemon -rsync "$S" "$T" +./lsyncd $LOG -logfile "$L" -pidfile "$P" -nodaemon -rsync "$S" "$T" & echo -e "$C1* waiting for lsyncd to start$C0" sleep 4s # cp -r the directory echo -e "$C1* making some data$CO" -for i in 1 2 3 4 5 6 7 8 9 10; do +for i in $RANGE; do cp -r "$S"/d "$S"/d${i} echo 'test2' > "$S"/d${i}/e/f2 done -mkdir -p "$S"/m/n -echo 'test3' > "$S"/m/n/file -for i in 1 2 3 4 5 6 7 8 9 10; do - cp -r "$S"/m "$S"/m$i - echo 'test4' > "$S"/m${i}/n/another -done +#mkdir -p "$S"/m/n +#echo 'test3' > "$S"/m/n/file +#for i in $RANGE; do +# cp -r "$S"/m "$S"/m$i +# echo 'test4' > "$S"/m${i}/n/another +#done -echo -e "$C1* waiting for lsyncd to do its job.$C0" -sleep 10s +echo -e "$C1* waiting for Lsyncd to do its job.$C0" +sleep 30s -echo -e "$CON* killing lsyncd$COFF" +echo -e "$C1* killing Lsyncd$C0" PID=$(cat "$P") if ! kill "$PID"; then cat "$L" @@ -56,15 +61,8 @@ if ! kill "$PID"; then fi sleep 1s -#echo "log file contents" -#cat "${LOGFILE}" -##this should be grep. +echo -e "$C1* differences$C0" +diff -urN "$S" "$T" -echo -e "$CON* differences$COFF" -diff -urN "${WORKSOURCE}" "${WORKTARGET}" - -rm "${PIDFILE}" -rm "${LOGFILE}" -rm -rf "${WORKTARGET}" -rm -rf "${WORKSOURCE}" +#rm -rf "$R"