export FAKE_DATE_OUTPUT="$1"
}
-setup_generic ()
-{
- setup_shares
- setup_dbdir
- setup_date
-}
-
setup_tcp_listen ()
{
export FAKE_TCP_LISTEN="$*"
# CTDB fakery
-# Evaluate an expression that probably calls functions or uses
-# variables from the CTDB functions file. This is used for test
-# initialisation.
-eventscript_call ()
-{
- (
- . "$CTDB_BASE/functions"
- "$@"
- )
-}
-
setup_numnodes ()
{
export FAKE_CTDB_NUMNODES="${1:-3}"
mkdir -p "$CTDB_SCRIPT_VARDIR"
}
-setup_ctdb ()
-{
- setup_generic
-
- setup_public_addresses
-}
-
-validate_percentage ()
-{
- case "$1" in
- [0-9]|[0-9][0-9]|100) return 0 ;;
- *) echo "WARNING: ${1} is an invalid percentage${2:+\" in }${2}${2:+\"}"
- return 1
- esac
-}
-
ctdb_get_interfaces ()
{
# The echo/subshell forces all the output onto 1 line.
ctdb_get_my_public_addresses | { head -n 1 ; cat >/dev/null ; }
}
-ctdb_not_implemented ()
-{
- export CTDB_NOT_IMPLEMENTED="$1"
- ctdb_not_implemented="\
-DEBUG: ctdb: command \"$1\" not implemented in stub"
-}
-
# Check the routes against those that are expected. $1 is the number
# of assigned IPs to use (<num>, all), defaulting to 1. If $2 is
# "default" then expect default routes to have been added.
######################################################################
-setup_nfs_ganesha ()
-{
- setup_nfs "$@"
- export CTDB_NFS_CALLOUT="${CTDB_BASE}/nfs-ganesha-callout"
- if [ "$1" != "down" ] ; then
- export CTDB_MANAGES_NFS="yes"
- fi
-
- export CTDB_NFS_SKIP_SHARE_CHECK="yes"
-}
-
nfs_load_config ()
{