]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Add addip/releaseip altname unit test
authorMartin Schwenke <mschwenke@ddn.com>
Mon, 13 Apr 2026 04:48:07 +0000 (14:48 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 16 Apr 2026 23:09:33 +0000 (23:09 +0000)
This shows that a warning is generated whenever an IP address is
removed using an altname.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
ctdb/tests/UNIT/eventscripts/10.interface.002.sh [new file with mode: 0755]

diff --git a/ctdb/tests/UNIT/eventscripts/10.interface.002.sh b/ctdb/tests/UNIT/eventscripts/10.interface.002.sh
new file mode 100755 (executable)
index 0000000..b2b3bfd
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "Add/release 1 IP, interface is altname"
+
+setup
+
+ctdb_get_1_public_address |
+       while read -r dev ip bits; do
+               altname="alt${dev}"
+               ip link property add dev "$dev" altname "$altname"
+
+               ok_null
+               simple_test_event "takeip" "$altname" "$ip" "$bits"
+
+               ok <<EOF
+WARNING: Public IP ${ip} hosted on interface ${dev} but VNN says ${altname}
+EOF
+               simple_test_event "releaseip" "$altname" "$ip" "$bits"
+       done