very colorful scripts now

This commit is contained in:
Axel Kittenberger 2010-08-03 15:13:18 +00:00
parent 3e8050172f
commit 05b189d517
5 changed files with 30 additions and 11 deletions

View File

@ -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
done
echo -e "$CON*waiting until lsyncd does the job.$COFF"
echo -e "$CON* waiting for lsyncd to do the job.$COFF"
sleep 20s
echo -e "$CON*killing lsyncd$COFF"
echo -e "$CON* killing lsyncd$COFF"
LSYNCPID=$(cat "${PIDFILE}")
if ! kill "${LSYNCPID}"; then
cat "${LOGFILE}"
@ -53,10 +53,11 @@ sleep 1s
#cat "${LOGFILE}"
##this should be grep.
echo -e "$CON*differences$COFF"
echo -e "$CON* differences$COFF"
diff -urN "${WORKSOURCE}" "${WORKTARGET}"
rm "${PIDFILE}"
rm "${LOGFILE}"
rm -rf "${WORKTARGET}"
rm -rf "${WORKSOURCE}"

View File

@ -1,5 +1,11 @@
#!/bin/bash
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)
PIDFILE=$(mktemp)

View File

@ -2,10 +2,14 @@
# copyright 2008 Junichi Uekawa <dancer@debian.org>
# 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 -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: '

View File

@ -1,9 +1,13 @@
#!/bin/bash
# copyright 2008 Junichi Uekawa <dancer@debian.org>
# 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
# message
echo -e "$CON*****************************************************************$COFF"
echo -e "$CON* Testing that a wrong logfile spec. gives a reasonable error. **$COFF"
echo -e "$CON*****************************************************************$COFF"
WORKTARGET=$(mktemp -d)
if [[ $( ./lsyncd --logfile /nonexisting/path/name . "${WORKTARGET}" 2>&1 ) == "cannot open logfile [/nonexisting/path/name]!" ]]; then

View File

@ -2,8 +2,13 @@
# copyright 2008 Junichi Uekawa <dancer@debian.org>
# 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
# wrong.
#set -e <- explicitly not!
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)
./lsyncd --no-daemon --binary /wrong/path/to/rsync . "${WORKTARGET}"
@ -13,4 +18,3 @@ if [[ $? = 3 ]]; then
else
exit 1;
fi