1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

3581 Commits

Author SHA1 Message Date
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
Martin Schwenke
e4ba51effd Tests - eventscripts - remove undefined argument in some simple_test calls
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c490024aba39cf94cbc9f8f41ecb3d336b1c82a8)
2011-08-30 16:51:55 +10:00
Martin Schwenke
dcd37aadef Tests - evenscripts - add symlink to ctdb.sysconfig
Some of the tests expect the default to be

  CTDB_SERVICE_AUTOSTARTSTOP=yes

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

(This used to be ctdb commit f7de037e3be2e9910bee644dd1e93bae4912a194)
2011-08-30 16:51:55 +10:00
Martin Schwenke
857e144a97 Tests - eventscripts - Samba TCP port checking fixes
Expect "ctdb checktcpport" to exit with 1 if not implemented.

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

(This used to be ctdb commit 20885d592040eb3945524c558b593a1d50a57b43)
2011-08-30 16:51:55 +10:00
Martin Schwenke
5de459f94e Tests - eventscripts - TCP port checking, no working checkers
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b231aa629b909a7dfd071236c7e730e3cc4a1a54)
2011-08-30 16:51:55 +10:00
Martin Schwenke
9b8e25d03b Tests - eventscripts - new Samba TCP port checking test - no nmap
This one should fall back to netstat.

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

(This used to be ctdb commit 0a08068f736efe56b4799e1f1f90539d257deb71)
2011-08-30 16:51:55 +10:00
Martin Schwenke
fe730830a7 Tests - eventscripts - nmap and netstat stubs can pretend they weren't found
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 47f2843b4db767bcc724d8f972e0c2a850d5826f)
2011-08-30 16:51:55 +10:00
Martin Schwenke
7fc7ebb5ac Tests - eventscripts - new Samba tests to test TCP port checking
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9e3e6ab3edf0f79d5973eb39ed843d3c369c665d)
2011-08-30 16:51:55 +10:00
Martin Schwenke
764b425a96 Tests - eventscripts - add a new ctdb_not_implemented() function
This allowed a single ctdb command to be defined as not-implemented
and provided the associated output from the ctdb stub in
$ctdb_not_implemented.

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

(This used to be ctdb commit 3852c091f5e0ecba06b7131ca04b73a0cd632f23)
2011-08-30 16:51:55 +10:00
Martin Schwenke
bda5f71c13 Tests - eventscripts - new function setup_nmap_output_filter()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ef6131ecb068f7d8402cc782359509ba54b5adb0)
2011-08-30 16:51:55 +10:00
Martin Schwenke
5574b3b6fe Tests - eventscripts - add some output filtering
This allows $OUT_FILTER to be set to one or more sed commands to
filter eventscript output.  This allows expected output to be
generalised.

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

(This used to be ctdb commit a1d424045c53f5b148952eade6161af8248ed4df)
2011-08-30 16:51:55 +10:00
Martin Schwenke
58687f52be Tests - eventscripts - ctdb default default level is 0.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fcf40500c2158dfbe2390fad7bf0614cc575df14)
2011-08-30 16:51:55 +10:00
Martin Schwenke
c9305f5dda Tests - eventscripts - add output for "not implemented" in ctdb stub
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 1d02e3c6a7fb5ad5edb21298deba415ba9519f3d)
2011-08-30 16:51:55 +10:00
Martin Schwenke
e88df4289f Tests - eventscripts - add an nmap stub
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6ff9545a0fd58f0728b769c7b36d3b6ab7366321)
2011-08-30 16:51:55 +10:00
Martin Schwenke
7b2e79ab7f Tests - eventscripts - stop timeouts waiting for backgrounded testparm
Not sleeping at all speeds up the tests.  However, it can also cause
timeouts.  Therefore, every time sleep is run we force the stub to do
a short 0.1s sleep instead of whatever is specified.  This should be
enough to avoid races.

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

(This used to be ctdb commit 59a1d54bcc15058f7b69e8596b32b26427a3ae57)
2011-08-30 16:51:55 +10:00
Martin Schwenke
6eb339e2c7 Tests - add getdebug and checktcpport to ctdb eventscripts stub
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9c6fd7d21c99e605e20620c5c6b4e695c02af771)
2011-08-30 16:51:55 +10:00
Martin Schwenke
21c17cc100 Tests - add hooks to simulate ctdb commands that aren't implemented
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e9bdfd43af3ed28a7f69a36e3fb037f252a23869)
2011-08-30 16:51:55 +10:00
Martin Schwenke
d2527e3e5b Tests - add eventscripts testing stub for sleep command.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit aedff41ee1df0a1a573476844993fa8eda2f34bf)
2011-08-30 16:51:55 +10:00
Martin Schwenke
7d7851dd45 Tests - Change variable used to fake listening TCP ports.
Change from $FAKE_NETSTAT_TCP_LISTEN to $FAKE_TCP_LISTEN.

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

(This used to be ctdb commit f19ba38e382034fba769145d0bfc81b2c2941563)
2011-08-30 16:51:55 +10:00
Martin Schwenke
62f2d160ac Tests - new NFS share checking tests
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ea0db472c2ce138c723aa7e633b72ac9d8b8a6a3)
2011-08-30 16:51:55 +10:00
Martin Schwenke
f3c590c199 Tests - eventscripts exportfs stub should splits lines
The real exportfs splits lines longer than 15 characters.  The stub
should do that too...

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

(This used to be ctdb commit fb3e123b097d9e36d281c3ab4f3e9a4799fa27bc)
2011-08-30 16:51:55 +10:00
Martin Schwenke
625e0c5aea Tests - add -T (trace) option to eventscripts run_test.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 08eeb788523afe19760b00f40339b702eb193712)
2011-08-30 16:51:54 +10:00
Martin Schwenke
aa64622137 Eventscripts - use ctdb scriptstatus -Y when replaying status
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5be904fb1fbd546618d25509b41ab836db62a70a)
2011-08-30 16:34:43 +10:00
Martin Schwenke
b97625acb6 Eventscripts: add a synchronous synthetic reconfigure event.
In the current code services can only be reconfigured asynchronously.
This means that configuration file changes can be made, an asychronous
reconfigure event can be triggered, and it always succeeds.  Some time
later when a service is actually reconfigured then a failure may be
seen

This adds a synthetic reconfigure event that reconfigures a service
synchronously so that any failure is reported on exit.

ctdb_service_check_reconfigure() is essentially reimplemented.

If a reconfigure event is in flight and an ipreallocated or monitor
event occurs then any scheduled asynchronous reconfigure is deferred
until the next monitor cycle.  This is to avoid reconfigures trampling
on each other.  In this case a monitor event will also replay the
previous status to try to avoid exposing any temporary instability.

If a reconfigure event collides with another reconfigure event it will
exit with status 2, indicating that the reconfigure should be retried.

The reconfigure event is implemented using a subprocess to control the
exit from the synthetic event.

As before, if a monitor event causes a scheduled synchronous
reconfigure to occure then it will replay the previous status for the
service, given that a reconfigure can cause temporary instability.

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

(This used to be ctdb commit 220578bfd3507152b29ba4c28942f9d5e8733886)
2011-08-30 14:29:48 +10:00
Martin Schwenke
94c3429567 Eventscripts - call ctdb_check_args() in 00.ctdb
This is the first eventscript.  Sanity check as early as possible and
everyone benefits.

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

(This used to be ctdb commit 0564717fcc1e21688ae5dacbd437fd493bcb8853)
2011-08-30 09:33:47 +10:00
Martin Schwenke
bc4e62be85 Eventscripts - call ctdb_check_args() instead of doing hand checking
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cc5bc1948dcbe8b8b25185260927b94a4b529174)
2011-08-30 09:33:47 +10:00
Martin Schwenke
7980a4cb44 Eventscripts - new function ctdb_check_args()
Pass this "$@" to do common eventscript argument checking.

For regular use putting this in 00.ctdb would be enough.  However, for
developer testing it can be useful to call this in other eventscripts.
For example, 10.interfaces and 13.per_ip_routing currently check these
by hand.

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

(This used to be ctdb commit 36de7e7fd6dfeed61ef9977b8d5b568f90a9707b)
2011-08-30 09:33:47 +10:00
Martin Schwenke
63729fc35d Eventscripts - ctdb_check_tcp_ports() bug fix.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e8d9c0b251c84d6fdf6ea7d972e5f7d1d0222f9b)
2011-08-30 09:33:47 +10:00
Martin Schwenke
194de8faf8 Eventscripts - fix debugging buglet in ctdb_check_tcp_ports_ctdb()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 61000e38d6016e58f67e292393756d0bd5262ae5)
2011-08-30 09:33:47 +10:00
Martin Schwenke
9257b57f2c Eventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.
Some of the current auto-start/stop logic is broken, particularly for
Samba.  Fixing it is non-trivial.

If $CTDB_SERVICE_AUTOSTARTSTOP is "yes" then auto-start/stop services
when told to newly manage or no longer manage them.  This defaults to
"yes".

However, if using a canned configuration file that doesn't set
$CTDB_SERVICE_AUTOSTARTSTOP then this stops the auto-start-stop logic
from working.  Therefore, this works around CQ S1026685 - on the
system in question another daemon controls service auto-start/stop and
CTDB just gets in the way.

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

(This used to be ctdb commit ef71b8290ae49117d7bcc7166598b77cb64cc8a0)
2011-08-30 09:33:47 +10:00
Martin Schwenke
54402cdff4 Eventscripts - in 60.nfs uniquify the share check directory list
There are sites that have multiple entries for the same export.  This
optimises the share check in this case.

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

(This used to be ctdb commit 1ccdae79b64b236fc27f4653606429d73c9c3595)
2011-08-30 09:33:47 +10:00
Ronnie Sahlberg
2902203900 Logging: when we log stdout/stderr messages from eventscripts to the system log, prefix every line of output with the name of the eventscript.
CQ S1028412

(This used to be ctdb commit 392363c04185f47a826fc6ed95038342be2150bf)
2011-08-26 09:39:25 +10:00
Ronnie Sahlberg
6692512299 LibCTDB : update the ctdb tool to use libctdb to read the recovery mode
(This used to be ctdb commit 750a31cf95c356a0ee071967537eb615dce35845)
2011-08-23 16:35:08 +10:00
Ronnie Sahlberg
75afbee956 LibCTDB : uptade the ctdb tool to use libctdb to query for the recmaster
(This used to be ctdb commit 81c14c8625a6d5670b8795a655d7a3f3318009e5)
2011-08-23 16:32:38 +10:00
Ronnie Sahlberg
7e29817f61 LibCTDB : initialize ctdb->pnn to -1 when we create a new context
but before we learn the pnn of the local node

(This used to be ctdb commit 2cc48be3219b887b85649a14db311af0549041cf)
2011-08-23 16:16:48 +10:00
Ronnie Sahlberg
c0f724e0f9 LibCTDB : change the ctdb_fetch_lock_once test tool to use libctdb instead of the old client
(This used to be ctdb commit cd1080726d7787b335ab4bfb64a7991237ab92f5)
2011-08-23 15:32:27 +10:00
Ronnie Sahlberg
b00b0e9d2e LibCTDB : add support for getrecmode
(This used to be ctdb commit b663f286ea8edd64c0405a1ab45b6ef1da501bf5)
2011-08-23 15:32:14 +10:00
Ronnie Sahlberg
af19b5acff LibCTDB: add commands where an application can query how many commands are active
and we have not yet received a reply to.
Applications may use this command to query if it is "safe" to stop the event system and sleep
or whether it should first wait for all activity to ctdb daemons to cease first.

(This used to be ctdb commit 8d89bfdfd1f55dfeb22890b8bb0f08f31d1fa91a)
2011-08-23 12:43:16 +10:00
Volker Lendecke
1cf1670f0a Fix a const warning
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit e25559087c9752502580875f7e33f3c416c05f84)
2011-08-22 17:11:07 +02:00
Volker Lendecke
fff653d126 Remove an unused variable
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 04c3d9c7c9ffa8bb95b0bf1513fd79f6c1096a2f)
2011-08-22 17:11:07 +02:00
Volker Lendecke
85bc1ccb7e libctdb: "unpack_reply_control" does not need the ctdb_connection parameter
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit bb8f68f0256c43fe0671fe45023d1c88e340ad96)
2011-08-22 17:11:07 +02:00
Volker Lendecke
da528a65b1 libctdb: "unpack_reply_call" does not need the ctdb_connection parameter
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 77ae553249ef1e1d467d792ac033f2aaa4e337e6)
2011-08-22 17:11:07 +02:00
Volker Lendecke
21bb8abc93 libctdb: "ctdb_request_free" does not need the ctdb_connection parameter
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 5a5ed2a43b76bec69494b6cdc6451527f5c472e5)
2011-08-22 17:11:07 +02:00
Volker Lendecke
b0706be89e libctdb: Make sure ctdb_request->ctdb is filled correctly
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 06433d20a43d41f05b96a9dda6dc5931539feaa3)
2011-08-22 17:11:06 +02:00
Volker Lendecke
8638b5f5d2 libctdb: Ensure 0-termination of sun_path
Rusty, please check!

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 955f67a02026b157440d2ae87ead193773331e75)
2011-08-22 17:11:06 +02:00
Volker Lendecke
b4fd8024b5 libctdb: Fix a few format warnings
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit fa6564c24429e084be728dbe6eea1dec13e58709)
2011-08-22 17:11:06 +02:00
Volker Lendecke
ef64060898 libctdb: Add license header to messages.c
Rusty, please check!

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 4bceba374be82e76ba5d9d923172e85e9365b990)
2011-08-22 17:11:06 +02:00
Volker Lendecke
d55e6cf53c libctdb: Reorder attachdb
No code change, this is for easier reading the sequence of what happens

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 883b9b185dce03a6bf233fbf2cfabad9883519e5)
2011-08-22 17:11:06 +02:00
Volker Lendecke
a31d7516f5 libctdb: Reorder set_message_handler
No code change, this is for better readability

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit e0f93459e05eef33024096654b4aaf1eb3c6d7c4)
2011-08-22 17:11:06 +02:00