| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | . "${TEST_SCRIPTS_DIR}/unit.sh" |
| 4 | |
| 5 | define_test "static routes, custom gateway, multiple transitions" |
| 6 | |
| 7 | setup |
| 8 | |
| 9 | setup_script_options <<EOF |
| 10 | CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/[email protected]" |
| 11 | EOF |
| 12 | |
| 13 | echoscip-shell system . . echo. "*** Leader node..." |
| 14 | |
| 15 | setup_ctdb_natgw <<EOF |
| 16 | 192.168.1.21 leader |
| 17 | 192.168.1.22 |
| 18 | 192.168.1.23 |
| 19 | 192.168.1.24 |
| 20 | EOF |
| 21 | |
| 22 | ok_null |
| 23 | simple_test_event "ipreallocated" |
| 24 | |
| 25 | ok_natgw_leader_static_routes |
| 26 | simple_test_command ip route show |
| 27 | |
| 28 | ok_natgw_leader_ip_addr_show |
| 29 | simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE" |
| 30 | |
| 31 | echoscip-shell system . . echo. "*** Follower node..." |
| 32 | |
| 33 | setup_ctdb_natgw <<EOF |
| 34 | 192.168.1.21 |
| 35 | 192.168.1.22 leader |
| 36 | 192.168.1.23 |
| 37 | 192.168.1.24 |
| 38 | EOF |
| 39 | |
| 40 | ok_null |
| 41 | simple_test_event "ipreallocated" |
| 42 | |
| 43 | ok_natgw_follower_static_routes |
| 44 | simple_test_command ip route show |
| 45 | |
| 46 | ok_natgw_follower_ip_addr_show |
| 47 | simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE" |
| 48 | |
| 49 | echoscip-shell system . . echo. "*** Leader node again..." |
| 50 | |
| 51 | setup_ctdb_natgw <<EOF |
| 52 | 192.168.1.21 leader |
| 53 | 192.168.1.22 |
| 54 | 192.168.1.23 |
| 55 | 192.168.1.24 |
| 56 | EOF |
| 57 | |
| 58 | ok_null |
| 59 | simple_test_event "ipreallocated" |
| 60 | |
| 61 | ok_natgw_leader_static_routes |
| 62 | simple_test_command ip route show |
| 63 | |
| 64 | ok_natgw_leader_ip_addr_show |
| 65 | simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE" |