mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
tests/eventscripts: Add a policy routing unit test for "ip rule del" failure
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0ce5b079f327aba55b62800ccb22d79976fac665)
This commit is contained in:
parent
e1348221d6
commit
aed0f9d1b9
38
ctdb/tests/eventscripts/13.per_ip_routing.013.sh
Executable file
38
ctdb/tests/eventscripts/13.per_ip_routing.013.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "1 IP configured, releaseip of unassigned"
|
||||
|
||||
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 <<EOF
|
||||
WARNING: Failed to delete policy routing rule
|
||||
Command "ip rule del from $ip pref $CTDB_PER_IP_ROUTING_RULE_PREF table ctdb.$ip" failed:
|
||||
RTNETLINK answers: No such file or directory
|
||||
EOF
|
||||
|
||||
simple_test_event "releaseip" $dev $ip $bits
|
||||
|
||||
ok <<EOF
|
||||
# ip rule show
|
||||
0: from all lookup local
|
||||
32766: from all lookup main
|
||||
32767: from all lookup default
|
||||
EOF
|
||||
|
||||
simple_test_command dump_routes
|
||||
}
|
Loading…
Reference in New Issue
Block a user