lsyncd/tests/wrong-logfile.sh

21 lines
675 B
Bash
Raw Normal View History

2008-10-06 20:35:52 +00:00
#!/bin/bash
# copyright 2008 Junichi Uekawa <dancer@debian.org>
# licensed under GPLv2 or later, see the file ../COPYING for details.
2010-08-03 15:13:18 +00:00
set -e
CON="\E[47;34m"
COFF="\033[0m"
2008-10-06 20:35:52 +00:00
2010-08-03 15:13:18 +00:00
echo -e "$CON*****************************************************************$COFF"
echo -e "$CON* Testing that a wrong logfile spec. gives a reasonable error. **$COFF"
echo -e "$CON*****************************************************************$COFF"
2008-10-06 20:35:52 +00:00
WORKTARGET=$(mktemp -d)
2010-05-22 16:24:16 +00:00
if [[ $( ./lsyncd --logfile /nonexisting/path/name . "${WORKTARGET}" 2>&1 ) == "cannot open logfile [/nonexisting/path/name]!" ]]; then
2008-10-06 20:35:52 +00:00
rmdir "${WORKTARGET}"
exit 0;
else
2008-12-05 22:26:03 +00:00
rmdir "${WORKTARGET}"
2008-10-06 20:35:52 +00:00
exit 1;
fi
2008-12-05 22:26:03 +00:00