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

77 Commits

Author SHA1 Message Date
Martin Schwenke
4528c55d3e tests/eventscripts: Use a canned ctdb.sysconfig rather than a link
The link is hard to manage and has no real advantage.

The canned config is 2 of the 3 currently non-comment/whitespace lines
in config/ctdb.sysconfig.

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

(This used to be ctdb commit 66d0b913301c3b1037278bcaa0452ecbe07248df)
2012-04-27 15:42:43 +10:00
Martin Schwenke
a4083f2e97 tests/eventscripts: Explicitly set CTDB_SERVICE_AUTOSTARTSTOP="yes"
No use depending on defaults in the initscript - the tests should
control what is tested.

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

(This used to be ctdb commit 1c37abac5fd18c139aa55989d0fb6b475f4c22f1)
2012-04-27 15:42:42 +10:00
Martin Schwenke
6a21c819e7 tests/eventscripts: Be more defensive about removing the var directory
Could add -r but that might avoid error.  The only time it doesn't
exist is the 1st time a top-level var directory is used.

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

(This used to be ctdb commit 047d97dc84a5943556efb31bb2856fd04835fffa)
2012-04-27 15:42:42 +10:00
Martin Schwenke
a14671f829 tests/eventscripts: Add sanity check to esnure events.d/ can be found
If it can't, the installation is probably inconsistent, so a
(hopefully) helpful message is printed.  :-)

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

(This used to be ctdb commit df732ca8e27f0f3417b4d5d259157bd0e0632124)
2012-04-27 15:42:42 +10:00
Martin Schwenke
e0f4f2c501 tests/eventscripts: $FAKE_IP_STATE is always set in ip command stub
No need for a default, especially since there is no sane default!

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

(This used to be ctdb commit b430a5f61cfdc28e967890602ce6dac0e922c07d)
2012-04-27 15:42:42 +10:00
Martin Schwenke
cb09959063 tests: Unit tests should use $TEST_VAR_DIR
This directory is already guaranteed to be absolute, so no check is
needed.

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

(This used to be ctdb commit 78f6f209eb15102f4e8baa9106583df0ef4bb693)
2012-04-27 15:42:42 +10:00
Martin Schwenke
6757ad62f4 tests: Make run_tests -X more flexible - it now works with onnode
Hardcoding "sh -x" is suboptimal because some scripts, like onnode,
require bash.

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

(This used to be ctdb commit 246809af64c03d26288abff5907ed46614e72b15)
2012-04-27 15:40:43 +10:00
Martin Schwenke
6764b7b33e tests: Update README files and add new README files where missing
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bef03b32f8ec114a64c55b25951aeeb939d87b33)
2012-04-27 15:40:43 +10:00
Martin Schwenke
43f1209dc4 tests: Programs run by tests should be found in $PATH
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b5308142d03332d6d4e0c3b77283c772462fbb23)
2012-04-27 15:40:43 +10:00
Martin Schwenke
116f19b808 tests: More unit test factoring/rationalisation and bug fixes
Move some options from eventscripts/run_tests.sh to scripts/run_tests.
Remove the former.

Move some functions from eventscripts/scripts/local.sh to
scripts/unit.sh.

Both of these are modified during move so they are no longer
eventscript-specific.

Tweak */local.sh so that the new functions in unit.sh are used.

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

(This used to be ctdb commit 7ff485687891732074c9fc9998502ca197663d02)
2012-04-18 10:37:45 +10:00
Martin Schwenke
6e05811c28 tests/eventscripts: Share directories must be absolute in eventscript tests
This fixes eventscripts/scripts/local.sh:setup_generic() so that
directories listed in $FAKE_SHARES are absolute instead of potentially
relative (and, therefore, ignored by the NFS share check).

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

(This used to be ctdb commit 8544162b7a4efa23c92bc0d2774df95bb7f0f463)
2012-04-18 10:35:25 +10:00
Martin Schwenke
aaa6565977 tests/eventscripts: Tweak an error message in a policy routing test
It currently has my home directory pasted into it.  That can't be
right...  ;-)

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

(This used to be ctdb commit 5d6e71cf6e1e0665ec96e7e4e2cfd31f40ebabae)
2012-04-17 12:57:46 +10:00
Martin Schwenke
df39a671db tests/eventscripts - Restructure according to new convention
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)
2012-04-16 16:24:12 +10:00
Martin Schwenke
8d328920db Tests - eventscripts - initial policy routing tests
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7d7488a49bc7e799f39f3da3fa81be7a2e14480a)
2012-03-22 15:30:27 +11:00
Martin Schwenke
c0931a0cde Tests - eventscripts - new function simple_test_command()
Allows running arbitrary command and comparing output against
expected.

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

(This used to be ctdb commit da2e9650a97f99e7d694659926d9958927edd8ad)
2012-03-22 15:30:27 +11:00
Martin Schwenke
2f312355c7 Tests - eventscripts - change summary columns
To accommodate 13.per_ip-routing in output.

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

(This used to be ctdb commit 0142729c96b8bfecfabe35439071557bcc6ed4da)
2012-03-22 15:30:27 +11:00
Martin Schwenke
746d116649 Tests - eventscripts - rationalise CTDB fakery support
Remove functions for marking nodes as down/up.  This is now done via
ctdb disable/enable in the stub.

Also more consistent temporary directory use.

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

(This used to be ctdb commit 1db9a533aacc6e02ddbadf76241429144a949e1c)
2012-03-22 15:30:27 +11:00
Martin Schwenke
42400a155b Tests - eventscripts - improved support functions for handling public IPs
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 299ce89fb3deeefcc7c01b20197dc6adee1e8194)
2012-03-22 15:30:27 +11:00
Martin Schwenke
f8a1273fc1 Tests - eventscripts - add support functions for policy routing testing
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79eec235ac9b051333751186c32924d92e6ebeff)
2012-03-22 15:30:27 +11:00
Martin Schwenke
5ecc348072 Tests - eventscripts - fix hardcoding error
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9c30bf7fd3d94884e27a258571a28dca5e460177)
2012-03-22 15:30:27 +11:00
Martin Schwenke
5afbb43038 Tests - eventscripts - stub ctdb command updates
* Proper IP (re)allocation using ctdbd's IP allocation algorithm.
* Therefore, "ctdb ip" works sensibly.
* Add enable, disable, moveip.

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

(This used to be ctdb commit 6d4b4b1293ba960d8fdf81958d6e8dd23c9d771a)
2012-03-22 15:30:27 +11:00
Martin Schwenke
cb0b0e0ae0 Tests - eventscripts - more public IPs in default setup
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 38396185effbcf313678c2e94d4bd20f534c4f03)
2012-03-22 15:30:27 +11:00
Martin Schwenke
52e7a03853 Tests - eventscripts - add -A/-D options
Make it easier to spot differences between desired output and actual
output.

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

(This used to be ctdb commit d132a8f4a8c0573ac447713a71911f02b6f0d73c)
2012-03-22 15:30:27 +11:00
Martin Schwenke
c394b7d065 Tests - eventscripts - ip stub command should print errors to stderr
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 236d572556e447e2d82d14d2c8a40ed8cb98944d)
2012-03-22 15:30:27 +11:00
Martin Schwenke
6e260553f5 Eventscript tests - implement ip route in stub
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ac2cd2a8cbed97348ceae54167ad83cb074ff6b3)
2012-03-22 15:30:27 +11:00
Martin Schwenke
d0f25b3c37 Eventscript tests - implement ip rule in stub
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 26292f362890ca6cb65d0028d50fa97458e0449f)
2012-03-22 15:30:27 +11:00
Martin Schwenke
60b5ff0e4b Eventscript tests - make ip command stub vaguely maintainable
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8b8e17bea87a8c16f7c0f54fcfe29190f203f673)
2012-03-22 15:30:27 +11:00
Martin Schwenke
3b024ab2bd Eventscript tests - make error message consistent with recent change
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f4949b3c1b36949544e98c9fbb64447f94f9e432)
2012-03-22 15:30:27 +11:00
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
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
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
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
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