1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-tests: 91.lvs event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-02-12 16:46:17 +11:00 committed by Amitay Isaacs
parent 042a5101fc
commit 8ee51d2f2d
13 changed files with 22 additions and 34 deletions

View File

@ -4,8 +4,7 @@
define_test "sanity check ipvsadm stub" define_test "sanity check ipvsadm stub"
setup_ctdb setup<<EOF
setup_ctdb_lvs<<EOF
EOF EOF
check_ipvsadm NULL check_ipvsadm NULL

View File

@ -4,8 +4,7 @@
define_test "configured, no nodes in config" define_test "configured, no nodes in config"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
EOF EOF
ok_null ok_null

View File

@ -4,8 +4,7 @@
define_test "nodes in config, no master (e.g. all inactive)" define_test "nodes in config, no master (e.g. all inactive)"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
192.168.1.1 192.168.1.1
192.168.1.2 192.168.1.2
192.168.1.3 192.168.1.3

View File

@ -4,8 +4,7 @@
define_test "nodes in config, other node is master" define_test "nodes in config, other node is master"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
192.168.1.1 192.168.1.1
192.168.1.2 master 192.168.1.2 master
192.168.1.3 192.168.1.3

View File

@ -4,8 +4,7 @@
define_test "nodes in config, this is master" define_test "nodes in config, this is master"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
192.168.1.1 master 192.168.1.1 master
192.168.1.2 192.168.1.2
192.168.1.3 192.168.1.3

View File

@ -4,8 +4,7 @@
define_test "not configured" define_test "not configured"
setup_ctdb setup <<EOF
setup_ctdb_lvs <<EOF
EOF EOF
ok_null ok_null

View File

@ -4,8 +4,7 @@
define_test "configured, interface up" define_test "configured, interface up"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
192.168.1.1 192.168.1.1
192.168.1.2 192.168.1.2
192.168.1.3 192.168.1.3

View File

@ -4,8 +4,7 @@
define_test "configured, interface up" define_test "configured, interface up"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
192.168.1.1 192.168.1.1
192.168.1.2 192.168.1.2
192.168.1.3 192.168.1.3

View File

@ -4,8 +4,7 @@
define_test "not configured" define_test "not configured"
setup_ctdb setup <<EOF
setup_ctdb_lvs <<EOF
EOF EOF
ok_null ok_null

View File

@ -4,8 +4,7 @@
define_test "configured" define_test "configured"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
EOF EOF
ipvsadm -A -t "$CTDB_LVS_PUBLIC_IP" -s lc -p 1999999 ipvsadm -A -t "$CTDB_LVS_PUBLIC_IP" -s lc -p 1999999

View File

@ -4,8 +4,7 @@
define_test "not configured" define_test "not configured"
setup_ctdb setup <<EOF
setup_ctdb_lvs <<EOF
EOF EOF
ok_null ok_null

View File

@ -4,8 +4,7 @@
define_test "configured" define_test "configured"
setup_ctdb setup "10.1.1.201" "eth0" <<EOF
setup_ctdb_lvs "10.1.1.201" "eth0" <<EOF
EOF EOF
ok_null ok_null

View File

@ -1,20 +1,20 @@
setup_ctdb_lvs () setup ()
{ {
lvs_state_dir="${EVENTSCRIPTS_TESTS_VAR_DIR}/lvs" _ip="$1"
mkdir -p "$lvs_state_dir" _iface="$2"
export FAKE_LVS_STATE_DIR="${lvs_state_dir}/state" export FAKE_LVS_STATE_DIR="${FAKE_NETWORK_STATE}/lvs"
mkdir "$FAKE_LVS_STATE_DIR" mkdir -p "$FAKE_LVS_STATE_DIR"
lvs_header=$(ipvsadm -l -n) lvs_header=$(ipvsadm -l -n)
export CTDB_LVS_PUBLIC_IP="$1" [ -n "$_ip" ] || return 0
export CTDB_LVS_PUBLIC_IFACE="$2" [ -n "$_iface" ] || return 0
[ -n "$CTDB_LVS_PUBLIC_IP" ] || return 0 export CTDB_LVS_NODES="${CTDB_BASE}/lvs_nodes"
[ -n "$CTDB_LVS_PUBLIC_IFACE" ] || return 0 export CTDB_LVS_PUBLIC_IP="$_ip"
export CTDB_LVS_PUBLIC_IFACE="$_iface"
export CTDB_LVS_NODES=$(mktemp --tmpdir="$lvs_state_dir")
export FAKE_CTDB_LVS_MASTER="" export FAKE_CTDB_LVS_MASTER=""
# Read from stdin # Read from stdin