From: Martin Schwenke Date: Wed, 15 Oct 2025 23:42:22 +0000 (+1100) Subject: ctdb-tests: Add an event script unit test for updateip X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a98ffb96efc4a9ea2110c654860a4ba3896ab3d5;p=thirdparty%2Fsamba.git ctdb-tests: Add an event script unit test for updateip This illustrates the current failure where an unassigned public IP address causes updateip to fail. After commit 0536d7a98b832fc00d26b09c26bf14fb63dbf5fb (which improves IP address state checking), this will almost certainly not occur on platforms with getifaddrs(3) (e.g. Linux). This means it is only likely to occur in 4.21 when net.ipv4.ip_nonlocal_bind=1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15935 Reported-by: Bailey Allison Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S --- diff --git a/ctdb/tests/UNIT/eventscripts/10.interface.updateip.001.sh b/ctdb/tests/UNIT/eventscripts/10.interface.updateip.001.sh new file mode 100755 index 00000000000..af87bc14326 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/10.interface.updateip.001.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "error - update a non-existent ip" + +setup + +public_address=$(ctdb_get_1_public_address) +ip="${public_address% *}" +ip="${ip#* }" + +required_result 1 "ERROR: Unable to determine interface for IP ${ip}" +# Want separate words from public_address: interface IP maskbits +# shellcheck disable=SC2086 +simple_test "__none__" $public_address