1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/tests/UNIT
Martin Schwenke 0159c48e89 ctdb-scripts: Do not de-duplicate the interfaces list
Using xargs with sort -u to de-duplicate this list was my idea and
causes a couple of things to go wrong.  The use of xargs causes
double-quotes to be lost.  The resulting $public_ifaces value also
contains newlines.  The newlines could be removed with an additional
xargs at the end of the pipeline... but that would add an extra level
of quote stripping.

I have unsuccessfully tried to find an alternative, but still elegant,
command pipeline that de-duplicates the list, while maintaining
quoting.

So, just drop the de-duplication.

This might make interface_ifindex_exists_with_options() slightly less
efficient.  However, that function walks the whole list, only
terminating early when a match is found on both interface and options,
so at least it will be correct.

Include an extra testcase.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Apr 18 09:08:34 UTC 2024 on atb-devel-224
2024-04-18 09:08:34 +00:00
..
cunit ctdb: Remove common/line.[ch] 2024-04-16 23:51:45 +00:00
eventd ctdb-tools: Fix CID 1539212 - signed/unsigned issue 2023-08-07 08:43:39 +00:00
eventscripts ctdb-scripts: Do not de-duplicate the interfaces list 2024-04-18 09:08:34 +00:00
onnode ctdb-tests: Prefix remaining environment variables with CTDB_ 2019-10-22 19:39:41 +00:00
shellcheck ctdb-tests: Run ShellCheck on event-script unit test support scripts 2023-07-05 12:16:56 +00:00
takeover ctdb: Add "home_nodes" file to deterministic IP allocation 2023-10-10 14:17:19 +00:00
takeover_helper ctdb-takeover: Use CTDB_CONTROL_START_IPREALLOCATE 2024-03-06 06:05:38 +00:00
tool ctdb-tests: Add new tool unit tests to cover UNKNOWN state 2022-06-28 10:16:59 +00:00