1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00
Martin Schwenke 959e37da7b tests: simple tests against local daemons should check $TEST_LOCAL_DEAMONS
Note the old $CTDB_TEST_REAL_CLUSTER - it doesn't exist anymore...

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

(This used to be ctdb commit 47180dc75d15f3d61470705603565b718491c9f8)
2012-07-26 22:03:00 +10:00

106 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# event script for 'make test'
cmd="$1"
shift
case $cmd in
monitor)
echo "monitor event"
echo "monitor event stderr" >&2
exit 0
;;
startrecovery)
echo "ctdb startrecovery event"
exit 0;
;;
init)
echo "ctdb init event"
exit 0;
;;
setup)
echo "ctdb setup event"
exit 0;
;;
startup)
echo "ctdb startup event"
IFACES=`ctdb ifaces -Y | grep -v '^:Name:LinkStatus:References:'`
for I in $IFACES; do
IFACE=`echo -n "$I" | cut -d ':' -f2`
ctdb setifacelink $IFACE up
done
exit 0;
;;
takeip)
if [ $# != 3 ]; then
echo "must supply interface, IP and maskbits"
exit 1
fi
iface=$1
ip=$2
maskbits=$3
[ -n "$TEST_LOCAL_DAEMONS" ] || {
/sbin/ip addr add $ip/$maskbits dev $iface || {
echo "Failed to add $ip/$maskbits on dev $iface"
exit 1
}
}
echo "ctdb takeip event for $1 $2 $3"
exit 0;
;;
##################################################
# called when ctdbd wants to release an IP address
releaseip)
if [ $# != 3 ]; then
echo "must supply interface, IP and maskbits"
exit 1
fi
iface=$1
ip=$2
maskbits=$3
[ -n "$TEST_LOCAL_DAEMONS" ] || {
/sbin/ip addr del $ip/$maskbits dev $iface || {
echo "Failed to del $ip on dev $iface"
exit 1
}
}
echo "ctdb releaseip event for $1 $2 $3"
exit 0
;;
updateip)
echo "ctdb updateip event for $1"
exit 0
;;
recovered)
echo "ctdb recovered event"
exit 0
;;
ipreallocated)
echo "ctdb ipreallocated event"
exit 0
;;
shutdown)
echo "ctdb shutdown event"
exit 0
;;
stopped)
echo "ctdb stopped event"
exit 0
;;
esac
echo "Invalid command $cmd"
exit 1