The branch, master has been updated via a0e0fde039e ctdb-tests: Avoid shellcheck warnings via ff4935d180e ctdb-tests: Simplify IP address checking via 42aedc62e3a ctdb-tests: Fix typos via b88e7322d9b ctdb-tests: Reformat script using shfmt -w -p -i 0 -fn from f99fb9aa120 python:tests: Allocate OID range for testing to avoid collisions
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit a0e0fde039e924d192294ad95da4344eff390c0c Author: Martin Schwenke <mar...@meltin.net> Date: Mon Aug 8 18:19:34 2022 +1000 ctdb-tests: Avoid shellcheck warnings Mostly SC2086: Double quote to prevent globbing and word splitting. Use ctdb_onnode() where it simplifies code. No behaviour changes intended. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> Autobuild-User(master): Amitay Isaacs <ami...@samba.org> Autobuild-Date(master): Thu Aug 25 16:15:45 UTC 2022 on sn-devel-184 commit ff4935d180e1a290e4ba7ab0f8710d9a022d1b82 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 11 09:15:38 2022 +1000 ctdb-tests: Simplify IP address checking Use a new function and wait_until() to simplify. get_test_ip_mask_and_iface() not needed here because select_test_node_and_ips() sets $test_ip, and neither $mask nor $iface is used. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 42aedc62e3a16bcdafbef06140105650f15f6269 Author: Martin Schwenke <mar...@meltin.net> Date: Mon Aug 8 18:11:26 2022 +1000 ctdb-tests: Fix typos These lines are just wrong: try_command_on_node -v $test_node "ip addr show to ${test_node}" if -n "$out"; then The 2nd variable referenced should be $test_ip. The 2nd line causes "-n: command not found" because it is missing [] test command brackets. Both typos would probably make the test pass unconditionally. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit b88e7322d9b4cf617381b12deb393edd87d1cf73 Author: Martin Schwenke <mar...@meltin.net> Date: Mon Aug 8 18:09:56 2022 +1000 ctdb-tests: Reformat script using shfmt -w -p -i 0 -fn Whitespace changes only. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> ----------------------------------------------------------------------- Summary of changes: .../CLUSTER/complex/11_ctdb_delip_removes_ip.sh | 37 +++++++++------------- 1 file changed, 15 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh b/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh index dba6d075c8d..072780ac215 100755 --- a/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh +++ b/ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh @@ -8,36 +8,29 @@ set -e +test_node_has_test_ip() +{ + # $test_node and $test_ip set by select_test_node_and_ips() + # shellcheck disable=SC2154 + try_command_on_node "$test_node" "ip addr show to ${test_ip}" + [ -n "$out" ] +} + ctdb_test_init select_test_node_and_ips -get_test_ip_mask_and_iface +# $test_node and $test_ip set by select_test_node_and_ips() +# shellcheck disable=SC2154 echo "Checking that node ${test_node} hosts ${test_ip}..." -try_command_on_node $test_node "ip addr show to ${test_ip} | grep -q ." +test_node_has_test_ip echo "Attempting to remove ${test_ip} from node ${test_node}." -try_command_on_node $test_node $CTDB delip $test_ip -try_command_on_node $test_node $CTDB ipreallocate -wait_until_ips_are_on_node '!' $test_node $test_ip +ctdb_onnode "$test_node" "delip ${test_ip}" +ctdb_onnode "$test_node" "ipreallocate" +wait_until_ips_are_on_node '!' "$test_node" "$test_ip" -timeout=60 -increment=5 -count=0 echo "Waiting for ${test_ip} to disappear from node ${test_node}..." -while : ; do - try_command_on_node -v $test_node "ip addr show to ${test_node}" - if -n "$out" ; then - echo "Still there..." - if [ $(($count * $increment)) -ge $timeout ] ; then - echo "BAD: Timed out waiting..." - exit 1 - fi - sleep_for $increment - count=$(($count + 1)) - else - break - fi -done +wait_until 60/5 '!' test_node_has_test_ip echo "GOOD: IP was successfully removed!" -- Samba Shared Repository