mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
eaa508b826
Ensure that it doesn't mangle the rt_tables file. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jan 17 06:02:23 CET 2017 on sn-devel-144
32 lines
611 B
Bash
Executable File
32 lines
611 B
Bash
Executable File
#!/bin/sh
|
|
|
|
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
|
|
|
define_test "Single IP, restores original rt_tables"
|
|
|
|
setup_ctdb
|
|
setup_ctdb_policy_routing
|
|
|
|
create_policy_routing_config 1 default
|
|
|
|
_rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
|
|
_rt_orig=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
|
|
cp "$_rt_tables" "$_rt_orig"
|
|
|
|
ctdb_get_1_public_address | {
|
|
read dev ip bits
|
|
|
|
ok_null
|
|
simple_test_event "takeip" $dev $ip $bits
|
|
|
|
ok <<EOF
|
|
Removing ip rule for public address ${ip} for routing table ctdb.${ip}
|
|
EOF
|
|
simple_test_event "shutdown"
|
|
}
|
|
|
|
ok_null
|
|
simple_test_command diff -u "$_rt_orig" "$_rt_tables"
|
|
|
|
check_routes 0
|