mirror of
https://github.com/samba-team/samba.git
synced 2025-01-28 17:47:29 +03:00
df39a671db
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)
41 lines
758 B
Bash
Executable File
41 lines
758 B
Bash
Executable File
#!/bin/sh
|
|
|
|
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
|
|
|
define_test "1 IP configured, ipreallocated"
|
|
|
|
setup_ctdb
|
|
setup_ctdb_policy_routing
|
|
|
|
ctdb_get_1_public_address |
|
|
{
|
|
read dev ip bits
|
|
|
|
net=$(ipv4_host_addr_to_net "$ip" "$bits")
|
|
gw="${net%.*}.1" # a dumb, calculated default
|
|
|
|
cat >"$CTDB_PER_IP_ROUTING_CONF" <<EOF
|
|
$ip $net
|
|
$ip 0.0.0.0/0 $gw
|
|
EOF
|
|
|
|
ok_null
|
|
|
|
# ipreallocated should add any missing routes
|
|
simple_test_event "ipreallocated"
|
|
|
|
ok <<EOF
|
|
# ip rule show
|
|
0: from all lookup local
|
|
${CTDB_PER_IP_ROUTING_RULE_PREF}: from $ip lookup ctdb.$ip
|
|
32766: from all lookup main
|
|
32767: from all lookup default
|
|
# ip route show table ctdb.$ip
|
|
$net dev $dev scope link
|
|
default via $gw dev $dev
|
|
EOF
|
|
|
|
simple_test_command dump_routes
|
|
}
|
|
|