Initial test framework: make check
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
ec9c92987f
commit
b67d57cf59
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ klogd.service
|
|||||||
missing
|
missing
|
||||||
stamp-h1
|
stamp-h1
|
||||||
syslogd.service
|
syslogd.service
|
||||||
|
test-driver
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
SUBDIRS = src man
|
SUBDIRS = man src test
|
||||||
doc_DATA = README.md ChangeLog.md syslog.conf
|
doc_DATA = README.md ChangeLog.md syslog.conf
|
||||||
EXTRA_DIST = README.md ChangeLog.md syslog.conf
|
EXTRA_DIST = README.md ChangeLog.md syslog.conf
|
||||||
|
|
||||||
|
@ -23,7 +23,12 @@ AM_SILENT_RULES([yes])
|
|||||||
|
|
||||||
AC_CONFIG_SRCDIR([src/syslogd.c])
|
AC_CONFIG_SRCDIR([src/syslogd.c])
|
||||||
AC_CONFIG_HEADER([config.h])
|
AC_CONFIG_HEADER([config.h])
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile klogd.service syslogd.service])
|
AC_CONFIG_FILES([Makefile
|
||||||
|
man/Makefile
|
||||||
|
src/Makefile
|
||||||
|
test/Makefile
|
||||||
|
klogd.service
|
||||||
|
syslogd.service])
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
*.* -/tmp/syslog_tst.log
|
|
||||||
*.* @192.168.1.1
|
|
||||||
|
|
2
test/.gitignore
vendored
Normal file
2
test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.log
|
||||||
|
*.trs
|
6
test/Makefile.am
Normal file
6
test/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
EXTRA_DIST = start.sh stop.sh
|
||||||
|
CLEANFILES = *~ *.trs *.log
|
||||||
|
TEST_EXTENSIONS = .sh
|
||||||
|
|
||||||
|
TESTS = start.sh
|
||||||
|
TESTS += stop.sh
|
15
test/start.sh
Executable file
15
test/start.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. ./test.rc
|
||||||
|
|
||||||
|
if [ x"${srcdir}" = x ]; then
|
||||||
|
srcdir=.
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<EOF > ${CFG}
|
||||||
|
*.* -${LOG}
|
||||||
|
*.* @192.168.1.1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
../src/syslogd -d -n -f ${CFG} -p ${SCK} -P ${PID} &
|
||||||
|
|
||||||
|
sleep 1
|
11
test/stop.sh
Executable file
11
test/stop.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. ./test.rc
|
||||||
|
|
||||||
|
if [ -e ${PID} ]; then
|
||||||
|
kill `cat ${PID}`
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f ${CFG}
|
||||||
|
rm -f ${LOG}
|
||||||
|
rm -f ${PID}
|
||||||
|
rm -f ${SCK}
|
5
test/test.rc
Normal file
5
test/test.rc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
NM=syslog-test
|
||||||
|
CFG=/tmp/${NM}.conf
|
||||||
|
LOG=/tmp/${NM}.log
|
||||||
|
PID=/tmp/${NM}.pid
|
||||||
|
SCK=/tmp/${NM}.sock
|
Loading…
Reference in New Issue
Block a user