This commit is contained in:
Axel Kittenberger 2010-11-17 13:58:31 +00:00
parent f52a5caa88
commit f3df2d7b80
2 changed files with 32 additions and 25 deletions

View File

@ -9,6 +9,8 @@ dist_example_DATA = \
examples/limagemagic.lua \ examples/limagemagic.lua \
examples/lrsync.lua \ examples/lrsync.lua \
examples/lrsyncssh.lua examples/lrsyncssh.lua
TESTS = tests/l4-rsync-data.sh
if RUNNER if RUNNER
@ -21,11 +23,18 @@ else
# or compiles it into the binary # or compiles it into the binary
lsyncd: luac.o $(lsyncd_LDADD) lsyncd: luac.o $(lsyncd_LDADD)
architecture: | lsyncd.o objarch: | lsyncd.o
objdump -f lsyncd.o | grep architecture | sed -e "s/,.*$$//" -e "s/[^ ]* \(.*\)/\1/" > $@ || rm architecture objdump -f lsyncd.o | grep architecture | \
sed -e "s/,.*$$//" -e "s/[^ ]* \(.*\)/\1/" > $@ || rm $@
luac.o: luac.out architecture objtarget: | lsyncd.o
objcopy --input-target=binary --output-target=`gcc -dumpmachine` --binary-architecture=`cat architecture` $< $@ 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.out: lsyncd.lua
luac $< luac $<

View File

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
RANGE=1
LOG="-log all"
set -e set -e
C1="\E[47;34m" C1="\E[47;34m"
C0="\033[0m" C0="\033[0m"
@ -25,28 +29,29 @@ mkdir -p "$S"/d/e
echo 'test' > "$S"/d/e/f1 echo 'test' > "$S"/d/e/f1
echo -e "$C1* starting lsyncd$C0" echo -e "$C1* starting lsyncd$C0"
# lets bash detatch Lsyncd instead of itself; lets it log stdout as well. # 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" echo -e "$C1* waiting for lsyncd to start$C0"
sleep 4s sleep 4s
# cp -r the directory # cp -r the directory
echo -e "$C1* making some data$CO" 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} cp -r "$S"/d "$S"/d${i}
echo 'test2' > "$S"/d${i}/e/f2 echo 'test2' > "$S"/d${i}/e/f2
done done
mkdir -p "$S"/m/n #mkdir -p "$S"/m/n
echo 'test3' > "$S"/m/n/file #echo 'test3' > "$S"/m/n/file
for i in 1 2 3 4 5 6 7 8 9 10; do #for i in $RANGE; do
cp -r "$S"/m "$S"/m$i # cp -r "$S"/m "$S"/m$i
echo 'test4' > "$S"/m${i}/n/another # echo 'test4' > "$S"/m${i}/n/another
done #done
echo -e "$C1* waiting for lsyncd to do its job.$C0" echo -e "$C1* waiting for Lsyncd to do its job.$C0"
sleep 10s sleep 30s
echo -e "$CON* killing lsyncd$COFF" echo -e "$C1* killing Lsyncd$C0"
PID=$(cat "$P") PID=$(cat "$P")
if ! kill "$PID"; then if ! kill "$PID"; then
cat "$L" cat "$L"
@ -56,15 +61,8 @@ if ! kill "$PID"; then
fi fi
sleep 1s sleep 1s
#echo "log file contents" echo -e "$C1* differences$C0"
#cat "${LOGFILE}" diff -urN "$S" "$T"
##this should be grep.
echo -e "$CON* differences$COFF" #rm -rf "$R"
diff -urN "${WORKSOURCE}" "${WORKTARGET}"
rm "${PIDFILE}"
rm "${LOGFILE}"
rm -rf "${WORKTARGET}"
rm -rf "${WORKSOURCE}"