1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

699 Commits

Author SHA1 Message Date
Martin Schwenke
c497e4bc19 Tests: eventscripts - fix breakage in some NFS tests
1341329f6125d491b82c873f793af819e677f714 either contains typos or
attempts to influence the test depending on the host system.  Whatever
the cause, a test system (e.g. my laptop) might not have
/etc/sysconfig/nfs, so that can't be used to cause the stub
etc/sysconfig/nfs to be loaded.

We make the tests work by default again, leaving in some flexibility
over configuration file location.

If the goal is to force a Debian-style test mode then:

* The tests are currently probably quite RHEL-centric anyway, so more
  work is probably needed.

* Use an environment variable to indicate the distro test mode and
  make functions like setup_nfs() remove all of the various
  configuration files and create one in the distro-specific location.

I won't do this now... ENOTIME...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4aa4a5790ea9ad20e4d25404760c449b358b5260)
2012-02-06 16:02:09 +11:00
Martin Schwenke
4e01fedea5 Tests: eventscripts - make init test pass with recent change to 10.interface
e646142f4d28b5401235cd5edee325f7a29f8193 changes the output on the
init event.  This accommodates that change.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 48cb55aae47d11487bdf004a79df56779d1825a0)
2012-02-06 16:02:09 +11:00
Martin Schwenke
6ba3e67796 Tests: new test to check that "ctdb delip" removes the IP from interface.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a63e603cb7e21a7334c6a07bc4415ff089dab3c1)
2012-02-06 16:02:09 +11:00
Martin Schwenke
8bcad72c41 Tests - ctdb tool - add verbose option and output filtering
Need to filter dates before comparing...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6127515ea62173ff1574d1217129ec05a8fbeb3f)
2012-02-06 16:00:24 +11:00
Martin Schwenke
a856514c28 Tests - ctdb tool - fix "ctdb status" test
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 47e86c33d768816d03817124481bb6aa967bf2a6)
2012-02-06 16:00:24 +11:00
Martin Schwenke
72961bc163 Tests - let run_tests.sh take a list of tests to run
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fa00bbf7d7378eecb5ba77684d01db90c9370bca)
2012-02-06 16:00:24 +11:00
Martin Schwenke
9f2ce614a7 Tests: initial ctdb tool testcases
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 47e9975fa75a7bb2628a751dc19d35e2c5c57ce3)
2012-02-06 16:00:24 +11:00
Martin Schwenke
e420c6b801 Tests: fix usage message in ctdb_tool_libctdb
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ca1d2bb62e61b7d723a648b3a9b146e258efcabb)
2012-02-06 16:00:24 +11:00
Martin Schwenke
ed9eecb6bb Tests: libctdb stubs should fail when current node disconnected
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f96954b42b03f810f7b1732b5fe00c5dab2d8cb8)
2012-02-06 16:00:24 +11:00
Martin Schwenke
31487f31df Tests - add a version of the ctdb tool that compiles against libctdb stubs
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6c79b951c3ae68238f8dbd836ceca6c1187eaabe)
2012-02-06 16:00:24 +11:00
Martin Schwenke
7a1ed19578 Tests - allow tools/ctdb.c:main() to be used
We'll need stubs somewhere else...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6f29c39d666485fddef60e9d87bf94082d179ebb)
2012-02-06 16:00:23 +11:00
Martin Schwenke
4bf69a0fff Tests - more libctdb stub test infrastructure
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 25a0136bd773e7ed8dfda635471f0498d4a7afe9)
2012-02-06 16:00:23 +11:00
Martin Schwenke
ea22ce5c72 Tests - more libctdb stubs and supporting state faking functions
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9bfc3b04ffeca056d8507d1cc8bc20f56c8e1572)
2012-02-06 16:00:23 +11:00
Martin Schwenke
97863216ed Tests - update test code for ctdb tool code and libctdb stubs
Rename ctdb_parse_nodestring.c to ctdb_tool_libctdb.c.  It can contain
many tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d597020af01dfcdf0d39e1cf579bf33f43f87dda)
2012-02-06 16:00:23 +11:00
Ronnie Sahlberg
0d084a9bfa ReadOnly: update the loop test tool to print number of fetches per second
(This used to be ctdb commit f53c66a5e0dc5351b86b81dc5b1faea757981d4c)
2012-02-01 09:32:02 +11:00
Ronnie Sahlberg
b417300668 Merge remote branch 'martins/nodestatus'
(This used to be ctdb commit adcb076612c56f92cfb6f3ba90721981a067a494)
2012-01-03 12:31:37 +11:00
Martin Schwenke
36462d46f4 Tests: eventscripts - add tests for CTDB_DELETE_UNEXPECTED_IPS="yes"
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 00373958a5d5fb8c9b99548d5b9f327e78669162)
2011-12-19 11:29:46 +11:00
Martin Schwenke
0b83a49301 Tests - make a comment more accurate
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 726b598076132a5a73f9259d6b65ee2a4012099f)
2011-12-08 17:21:24 +11:00
Martin Schwenke
af7611e4e0 Tests - test code for parse_nodestring() function
This function is fairly complex so here is some test code.

This reworks Makefile a bit and also provides test stubs for some
libctdb functions.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5b11f990404c26c279c9ae389483e560f1c01a81)
2011-12-08 17:21:24 +11:00
Martin Schwenke
bbe7cfd28f Tests: change ctdb_takeover_tests.c to include ctdbd code
Do this instead of linking to it.  This means that, after previous
cleanups, we can fix ctdb_takeover.c to use static functions when
appropriate and simply include all the code we need to run tests.

To make this reusable in other tests, new file ctdbd_tests.c does all
of the relevant including.  ctdb_takeover_tests.c just includes that
file.

Test objects built in this way can depend on new Makefile macro
$(CTDB_TEST_C), which contains ctdbd_tests.c and everything it
includes.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 41869d42194b74db43a176a068e96e411007e5f2)
2011-11-11 14:31:50 +11:00
Martin Schwenke
ddb0838b7e Clean up warnings: remove set but unused variable from rb_test
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d0244fec8d0dd2abd31a8677e2c2b254b030c47b)
2011-11-09 15:36:09 +11:00
Martin Schwenke
c1e8ea08e3 Clean up warnings: log some unchecked return codes from function calls
In a few places functions are called, the return code is assigned into
a variable but it is not checked.  This generates a compiler warning
like this:

  warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Instead we remove the warning by checking the return code variable and
log a warning at DEBUG level if the return code indicates an error.
The justification is that there may have been a future intent to check
the return code but it hasn't been important enough to follow-up.  If
it matters, it will be logged for easy debugging.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1932466c76de2b184c2a257120768ab8c9d6c12a)
2011-11-09 15:20:07 +11:00
Mathieu Parent
4617a0e9cf config can be in /etc/default/ instead of /etc/sysconfig/
... on Debian system and derivated.

(ctdb_diagnostics still hardcodes /etc/sysconfig/)

(This used to be ctdb commit 1341329f6125d491b82c873f793af819e677f714)
2011-11-08 16:31:15 +11:00
Ronnie Sahlberg
8db9b73920 Merge remote branch 'martins/lcp2fix'
(This used to be ctdb commit 7c02d242af552aa732f5c70ea4eeefbc8a8542e2)
2011-11-08 14:06:30 +11:00
Ronnie Sahlberg
afd0b63273 Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master
(This used to be ctdb commit d772743e9a4d4d40eb95cd8d5178708e77057b79)
2011-11-08 14:01:22 +11:00
Ronnie Sahlberg
0f92fa224c RB_TREE: Add mechanism to abort a traverse
This patch changes the callback signature for traversal
functions to allow a client to abort a traverse before it finishes.
Updates to all callers and examples as well as rb-test tool.

(This used to be ctdb commit 8ab0c63ad36cfbbb1e5fed46a1f4c47b1fdb581f)
2011-11-08 13:40:28 +11:00
Martin Schwenke
cb21f178e3 Tests - IP allocation - add some extra output due to recent fix
A recent fix made the LCP2 algorithm try harder find a candidate
source node.  The debug output shows extra output because it is trying
harder so we accommodate that.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9a6f918bf6db79c1f8c53c0df23d47b73c117ea2)
2011-11-02 10:17:00 +11:00
Martin Schwenke
575f76788b Tests - IP allocation - new test that shows current LCP2 failure
There are 4 IPs across 2 nodes and 2 addresses across 2 other nodes.
If one of the latter nodes is unhealthy and then becomes healthy
again, an IP isn't failed back.  This is because the nodes in the 1st
group are >= unbalanced then the nodes in the 2nd group.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1d26e7cff6292fcbf63efc4628ffbb63b6f1f73c)
2011-11-01 21:01:25 +11:00
Martin Schwenke
fa29fdf9ba Tests - Allow some tests in ctdb_takover_tests to specify allowed nodes
This mainly applies to ctdb_takeover_run_core when you might want to
specify that some IPs can only be hosted by some nodes.

Syntax on each line is now:

IP current_pnn  allowed_pnns

where allowed_pnns is a comma-separated list.

allowed_pnns is optional.  If not specified then address can be
assigned to all nodes that aren't included in an allowed_pnns list.
Just think of it as all PNNs and that the behaviour is undefined when
you only specify allowed_pnns for some IPs.  ;-)

current_pnn is optional and defaults to -1.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ed83604da82ebe566d6eb330ab7119e861e853c8)
2011-11-01 21:01:25 +11:00
Martin Schwenke
695432c52f Tests - IP allocation tests - must export CTDB_LCP2.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a97f19d1281eaf9874e64995a43524aeed315515)
2011-11-01 21:01:25 +11:00
Ronnie Sahlberg
1f74d60491 Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master
(This used to be ctdb commit bdcaf531e07ad5a08841aab2f396849c554a0fa6)
2011-10-28 16:04:55 +11:00
Ronnie Sahlberg
263031c73a Tests: convert test tool for fetching a readonly lock to libctdb
(This used to be ctdb commit 18b6969dd1760521f839e5a928f1c7e9b3c34d4e)
2011-10-28 15:50:44 +11:00
Ronnie Sahlberg
4dabd1fe05 Merge remote branch 'martins/tests'
(This used to be ctdb commit 99de5bceb788ba56ebc052c05d29a834ba2496fa)
2011-10-18 11:54:55 +11:00
Mathieu Parent
d71d640d33 Typo deamon -> daemon
Thanks to lintian

(This used to be ctdb commit dd9e508c947613cc7a5046a35c80fbeced408803)
2011-10-12 20:08:08 +11:00
Martin Schwenke
4b606fbb56 Tests - simple integration - do a "ctdb sync" after restarting the cluster
There looks to be a minor race where IPs haven't yet been reallocated
but the cluster is healthy.  This should fix it.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2d6a800a789ca59fdab92422f98a4e05ba55f34c)
2011-09-25 14:45:48 +10:00
Martin Schwenke
155862ea21 Tests - IP allocation - initial unit tests
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3922225ddff90281189ebdab77620b560d233e04)
2011-09-25 14:45:48 +10:00
Martin Schwenke
87b02f5d45 Tests - IP allocation - allow more interesting node states to be specified
Node states on the command line are now comma-separated hex numbers,
so all flag states can be expressed.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1f1534435b9d5f464604e28a8cce2cd0a779ef68)
2011-09-25 14:45:48 +10:00
Ronnie Sahlberg
9b87ffe874 fix some compiler warnings for the test tools
(This used to be ctdb commit dbfd5abafbe66c20c413a4335b2cdbd9cc24052a)
2011-09-13 18:41:34 +10:00
Ronnie Sahlberg
3cbf4875e7 Fix additional breakage from the merge for change in signature for ctdb_cmdline_client() and ctdb_attach()
(This used to be ctdb commit 14656eaa01a8951693fa146b3d35258f7daaafd5)
2011-09-12 09:44:06 +10:00
Ronnie Sahlberg
0dc5584101 Merge branch 'master-readonly-records' into foo
Conflicts:

	Makefile.in
	tools/ctdb.c

(This used to be ctdb commit 0fedef0ffba4178126eee9544c5e2db52f5db893)
2011-09-12 09:34:34 +10:00
David Disseldorp
5296da5609 client: add timeout argument to ctdb_attach
Rather than using a fixed 2 second CTDB_CONTROL_GETDBPATH timeout.

(This used to be ctdb commit 9e178671560cb95121e11d718a76b05380ecd6c5)
2011-09-06 13:57:04 +02:00
David Disseldorp
0628d1c0e6 client: add req timeout argument to ctdb_cmdline_client
Following connection to the local ctdbd, ctdb_cmdline_client() currently
issues a CTDB_CONTROL_GET_PNN request with a fixed 3 second timeout.

The ctdb cmd line client accepts a --timelimit argument for specifying
a per request timeout, pass this value through to ctdb_cmdline_client()
for use as a CTDB_CONTROL_GET_PNN request timeout.

(This used to be ctdb commit 0634d0305f42f17048b6830733767e8dc300e11c)
2011-09-06 13:56:54 +02:00
Martin Schwenke
882fb55bec Tests - eventscripts - add some multievent tests
Running "./run_tests -s simple/* multievent/*" results in a stupid
summary.  Will need to work on that...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 999c68948da1492ac4d728c6bf79ad4921d9e840)
2011-08-31 17:29:14 +10:00
Martin Schwenke
0048849bd2 Tests - eventscripts - allow "ctdb scriptstatus" output to be primed
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f527ffb55b514b5cb4df3471a0e17ab71307e8a1)
2011-08-31 17:27:05 +10:00
Martin Schwenke
91d5edee80 Tests - eventscripts - ctdb stub - implement scriptstatus, tweaks
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit edc34d01a1ad83b1335c976593a006166b196569)
2011-08-30 16:51:55 +10:00
Martin Schwenke
84c67c378e Tests - eventscripts - formatting tweak in simple_test()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 698af79545986cf788686feb06c4677a10eec770)
2011-08-30 16:51:55 +10:00
Martin Schwenke
c8e87d9f00 Tests - eventscripts - new function simple_test_event()
Just like simple_test() but 1st arg is the event name.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 69e240e15488e228c0232fdc8804af778cb4e6fc)
2011-08-30 16:51:55 +10:00
Martin Schwenke
af1a0245b6 Tests - eventscripts - output format tweaks
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8f8dc5636436db28ce7d0edd706a4adf2624e71b)
2011-08-30 16:51:55 +10:00
Martin Schwenke
3167f50b6c Tests - eventscripts - add extra filename format for multi-event tests
$event may not be set so we need to test for it.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 80f14e590242b14829c6309ee908af0f2d33be1e)
2011-08-30 16:51:55 +10:00
Martin Schwenke
1a8d5e0ec7 Tests - eventscripts - add die() function and use it
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0446eaa7798fd0ddf8d8f067c56d19892a13a317)
2011-08-30 16:51:55 +10:00