1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/ctdb/tests/eventscripts/13.per_ip_routing.018.sh
Martin Schwenke e9abc9c070 eventscripts: Simplify handling of $service name in "managed" functions
Complicated argument handling was introduced to deal with multiple
services per eventscript.  This was a failure and we split 50.samba.

This simplifies several functions to use global $service_name
unconditionally instead of having an optional argument.

$service_name is no automatically longer set in the functions file.
This means it needs to be explicitly set in 13.per_ip_routing because
this script uses ctdb_service_check_reconfigure().

Eventscript unit test infrastructure needs to set $service_name during
fake service setup, and policy routing tests need to be updated
accordingly.

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

(This used to be ctdb commit 27aab8783898a50da8c4bc887b512d8f0c0d842c)
2013-05-06 15:45:10 +10:00

23 lines
503 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "1 IP configured, ipreallocated, more routes, reconfigure"
setup_ctdb
setup_ctdb_policy_routing
create_policy_routing_config 1
# no takeip, but ipreallocated should add any missing routes
ok_null
simple_test_event "ipreallocated"
create_policy_routing_config 1 default
# reconfigure should update routes even though rules are unchanged
ok "Reconfiguring service \"${service_name}\"..."
simple_test_event "reconfigure"
check_routes 1 default