Debian Codegraph @

ctdb/tests/UNIT/eventscripts/13.per_ip_routing.023.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
4
5 define_test "1 IP configured, broken configuration, takeip"
6
7 setup
8
9 # Configuration for 1 IP
10 create_policy_routing_config 1 default
11
12 # takeip should add routes for the given address
13 ctdb_get_1_public_address |
14 while read dev ip bits ; do
15 # Now add configuration breakage by changing default route into a
16 # link local route with a gateway
17 net=$(ipv4_host_addr_to_net "$ip" "$bits")
18 sedscip-shell system . . sed. -i -e "s@0\.0\.0\.0/0@${net}@" "$CTDB_PER_IP_ROUTING_CONF"
19
20 ok <<EOF
21 RTNETLINK answers: File exists
22 add_routing_for_ip: failed to add route: ${net} via ${net%.*}.254 dev ${dev} table ctdb.${ip}
23 EOF
24 simple_test_event "takeip" $dev $ip $bits
25 done