1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/tests/UNIT/takeover/det.004.sh
Volker Lendecke a6b66661c7 ctdb: Add "home_nodes" file to deterministic IP allocation
With a file "home_nodes" next to "public_addresses" you can assign
public IPs to specific nodes when using the deterministic allocation
algorithm. Whenever the "home node" is up, the IP address will be
assigned to that node, independent of any other deterministic
calculation. The line

192.168.21.254 2

in the file "home_nodes" assigns the IP address to node 2. Only when
node 2 is not able to host IP addresses, 192.168.21.254 undergoes the
normal deterministic IP allocation algorithm.

Signed-off-by: Volker Lendecke <vl@samba.org>

add home_nodes
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct 10 14:17:19 UTC 2023 on atb-devel-224
2023-10-10 14:17:19 +00:00

42 lines
699 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
setup_ctdb_base "$CTDB_TEST_TMP_DIR" "ctdb-etc"
define_test "3 nodes, all healthy with home_nodes"
home_nodes="$CTDB_BASE"/home_nodes
cat > "$home_nodes" <<EOF
192.168.21.254 2
192.168.20.251 1
EOF
required_result <<EOF
${TEST_DATE_STAMP}Deterministic IPs enabled. Resetting all ip allocations
192.168.21.254 2
192.168.21.253 1
192.168.21.252 2
192.168.20.254 0
192.168.20.253 1
192.168.20.252 2
192.168.20.251 1
192.168.20.250 1
192.168.20.249 2
EOF
simple_test 0,0,0 <<EOF
192.168.20.249 1
192.168.20.250 1
192.168.20.251 1
192.168.20.252 1
192.168.20.253 1
192.168.20.254 1
192.168.21.252 1
192.168.21.253 1
192.168.21.254 1
EOF
rm "$home_nodes"