Merge branch 'u2_10_12_branch' of git://git.code.sf.net/p/undernet-ircu/ircu2
[ircu2.10.12-pk.git] / ircd / test / run-tests.sh
diff --git a/ircd/test/run-tests.sh b/ircd/test/run-tests.sh
new file mode 100755 (executable)
index 0000000..d16cf04
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+set -e
+srcdir=`dirname $0`
+ircdir=$1
+
+cp ${srcdir}/ircd-t1.conf ircd-t1.conf
+cp ${srcdir}/ircd-t2.conf ircd-t2.conf
+echo "Testing one-shot ircd invocations."
+${ircdir}/ircd -v
+${ircdir}/ircd -x 6 -k -d . -f ircd-t1.conf -c user@127.0.0.1
+echo "Starting ircd."
+${ircdir}/ircd -d . -f ircd-t1.conf
+${ircdir}/ircd -d . -f ircd-t2.conf
+sleep 10
+# stats-1 is out of alphabetical order to avoid triggering IPcheck.
+for script in channel-1 client-1 commands-1 feature-1 gline-1 stats-1 jupe-1 kill-block-1 ; do
+  echo "Running test $script."
+  ${srcdir}/test-driver.pl -D ${srcdir}/${script}.cmd 2> ${script}.log
+done
+echo "Sending signals to server."
+cp ${srcdir}/ircd-t1-2.conf ircd-t1.conf
+kill -HUP `cat ircd-t1.pid`
+sleep 1
+kill -INT `cat ircd-t1.pid`
+# A long sleep is necessary to make the server flush its IPcheck entries.
+sleep 610
+kill -TERM `cat ircd-t1.pid` `cat ircd-t2.pid`
+sleep 1
+${ircdir}/ircd -? || true