mirror of
https://github.com/samba-team/samba.git
synced 2025-09-10 05:44:20 +03:00
Revert "ctdb-tests: Drop uses of "onnode any ..." in testcases"
Fix missing Reviewed-by: tag.
This reverts commit aa5b214eaa
.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
committed by
Martin Schwenke
parent
635d5cfa31
commit
c9dfdeaddc
@@ -38,7 +38,7 @@ select_test_node_and_ips
|
|||||||
# the provided prefix. Note that this is an IPv4-specific test.
|
# the provided prefix. Note that this is an IPv4-specific test.
|
||||||
|
|
||||||
echo "Getting public IP information from CTDB..."
|
echo "Getting public IP information from CTDB..."
|
||||||
ctdb_onnode "$test_node" "ip -X -v all"
|
try_command_on_node any "$CTDB ip -X -v all"
|
||||||
ctdb_ip_info=$(awk -F'|' 'NR > 1 { print $2, $3, $5 }' "$outfile")
|
ctdb_ip_info=$(awk -F'|' 'NR > 1 { print $2, $3, $5 }' "$outfile")
|
||||||
|
|
||||||
echo "Getting IP information from interfaces..."
|
echo "Getting IP information from interfaces..."
|
||||||
@@ -215,7 +215,7 @@ do_ctdb_reloadips
|
|||||||
|
|
||||||
check_ips $test_node "$iface" "$prefix" 1 $new_ip_max
|
check_ips $test_node "$iface" "$prefix" 1 $new_ip_max
|
||||||
|
|
||||||
ctdb_onnode "$test_node" sync
|
try_command_on_node any $CTDB sync
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ do_ctdb_reloadips
|
|||||||
|
|
||||||
check_ips $test_node "$iface" "$prefix" 2 $new_ip_max
|
check_ips $test_node "$iface" "$prefix" 2 $new_ip_max
|
||||||
|
|
||||||
ctdb_onnode "$test_node" sync
|
try_command_on_node any $CTDB sync
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ do_ctdb_reloadips
|
|||||||
|
|
||||||
check_ips $test_node "$iface" "$prefix" $start $new_ip_max
|
check_ips $test_node "$iface" "$prefix" $start $new_ip_max
|
||||||
|
|
||||||
ctdb_onnode "$test_node" sync
|
try_command_on_node any $CTDB sync
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
|
||||||
|
@@ -29,14 +29,15 @@ set -e
|
|||||||
|
|
||||||
ctdb_test_init
|
ctdb_test_init
|
||||||
|
|
||||||
|
# We need this for later, so we know how long to run nc for.
|
||||||
|
try_command_on_node any $CTDB getvar MonitorInterval
|
||||||
|
monitor_interval="${out#*= }"
|
||||||
|
#echo "Monitor interval on node $test_node is $monitor_interval seconds."
|
||||||
|
|
||||||
select_test_node_and_ips
|
select_test_node_and_ips
|
||||||
try_command_on_node $test_node "$CTDB listnodes | wc -l"
|
try_command_on_node $test_node "$CTDB listnodes | wc -l"
|
||||||
numnodes="$out"
|
numnodes="$out"
|
||||||
|
|
||||||
# We need this for later, so we know how long to run nc for.
|
|
||||||
ctdb_onnode "$test_node" "getvar MonitorInterval"
|
|
||||||
monitor_interval="${out#*= }"
|
|
||||||
|
|
||||||
test_port=2049
|
test_port=2049
|
||||||
|
|
||||||
echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with netcat..."
|
echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with netcat..."
|
||||||
|
@@ -27,6 +27,11 @@ set -e
|
|||||||
|
|
||||||
ctdb_test_init
|
ctdb_test_init
|
||||||
|
|
||||||
|
# We need this for later, so we know how long to run nc for.
|
||||||
|
try_command_on_node any $CTDB getvar MonitorInterval
|
||||||
|
monitor_interval="${out#*= }"
|
||||||
|
#echo "Monitor interval on node $test_node is $monitor_interval seconds."
|
||||||
|
|
||||||
select_test_node_and_ips
|
select_test_node_and_ips
|
||||||
try_command_on_node $test_node "$CTDB listnodes -X"
|
try_command_on_node $test_node "$CTDB listnodes -X"
|
||||||
listnodes_output="$out"
|
listnodes_output="$out"
|
||||||
|
@@ -92,7 +92,7 @@ check_readonly ()
|
|||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
echo "Get list of nodes..."
|
echo "Get list of nodes..."
|
||||||
ctdb_onnode 0 "-X listnodes"
|
try_command_on_node any $CTDB -X listnodes
|
||||||
all_nodes=$(awk -F'|' '{print $2}' "$outfile")
|
all_nodes=$(awk -F'|' '{print $2}' "$outfile")
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@@ -38,7 +38,7 @@ status=0
|
|||||||
|
|
||||||
# Make sure node 0 is not the recovery master
|
# Make sure node 0 is not the recovery master
|
||||||
echo "find out which node is recmaster"
|
echo "find out which node is recmaster"
|
||||||
ctdb_onnode 0 recmaster
|
try_command_on_node any $CTDB recmaster
|
||||||
recmaster="$out"
|
recmaster="$out"
|
||||||
if [ "$recmaster" = "0" ]; then
|
if [ "$recmaster" = "0" ]; then
|
||||||
echo "node 0 is recmaster, disable recmasterrole on node 0"
|
echo "node 0 is recmaster, disable recmasterrole on node 0"
|
||||||
@@ -56,7 +56,7 @@ if [ "$recmaster" = "0" ]; then
|
|||||||
try_command_on_node 0 $CTDB continue
|
try_command_on_node 0 $CTDB continue
|
||||||
wait_until_node_has_status 0 notstopped
|
wait_until_node_has_status 0 notstopped
|
||||||
|
|
||||||
ctdb_onnode 0 recmaster
|
try_command_on_node any $CTDB recmaster
|
||||||
recmaster="$out"
|
recmaster="$out"
|
||||||
if [ "$recmaster" = "0" ]; then
|
if [ "$recmaster" = "0" ]; then
|
||||||
echo "failed to move recmaster to different node"
|
echo "failed to move recmaster to different node"
|
||||||
|
@@ -33,7 +33,7 @@ do_ctdb_reloadips ()
|
|||||||
local retry_max=10
|
local retry_max=10
|
||||||
local retry_count=0
|
local retry_count=0
|
||||||
while : ; do
|
while : ; do
|
||||||
if ctdb_onnode "$test_node" "reloadips all" ; then
|
if try_command_on_node any "$CTDB reloadips all" ; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ GOOD: node $test_node is no longer hosting IP $test_ip:
|
|||||||
$out
|
$out
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ctdb_onnode "$test_node" sync
|
try_command_on_node any $CTDB sync
|
||||||
|
|
||||||
|
|
||||||
echo "Restoring addresses"
|
echo "Restoring addresses"
|
||||||
@@ -94,7 +94,7 @@ GOOD: node $test_node has these addresses:
|
|||||||
$out
|
$out
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ctdb_onnode "$test_node" sync
|
try_command_on_node any $CTDB sync
|
||||||
|
|
||||||
|
|
||||||
echo "Emptying public addresses file on $test_node"
|
echo "Emptying public addresses file on $test_node"
|
||||||
|
@@ -16,13 +16,8 @@ ctdb_test_init -n
|
|||||||
echo "Starting CTDB with failover disabled..."
|
echo "Starting CTDB with failover disabled..."
|
||||||
ctdb_nodes_start_custom -F
|
ctdb_nodes_start_custom -F
|
||||||
|
|
||||||
select_test_node
|
|
||||||
|
|
||||||
echo "Getting IP allocation..."
|
echo "Getting IP allocation..."
|
||||||
|
try_command_on_node -v any "$CTDB ip all | tail -n +2"
|
||||||
# $test_node set above by select_test_node()
|
|
||||||
# shellcheck disable=SC2154
|
|
||||||
try_command_on_node -v "$test_node" "$CTDB ip all | tail -n +2"
|
|
||||||
|
|
||||||
while read ip pnn ; do
|
while read ip pnn ; do
|
||||||
if [ "$pnn" != "-1" ] ; then
|
if [ "$pnn" != "-1" ] ; then
|
||||||
@@ -38,7 +33,7 @@ echo "Starting CTDB with an empty public addresses configuration..."
|
|||||||
ctdb_nodes_start_custom -P /dev/null
|
ctdb_nodes_start_custom -P /dev/null
|
||||||
|
|
||||||
echo "Trying explicit ipreallocate..."
|
echo "Trying explicit ipreallocate..."
|
||||||
ctdb_onnode "$test_node" ipreallocate
|
try_command_on_node any $CTDB ipreallocate
|
||||||
|
|
||||||
echo "Good, that seems to work!"
|
echo "Good, that seems to work!"
|
||||||
echo
|
echo
|
||||||
|
@@ -40,10 +40,7 @@ sanity_check_ips ()
|
|||||||
sanity_check_ips
|
sanity_check_ips
|
||||||
|
|
||||||
# Find a target node - it must be willing to host $test_ip
|
# Find a target node - it must be willing to host $test_ip
|
||||||
|
try_command_on_node any "$CTDB listnodes | wc -l"
|
||||||
# $test_node set above by select_test_node_and_ips()
|
|
||||||
# shellcheck disable=SC2154
|
|
||||||
try_command_on_node "$test_node" "$CTDB listnodes | wc -l"
|
|
||||||
num_nodes="$out"
|
num_nodes="$out"
|
||||||
to_node=""
|
to_node=""
|
||||||
for i in $(seq 0 $(($num_nodes - 1)) ) ; do
|
for i in $(seq 0 $(($num_nodes - 1)) ) ; do
|
||||||
|
Reference in New Issue
Block a user