| Age | Commit message (Collapse) | Author | Files | Lines |
|
This avoids generating a warning like:
WARNING: Public IP <ip> hosted on interface <iface> but VNN says <altname>
every time a public IP is removed from an interface that is configured
via an altname.
The new check will nearly always be successful because the IP will be
on the expected interface during releaseip/updateip.
The original check is now used as a backup when the IP is not on the
expected interface. To allow the mask bits check to cover both cases,
the original check and the associated interface check needs to be
inside the else clause.
Update the unit test to reflect the change.
Best reviewed with "git show -w" or similar.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Apr 17 00:11:50 UTC 2026 on atb-devel-224
|
|
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>
|
|
Only implemented for these commands. I don't even want to think about
doing this for ip route right now.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Status is different to state and should not be repeated. For example:
eth0 UP aa:bb:cc:dd:ee:ff <BROADCAST,MULTICAST,UP,LOWER_UP>
Clearly nothing looks at this field but it should be correct.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
get_iface_ip_maskbits() now sets iface="" when the IP is unassigned,
allowing dependent code to be conditional.
Currently, ctdb_takeover.c:ctdb_control_release_ip() ensures no
releaseip event is triggered if the public address is not on the node.
So, no change of behaviour for releaseip.
The previous attempt at making updateip behave more like takeip when
the IP isn't currently assigned caused commands with missing mask bits
to be run. Avoid this.
Best reviewed with "git show -w" or similar.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
FreeBSD doesn't have an option to print time in nanoseconds.
We need to run something to produce fake "statistics" that are
guaranteed to change. I think this will do - the chances of getting
the same 256 bytes twice in a row seems small enough.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Mar 18 12:33:13 UTC 2026 on atb-devel-224
|
|
NFS is probably wildly different on FreeBSD and statd_callout_helper
uses chown with the --reference option. Too hard.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Use path_helperdir() to help construct the path and then cache the
result in the existing static buffer (with length adjusted because
POSIX says the +1 is not necessary). Given the way this is used by
cluster_mutex_test, there is no (other) sane place to cache it.
path_helperdir_append() could be used to construct the path, but then
there would be an unnecessary talloc() result to free.
The flexibility in unit test cluster_mutex_003.sh was never used, so
remove this test. If other cluster mutex helpers are added then they
can be tested by separate tests.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Replace with a lock_helper member in ctdb_context, set using
path_helperdir_append().
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Simplify the initialisation of the path to eventd in eventd_context
using path_helperdir_append().
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Remove CTDB_RECOVERY_HELPER, CTDB_TAKEOVER_HELPER. Add new struct
members in ctdb_recoverd to contain the paths, set via
path_helperdir_append().
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Remove CTDB_EVENT_HELPER, CTDB_LVS_HELPER, CTDB_NATGW_HELPER. Use
path_helperdir_append() instead.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
As a helper, ctdb-path is in $CTDB_TEST_HELPER_BINDIR, which is in
$PATH.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Replace most remaining uses of CTDB_SCRIPTS_TOOLS_HELPER_DIR and
CTDB_SCRIPTS_HELPER_BINDIR.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
These are covered because CTDB_TEST_HELPER_BINDIR is now added to
PATH.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Now that generated scripts are linked into bin/, nothing needs to be
run from the tools/ directory anymore during self-test. So, introduce
CTDB_TEST_HELPER_BINDIR to replace both CTDB_SCRIPTS_TOOLS_HELPER_DIR
and CTDB_SCRIPTS_HELPER_BINDIR. Add this directory to PATH.
CTDB_TEST_HELPER_BINDIR will also be used in combination with
CTDB_TEST_MODE to allow helpers to be found via a single mechanism
that uses this single variable. This will replace the multiple
mechanisms and variables currently used.
For simplicity, leave the old variables alone for now. Replacing them
in a comprehensible way will take a few steps.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Add most of the fixed files to the associated shellcheck unit test.
Include a couple of formatting fixups.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Best reviewed with "git show -w" or similar.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Run ctdb sub-command with '--json' flag only when code has been compiled
with json support. Otherwise, ignore the test silently.
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
sm-notify is required when an NFS client reboots.
rpc-statd on the client will send an sm-notify to
rpc-statd on the NFS sever.
Add a test case.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15938
Signed-off-by: Peter Schwenke <pschwenke@ddn.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Feb 18 12:29:16 UTC 2026 on atb-devel-224
|
|
We no longer delete shared state (and send notifies) for
IPs previously held by the current node. The NFS lock manager
won't have released locks for these IPs, so won't generate
SM_MON on reclaim attempts. Therefore, there will be
no add-client to put them back.
We now record newly taken IP addresses in takeip,
and only send notifies for those during
ipreallocated. The extra notifies were also confusing
statd.
Update existing tests to always simulate taking all of a node's IPs.
This causes no output changes.
Test updates confirm the subtleties of the statd_callout_helper
behaviour change. These pretend to only take a single IP, so
SM_NOTIFY must not be sent for other IPs. Shared state should
remain for these other files.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15939
Signed-off-by: Peter Schwenke <pschwenke@ddn.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Don't cheat. Keep some state about what is happening, similar to what
statd_callout and statd_callout_helper are expected to keep. This
means hinting arguments to check_shared_storage_statd_state() and
check_statd_callout_smnotify() can be dropped.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15939
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
When run as root, this test's expected output is missing:
Loading tunables from ...
at the top.
Fix this by using the correct function to construct the expected
output.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
|
|
There is no use failing this when it could behave more like takeip.
Use old interface of "__none__" as a hint that ctdbd doesn't think the
IP is assigned either. In this case print a warning instead of an
error. Take some care to avoid spurious errors in updateip.
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.
Update test to match.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15935
Reported-by: Bailey Allison <ballison@45drives.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Oct 17 06:28:30 UTC 2025 on atb-devel-224
|
|
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 <ballison@45drives.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
setup_ctdb_base() should always create from etc-ctdb/. That directory
may be changed to not include the legacy/ component subdirectory, so
don't hard-code this particular subdirectory.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 14 17:57:49 UTC 2025 on atb-devel-224
|
|
$ ctdb/tests/local_daemons.sh foo onnode 0 ctdb event script list legacy
Unable to find event script installation directory: foo/node.0/share/events/legacy
This happens if the $CTDB_BASE/share/events/legacy/ directory does not
exist. This directory is (theoretically) for installed but not
necessarily enabled event scripts. ctdb/tests/etc-ctdb/ contains
events/legacy/ but setup_ctdb_base() currently does not ensure
creation of the corresponding directory under $CTDB_BASE/share/.
Ensure that an event script component installation subdirectory exists
for each corresponding configuration subdirectory.
An alternative would be to continue to allow the existing failure, but
create directory ctdb/tests/etc-ctdb/share/events/legacy/ specifically
to make local_daemons.sh work. However, it took 5 years to find the
current bug, so this may be too subtle for other users of
local_daemons.sh. Anyone wanting to test the failure case can remove
unwanted subdirectories after "local_daemons.sh setup".
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
|
|
The current message:
Command script list finished with result=2
does not clearly explain the problem.
Improve it.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
|
|
Best reviewed with "git show -w".
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
|
|
At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this. So, no longer allow this.
This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..
Details...
The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack. However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.
Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.
An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2). However, these system calls are not well
defined on sockets. Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)). It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).
I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments. However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15921
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: *GUIAR OQBA * <techokba@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jul 28 06:45:51 UTC 2025 on atb-devel-224
|
|
Coverity doesn't like the fopen(3) after stat(2). This is test code
that runs in a simple test environment, so this doesn't really matter.
However, reorder the code to put the stat(2) after the fopen(3). This
means that the test still does all the same checks and it should now
make Coverity happy.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
The missing 2nd file testcase becomes the missing directory testcase,
because you can't easily have both. See the comment in
tunable_test.c.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
The second file is optional.
Make $tfile the default to avoid having to update all of the single
file testcases.
Add test cases for second file.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
When loading multiple files, this is more informative.
Tweak a couple of error messages to ensure they all mention
"tunables".
Update the unit testcases to match.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
Switch the unit test script to INFO debug level to ensure this output
appears when expected.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
Make tunable_test respect CTDB_DEBUGLEVEL. Using test_options.[ch]
would be overkill here. This means including logging.c - we can't
link to the subsystem containing logging.c because the file being
tested (tunable.c) is part of that subsystem.
Support logging in the test script. tunable_ok() builds the logging
output for the good path. Set the debug level to NOTICE and update
expected results for individual failure path tests.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
Dropping this from ctdb_tunable_load_file() allows that function to be
called multiple times for different files. The caller sets the
defaults.
In the test script, factor out the handling of a single tunables file
in a similar way. Ignoring missing/unreadable files is OK because
this function will only be called for test successes (hence "ok" in
the name). There will never be existing, unreadable files. The code
being tested ignores missing files, so do that here too.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
Best reviewed with "git show -w".
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
See documentation change for details.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15858
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
Allows the timeout for failover during shutdown to be modified.
Defaults to 10s.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15858
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
SQ
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
This database isn't use throughout CTDB, so name the it more
specifically.
Note that this might cause locks to be lost during upgrade to the
first version containing this change.
For testing, a different name is chosen to exercise related
functionality.
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Dec 13 15:01:10 UTC 2024 on atb-devel-224
|
|
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|