From a98ffb96efc4a9ea2110c654860a4ba3896ab3d5 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 16 Oct 2025 10:42:22 +1100 Subject: [PATCH] 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 --- .../eventscripts/10.interface.updateip.001.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 ctdb/tests/UNIT/eventscripts/10.interface.updateip.001.sh 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 -- 2.47.3