testprogs/blackbox: add test_trust_utils.sh
[Samba.git] / ctdb / tests / eventscripts / 11.natgw.015.sh
blobc7e0c15262f39e2eab0de82ff2271876d9be9aa5
1 #!/bin/sh
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
5 define_test "basic configuration, multiple transitions"
7 setup_ctdb
9 echo "*** Master node..."
11 setup_ctdb_natgw <<EOF
12 192.168.1.21 master
13 192.168.1.22
14 192.168.1.23
15 192.168.1.24
16 EOF
18 ok_null
19 simple_test_event "ipreallocated"
21 ok "default via ${CTDB_NATGW_DEFAULT_GATEWAY} dev ethXXX metric 10 "
22 simple_test_command ip route show
24 ok_natgw_master_ip_addr_show
25 simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE"
27 echo "*** Slave node..."
29 setup_ctdb_natgw <<EOF
30 192.168.1.21
31 192.168.1.22 master
32 192.168.1.23
33 192.168.1.24
34 EOF
36 ok "NAT gateway configuration has changed"
37 simple_test_event "ipreallocated"
39 ok "default via ${FAKE_CTDB_NATGW_MASTER} dev ethXXX metric 10 "
40 simple_test_command ip route show
42 ok_natgw_slave_ip_addr_show
43 simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE"
45 echo "*** Master node again..."
47 setup_ctdb_natgw <<EOF
48 192.168.1.21 master
49 192.168.1.22
50 192.168.1.23
51 192.168.1.24
52 EOF
54 ok "NAT gateway configuration has changed"
55 simple_test_event "ipreallocated"
57 ok "default via ${CTDB_NATGW_DEFAULT_GATEWAY} dev ethXXX metric 10 "
58 simple_test_command ip route show
60 ok_natgw_master_ip_addr_show
61 simple_test_command ip addr show "$CTDB_NATGW_PUBLIC_IFACE"