Initial test framework: make check
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
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
|
Reference in New Issue
Block a user