mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-08 17:24:06 +00:00
very colorful scripts now
This commit is contained in:
parent
3e8050172f
commit
05b189d517
@ -36,10 +36,10 @@ for A in 1 2 3 4 5 6 7 8 9 10; do
|
|||||||
echo 'test2' > "${WORKSOURCE}"/d${A}/a/another
|
echo 'test2' > "${WORKSOURCE}"/d${A}/a/another
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "$CON*waiting until lsyncd does the job.$COFF"
|
echo -e "$CON* waiting for lsyncd to do the job.$COFF"
|
||||||
sleep 20s
|
sleep 20s
|
||||||
|
|
||||||
echo -e "$CON*killing lsyncd$COFF"
|
echo -e "$CON* killing lsyncd$COFF"
|
||||||
LSYNCPID=$(cat "${PIDFILE}")
|
LSYNCPID=$(cat "${PIDFILE}")
|
||||||
if ! kill "${LSYNCPID}"; then
|
if ! kill "${LSYNCPID}"; then
|
||||||
cat "${LOGFILE}"
|
cat "${LOGFILE}"
|
||||||
@ -53,10 +53,11 @@ sleep 1s
|
|||||||
#cat "${LOGFILE}"
|
#cat "${LOGFILE}"
|
||||||
##this should be grep.
|
##this should be grep.
|
||||||
|
|
||||||
echo -e "$CON*differences$COFF"
|
echo -e "$CON* differences$COFF"
|
||||||
diff -urN "${WORKSOURCE}" "${WORKTARGET}"
|
diff -urN "${WORKSOURCE}" "${WORKTARGET}"
|
||||||
|
|
||||||
rm "${PIDFILE}"
|
rm "${PIDFILE}"
|
||||||
rm "${LOGFILE}"
|
rm "${LOGFILE}"
|
||||||
rm -rf "${WORKTARGET}"
|
rm -rf "${WORKTARGET}"
|
||||||
rm -rf "${WORKSOURCE}"
|
rm -rf "${WORKSOURCE}"
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
CON="\E[47;34m"
|
||||||
|
COFF="\033[0m"
|
||||||
|
|
||||||
|
echo -e "$CON**************************************************$COFF"
|
||||||
|
echo -e "$CON** Checking if lsyncd writes a correct pidfile. **$COFF"
|
||||||
|
echo -e "$CON**************************************************$COFF"
|
||||||
|
|
||||||
WORKTARGET=$(mktemp -d)
|
WORKTARGET=$(mktemp -d)
|
||||||
PIDFILE=$(mktemp)
|
PIDFILE=$(mktemp)
|
||||||
|
@ -2,10 +2,14 @@
|
|||||||
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
||||||
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
||||||
|
|
||||||
# test that --version outputs some kind of version message and exit code of 0
|
|
||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
CON="\E[47;34m"
|
||||||
|
COFF="\033[0m"
|
||||||
|
|
||||||
|
echo -e "$CON******************************************************************************$COFF"
|
||||||
|
echo -e "$CON* Testing that --version outputs some kind of version message and exit code 0.$COFF"
|
||||||
|
echo -e "$CON******************************************************************************$COFF"
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
./lsyncd --version | grep '^Version: '
|
./lsyncd --version | grep '^Version: '
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
||||||
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
||||||
|
set -e
|
||||||
|
CON="\E[47;34m"
|
||||||
|
COFF="\033[0m"
|
||||||
|
|
||||||
# make sure wrong logfile specification gives a reasonable error
|
echo -e "$CON*****************************************************************$COFF"
|
||||||
# message
|
echo -e "$CON* Testing that a wrong logfile spec. gives a reasonable error. **$COFF"
|
||||||
|
echo -e "$CON*****************************************************************$COFF"
|
||||||
|
|
||||||
WORKTARGET=$(mktemp -d)
|
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
|
||||||
|
@ -2,8 +2,13 @@
|
|||||||
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
# copyright 2008 Junichi Uekawa <dancer@debian.org>
|
||||||
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
# licensed under GPLv2 or later, see the file ../COPYING for details.
|
||||||
|
|
||||||
# make sure that program exits with exit code of -1 when rsync path is
|
#set -e <- explicitly not!
|
||||||
# wrong.
|
CON="\E[47;34m"
|
||||||
|
COFF="\033[0m"
|
||||||
|
|
||||||
|
echo -e "$CON******************************************************************$COFF"
|
||||||
|
echo -e "$CON* Testing if lsyncd exits with -1 when the rsync path is wrong. **$COFF"
|
||||||
|
echo -e "$CON******************************************************************$COFF"
|
||||||
|
|
||||||
WORKTARGET=$(mktemp -d)
|
WORKTARGET=$(mktemp -d)
|
||||||
./lsyncd --no-daemon --binary /wrong/path/to/rsync . "${WORKTARGET}"
|
./lsyncd --no-daemon --binary /wrong/path/to/rsync . "${WORKTARGET}"
|
||||||
@ -13,4 +18,3 @@ if [[ $? = 3 ]]; then
|
|||||||
else
|
else
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user