1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

tests/eventscripts - Restructure according to new convention

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)
This commit is contained in:
Martin Schwenke 2012-04-16 16:24:12 +10:00
parent a35eca8bda
commit df39a671db
77 changed files with 86 additions and 110 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "no public addresses"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all interfaces up"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "no public addresses"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all interfaces up"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 interface down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all interfaces up, 1 is a bond"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 bond, no active slaves"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 bond, active slaves, link down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "unknown interface, up"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "unknown interface, down, up"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, all down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 bond down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 bond down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 bond, active slaves, link down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "spurious addresses on interface, no action"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "spurious addresses on interface, delete them"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, removeip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "error - no args given"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "error - remove a non-existent ip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "no public addresses"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all interfaces up"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "error - no args given"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "add an ip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "error - add same IP twice"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "not configured"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "missing config, no takeip, ipreallocated"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "empty config, ipreallocated"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "empty config, takeip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, takeip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, takeip, releaseip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, ipreallocated"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, takeip twice"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "All IPs configured, takeip"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "All IPs configured, takeip all on node"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "__auto_link_local__, takeip all on node"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, takeip, releaseip, ipreallocated"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "not managed, check no-op"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "not managed, check no-op"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "not managed, check no-op"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "auto-start, simple"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "auto-stop, simple"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all OK"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "winbind down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 445 down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "non-existent share path"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "non-existent share - not checked"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down, default tcp checker, debug"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down, ctdb checktcpport not implemented"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down, ctdb checktcpport not implemented, debug"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down, ctdb checktcpport/nmap not implemented, debug"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "port 139 down, ctdb checktcpport/nmap/netstat not implemented"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "not managed, check no-op"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "get RPC service fail limits/actions"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "all services available"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "knfsd down, 1 iteration"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "knfsd down, 6 iterations"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "lockd down, 15 iterations"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "lockd down, 15 iterations, back up after 10"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "rquotad down, 5 iterations"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "rquotad down, 5 iterations, back up after 1"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "statd down, 6 iterations"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "statd down, 8 iterations, back up after 2"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "mountd down, 1 iteration"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "mountd down, 10 iterations"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "mountd down, 10 iterations, back up after 5"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "2nd share missing"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "2nd share missing, skipping share checks"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, ipreallocated -> reconfigure"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, monitor -> reconfigure"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, monitor -> reconfigure, replay error"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, monitor -> reconfigure, replay timedout"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "takeip, monitor -> reconfigure, replay disabled"

View File

@ -1,6 +1,6 @@
#!/bin/sh
. "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "reconfigure (synthetic), twice"
# This checks that the lock is released...

View File

@ -1,8 +1,5 @@
# Hey Emacs, this is a -*- shell-script -*- !!! :-)
# Print a message and exit.
die () { echo "$@" >&2 ; exit 1 ; }
# Augment PATH with relevant stubs/ directories. We do this by actually
# setting PATH, and also by setting $EVENTSCRIPTS_PATH and then
# prepending that to $PATH in rc.local to avoid the PATH reset in
@ -10,45 +7,29 @@ die () { echo "$@" >&2 ; exit 1 ; }
EVENTSCRIPTS_PATH=""
if [ -d "${EVENTSCRIPTS_TESTS_DIR}/stubs" ] ; then
EVENTSCRIPTS_PATH="${EVENTSCRIPTS_TESTS_DIR}/stubs"
fi
export EVENTSCRIPTS_TESTCASE_DIR=$(dirname "$0")
if [ $(basename "$EVENTSCRIPTS_TESTCASE_DIR") = "eventscripts" ] ; then
# Just a test script, no testcase subdirectory.
EVENTSCRIPTS_TESTCASE_DIR="$EVENTSCRIPTS_TESTS_DIR"
else
if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/stubs" ] ; then
EVENTSCRIPTS_PATH="${EVENTSCRIPTS_TESTCASE_DIR}/stubs:${EVENTSCRIPTS_PATH}"
fi
if [ -d "${TEST_SUBDIR}/stubs" ] ; then
EVENTSCRIPTS_PATH="${TEST_SUBDIR}/stubs"
fi
export EVENTSCRIPTS_PATH
PATH="${EVENTSCRIPTS_PATH}:${PATH}"
if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc" ] ; then
CTDB_ETCDIR="${EVENTSCRIPTS_TESTCASE_DIR}/etc"
elif [ -d "${EVENTSCRIPTS_TESTS_DIR}/etc" ] ; then
CTDB_ETCDIR="${EVENTSCRIPTS_TESTS_DIR}/etc"
if [ -d "${TEST_SUBDIR}/etc" ] ; then
CTDB_ETCDIR="${TEST_SUBDIR}/etc"
else
die "Unable to set \$CTDB_ETCDIR"
fi
export CTDB_ETCDIR
if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc-ctdb" ] ; then
CTDB_BASE="${EVENTSCRIPTS_TESTCASE_DIR}/etc-ctdb"
elif [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc/ctdb" ] ; then
CTDB_BASE="${EVENTSCRIPTS_TESTCASE_DIR}/etc/ctdb"
elif [ -d "${EVENTSCRIPTS_TESTS_DIR}/etc-ctdb" ] ; then
CTDB_BASE="${EVENTSCRIPTS_TESTS_DIR}/etc-ctdb"
if [ -d "${TEST_SUBDIR}/etc-ctdb" ] ; then
CTDB_BASE="${TEST_SUBDIR}/etc-ctdb"
else
die "Unable to set \$CTDB_BASE"
fi
export CTDB_BASE
export EVENTSCRIPTS_TESTS_VAR_DIR="${EVENTSCRIPTS_TESTS_DIR}/var"
export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_SUBDIR}/var"
if [ "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/var" ] ; then
rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR"
fi
@ -57,7 +38,7 @@ export CTDB_VARDIR="$EVENTSCRIPTS_TESTS_VAR_DIR/ctdb"
######################################################################
if [ "$EVENTSCRIPT_TESTS_VERBOSE" = "yes" ] ; then
if [ "$TEST_VERBOSE" = "yes" ] ; then
debug () { echo "$@" ; }
else
debug () { : ; }
@ -665,12 +646,7 @@ define_test ()
{
desc="$1"
_f="$0"
_f="${_f#./}" # strip leading ./
_f="${_f#simple/}" # strip leading simple/
_f="${_f#multievent/}" # strip leading multievent/
_f="${_f%%/*}" # if subdir, strip off file
_f="${_f%.sh}" # strip off .sh suffix if any
_f=$(basename "$0" ".sh")
# Remaining format should be NN.service.event.NNN or NN.service.NNN:
_num="${_f##*.}"
@ -779,7 +755,7 @@ result_footer ()
{
_passed="$1"
if [ "$EVENTSCRIPT_TESTS_VERBOSE" = "yes" ] || ! $_passed ; then
if [ "$TEST_VERBOSE" = "yes" ] || ! $_passed ; then
cat <<EOF
--------------------------------------------------

View File

@ -126,7 +126,7 @@ ip_reallocate ()
fi
_flags="${_flags}${_flags:+,}${_this}"
done
"$(dirname ${EVENTSCRIPTS_TESTS_DIR})/bin/ctdb_takeover_tests" \
"$(dirname ${TEST_SUBDIR})/bin/ctdb_takeover_tests" \
"ctdb_takeover_run_core" "$_flags" <"$FAKE_CTDB_IP_LAYOUT" |
sort >"$_t"
mv "$_t" "$FAKE_CTDB_IP_LAYOUT"