Test framework for plugins

Initial
Stephane Bortzmeyer 20 years ago
parent aa0d8d6e03
commit 4a8f82f621

@ -11,7 +11,7 @@ DOCS=DETAILS PLUGINS
SUBDIRS=plugins
TESTS=test-echoping-local test-echoping-remote
MORE_TESTS=test-echoping-proxy test-echoping-icp test-echoping-crypto test-echoping-tos test-echoping-ipv6 test-echoping-idn
MORE_TESTS=test-echoping-proxy test-echoping-icp test-echoping-crypto test-echoping-tos test-echoping-ipv6 test-echoping-idn test-echoping-plugins
test: check
tests: check

@ -36,7 +36,7 @@ void start_raw ()
int execute ()
Connects and do whatever the protocol requires. It is called once
per iteration. It returns >=0 if it succeeds, -1 if it failed
temporarily (so echoping will continue its loop) and -2 if it failes
temporarily (so echoping will continue its loop) and -2 if it failed
permanently (so echoping will stop the iteration).
void terminate ()
@ -53,4 +53,7 @@ simplest which still does something useful.
The documentation of the plugin should be in a manual page named
echoping_PLUGINNAME. See the above plugins for examples.
You can write a shell script named test.sh in the plugin directory to
test the plugin. test-echoping-plugins will execute it.
$Id$

@ -0,0 +1,6 @@
#!/bin/sh
# $Id$
../../echoping -m whois -v whois.nic.fr --dump echoping.fr # Does not exist
../../echoping -m whois -v whois.nic.fr --dump nic.fr # Exists

@ -0,0 +1,20 @@
#!/bin/sh
# $Id$
echo ""
echo "Since this tests tries remote servers, a failure is not always "
echo " echoping's fault: it may be a network problem."
echo ""
for plugin in `ls plugins`; do
if [ -d plugins/$plugin ]; then
cd plugins/$plugin
if [ -x test.sh ]; then
echo "Testing $plugin..."
sh ./test.sh
echo ""
fi
cd ../..
fi
done
Loading…
Cancel
Save