Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
13 files changed:
+setup_script_options <<EOF
CTDB_NATGW_PUBLIC_IFACE=""
CTDB_NATGW_PUBLIC_IFACE=""
required_result 1 "Invalid configuration: CTDB_NATGW_PUBLIC_IFACE not set"
required_result 1 "Invalid configuration: CTDB_NATGW_PUBLIC_IFACE not set"
+setup_script_options <<EOF
required_result 1 "Invalid configuration: CTDB_NATGW_PUBLIC_IP not set"
required_result 1 "Invalid configuration: CTDB_NATGW_PUBLIC_IP not set"
+setup_script_options <<EOF
CTDB_NATGW_DEFAULT_GATEWAY=""
CTDB_NATGW_DEFAULT_GATEWAY=""
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_DEFAULT_GATEWAY=""
CTDB_NATGW_DEFAULT_GATEWAY=""
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options<<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24"
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24"
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
echo "*** Master node..."
echo "*** Master node..."
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
CTDB_NATGW_STATIC_ROUTES="10.1.1.0/24 10.1.2.0/24@10.1.1.253"
echo "##################################################"
echo "Static routes..."
echo "##################################################"
echo "Static routes..."
echo "##################################################"
echo "Default routes..."
echo "##################################################"
echo "Default routes..."
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES=""
CTDB_NATGW_STATIC_ROUTES=""
ok "NAT gateway configuration has changed"
simple_test_event "ipreallocated"
ok "NAT gateway configuration has changed"
simple_test_event "ipreallocated"
echo "##################################################"
echo "Static routes again..."
echo "##################################################"
echo "Static routes again..."
+setup_script_options <<EOF
CTDB_NATGW_STATIC_ROUTES="10.1.3.0/24 10.1.4.4/32 10.1.2.0/24@10.1.1.252"
CTDB_NATGW_STATIC_ROUTES="10.1.3.0/24 10.1.4.4/32 10.1.2.0/24@10.1.1.252"
ok "NAT gateway configuration has changed"
simple_test_event "ipreallocated"
ok "NAT gateway configuration has changed"
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_PUBLIC_IFACE=""
CTDB_NATGW_PUBLIC_IFACE=""
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
+setup_script_options <<EOF
CTDB_NATGW_PUBLIC_IFACE=""
CTDB_NATGW_PUBLIC_IP=""
CTDB_NATGW_PUBLIC_IFACE=""
CTDB_NATGW_PUBLIC_IP=""
ok_null
simple_test_event "ipreallocated"
ok_null
simple_test_event "ipreallocated"
natgw_nodes="${CTDB_BASE}/natgw_nodes"
ctdb_set_pnn
natgw_nodes="${CTDB_BASE}/natgw_nodes"
ctdb_set_pnn
-
- export CTDB_NATGW_NODES=""
- export CTDB_NATGW_PRIVATE_NETWORK=""
- export CTDB_NATGW_PUBLIC_IP=""
- export CTDB_NATGW_PUBLIC_IFACE=""
- export CTDB_NATGW_DEFAULT_GATEWAY=""
- export CTDB_NATGW_STATIC_ROUTES=""
}
# A separate function for this makes sense because it can be done
}
# A separate function for this makes sense because it can be done
# addresses:
read _ip <"$natgw_nodes"
# addresses:
read _ip <"$natgw_nodes"
- CTDB_NATGW_NODES="$natgw_nodes"
- CTDB_NATGW_PRIVATE_NETWORK="${_ip%.*}.0/24"
- # These are fixed. Probably don't use the same network for the
- # private node IPs. To unset the default gateway just set it to
- # "". :-)
- CTDB_NATGW_PUBLIC_IP="10.1.1.121/24"
- CTDB_NATGW_PUBLIC_IFACE="eth1"
- CTDB_NATGW_DEFAULT_GATEWAY="10.1.1.254"
+ setup_script_options <<EOF
+CTDB_NATGW_NODES="$natgw_nodes"
+CTDB_NATGW_PRIVATE_NETWORK="${_ip%.*}.0/24"
+# These are fixed. Probably don't use the same network for the
+# private node IPs. To unset the default gateway just set it to
+# "". :-)
+CTDB_NATGW_PUBLIC_IP="10.1.1.121/24"
+CTDB_NATGW_PUBLIC_IFACE="eth1"
+CTDB_NATGW_DEFAULT_GATEWAY="10.1.1.254"
+EOF
}
ok_natgw_master_ip_addr_show ()
}
ok_natgw_master_ip_addr_show ()