1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

4351 Commits

Author SHA1 Message Date
Martin Schwenke
dc2dfbdb93 tests: Add installation script for tests
This could all be done in Makefile.in, but that would be very complex.

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

(This used to be ctdb commit 12c9986059cacda819e669fa77d613b408c62599)
2012-04-27 15:42:42 +10:00
Martin Schwenke
46f82181d0 tests/simple: Add new pseudo testcase to potentially shutdown local daemons
Only shuts them down if $TEST_CLEANUP is true.

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

(This used to be ctdb commit eddfc02335202d853e29a89f08225ab44cac8a25)
2012-04-27 15:42:42 +10:00
Martin Schwenke
70270b6815 tests: New run_tests -C (cleanup) option
Sets TEST_CLEANUP=true and causes $TEST_VAR_DIR to be removed... and
potentially other cleanup actions in testcases.

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

(This used to be ctdb commit 3219f221a858e499f084b8beb44610537312602b)
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
451e660338 tests: Time logging in integration tests should use TEST_VAR_DIR
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 734cbd7def23236d418ebc6d813a748a84900101)
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
b7b6f10e9b tests: Improve the logic for adding directories to $PATH
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e6bfd3bdb3a35b2e7e7c41a6f37976772a54e3ce)
2012-04-27 15:42:42 +10:00
Martin Schwenke
d28e268ed6 tests: Update integration.sh to use TEST_VAR_DIR
There are 2 subtleties:

* Local daemons currently use the in-tree tests/events.d/ subdirectory
  for their eventscripts.  However, some tests install/remove test-specific
  eventscripts so now $TEST_VAR_DIR/events.d/ is used and the standard
  eventscripts are copied there at setup time.

* The pgrep/pkill logic for killing local daemons currently relies on
  ctdbd being run with a full path to tests/bin/ctdbd.  If the tests
  are installed and run against an installed daemon then this won't
  work.  Therefore, ctdbd is now expected to be in $PATH and is
  found/killed by matching:

    ctdbd --socket=.* --nlist .* --nopublicipcheck

  This is complex but should avoid killing a real ctdbd running on a
  node.

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

(This used to be ctdb commit 301491802eec0e49e108f5aae7d7be379703d72c)
2012-04-27 15:42:42 +10:00
Martin Schwenke
5b590dfa19 tests: Add a -V option to set new variable TEST_VAR_DIR
Part of preparation to be able to install the tests.  The current var/
subdirectories will end up somewhere in /usr/local/ or /usr/ and we
don't want to put temporary files there.

This creates a temporary TEST_VAR_DIR by default.

If -V is specified then the given directory will be used as
TEST_VAR_DIR.  This allows the current behaviour where individual
integration tests can be run against already-running daemons 9with
sockets and other stuff already created) to save time and trouble.

Yes, there are plans for a clean-up option...  ;-)

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

(This used to be ctdb commit 8e4ec9a40bb7d392d7474b067a74fa121c069007)
2012-04-27 15:42:42 +10:00
Martin Schwenke
7ed4387990 tests/integration: Remove cabability for testcase option
This is unused and can't be used with the current test infrastructure.
It may have been useful with ctdb_test_env but I don't think it was
ever used.

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

(This used to be ctdb commit 4aa879466dd46cb4e8710edbbaac1276521e475b)
2012-04-27 15:40:43 +10:00
Martin Schwenke
286d5aa5b1 tests/integration: Use absolute path for socket symlink
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 709cd5dfeb630096a1cd2062da666fee9ddca715)
2012-04-27 15:40:43 +10:00
Martin Schwenke
edaead3cd5 tests/simple: Replace "tdbdump" with "ctdb cattdb"
tdbdump may not be installed and would be an unnecessary dependency.

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

(This used to be ctdb commit fbabc05569d91bf033f474d89f51b49490943332)
2012-04-27 15:40:43 +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
466ff20156 tests: Update top-level wrapper scripts
* Add the unit tests to "make test"
* Make scripts run from anywhere

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

(This used to be ctdb commit 95947123eee687ed83eebc567397a5bc9d55a945)
2012-04-27 15:40:43 +10:00
Martin Schwenke
c4606275c9 tests: run_tests should exit with failed test status if running with -H
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6eb7fa572e7fc212332ddd68793e3f35161baf7c)
2012-04-27 15:40:43 +10:00
Martin Schwenke
05062d874a tests: test_wrap can use $TEST_SCRIPTS_DIR for a little extra clarity
Also add a comment to explain what is being added to $PATH.

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

(This used to be ctdb commit 704a3e3b83aff63e8f7b0650c141776ed2c1f047)
2012-04-27 15:40:43 +10:00
Amitay Isaacs
2f2e341370 tests: test_wrap needs to set TEST_SCRIPTS_DIR
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 79e979d67e3a2a5a13ef8fd2ef8f56331ec51558)
2012-04-27 15:40:43 +10:00
Amitay Isaacs
2503cb2259 tests: CTDB_TEST_WRAPPER has to be an absolute path on a real cluster
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a0a7759d47ef5de4a8214273e39c50fb1f6e2e0c)
2012-04-27 15:40:43 +10:00
Amitay Isaacs
d9b210b079 tests: Fix wrapper scripts
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit eef162ceaac6853bf1ff622691901289280bc25f)
2012-04-27 15:40:43 +10:00
Martin Schwenke
72ab31b024 tests: Fix trailing whitespace issues in integration.bash
git complains...

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

(This used to be ctdb commit d714cf7924674a7a0eb6d585eb74a6a4df26fc12)
2012-04-27 15:40:43 +10:00
Martin Schwenke
4d08afa0be tests: Add new -H option for run_tests to avoid printing header/footer
This is useful for using run_tests to run one test at a time within an
alternative test framework.

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

(This used to be ctdb commit dc71294a33e88baa4e85fa1fa66cab58a83c2607)
2012-04-27 15:40:43 +10:00
Martin Schwenke
d4b102fe82 tests: Add -e option to cause run_tests to exit on first test failure
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f45295a3005474957852d0e7a5c3807e30ab519d)
2012-04-27 15:40:43 +10:00
Martin Schwenke
21b2190751 tests: Remove ctdb_test_env
Move the contents to integration.bash and run_tests as appropriate.

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

(This used to be ctdb commit 6136ab02db261b26a2a58b526c913e37e8146841)
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
769407feab tests: Move relative directory path hack from run_tests to common.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 66a7fece867966528689d2784a284e32d687a0f5)
2012-04-27 15:40:43 +10:00
Martin Schwenke
f30d4c575e tests: Local daemons are no longer the default, now require run_tests -l
Testing with local daemons is the current default but this is not the
most common use case.  Therefore, we make local daemons optional by
using the -l switch with run_tests or by setting TEST_LOCAL_DAEMONS to
the number of daemons to be used (-l sets this to 3).

TEST_LOCAL_DAEMONS replaces CTDB_TEST_NUM_DAEMONS and
CTDB_TEST_REAL_CLUSTER is removed.

Most relevant logic is moved from ctdb_test_env to integration.bash.
ctdb_test_check_real_cluster() is moved from integration.bash to
complex/scripts/local.bash.

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

(This used to be ctdb commit 72ecae61c43b318ec94b527a12cbb0a382e8c3db)
2012-04-27 15:40:43 +10:00
Martin Schwenke
012015b32c Eventscripts - Fix typo in 13.per_ip_routing support for __auto_link_local__
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9542e770a9780740b49122f1f52f08b32eca4b35)
2012-04-27 15:40:43 +10:00
Martin Schwenke
c2d1f8752c tests: Rationalise integration test infrastructure
* run_tests no longer includes common.sh, which is only to be included
  by test cases.  Therefore, it defines its own die() function.

* TEST_SUBDIR is now set in common.sh

* Move complex-only functions to complex/scripts/local.bash

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

(This used to be ctdb commit bfa1d6638d3e116640eb4e3bb71b21ba6ef8cae5)
2012-04-27 15:40:43 +10:00
Martin Schwenke
bf197d097f tests: Rename ctdb_test_functions.bash to integration.bash
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79adb50b3ce3873c3baf9e6715c1d1c3f181ce43)
2012-04-27 15:40:43 +10:00
Ronnie Sahlberg
4426f9a531 Merge remote branch 'amitay/tdb-sync'
(This used to be ctdb commit 8052ee0a6bda3fa88501d77b2d53315be2b75ec1)
2012-04-26 08:09:34 +10:00
Ronnie Sahlberg
db411aaada Merge remote branch 'amitay/tevent-sync'
(This used to be ctdb commit 17ff3f240b0d72c72ed28d70fb9aeb3b20c80670)
2012-04-26 08:09:23 +10:00
Ronnie Sahlberg
58e10b280d Merge remote branch 'amitay/talloc-sync'
(This used to be ctdb commit fdd5b9ac0a79f6bc7c8a05da2e2f11e002392bcd)
2012-04-26 08:09:05 +10:00
Ronnie Sahlberg
618d247420 Merge remote branch 'martins/master'
(This used to be ctdb commit abe7ebe6c531f912efe4ebc1daade4d2af67574c)
2012-04-18 13:48: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
feff13ff63 tests - run_tests needs to expand directories like "." and "..".
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fd08fc6c88cb80190ce87325867de0391cf1af51)
2012-04-16 16:27:20 +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
a35eca8bda tests - run_tests ignores trailing '/' on directories
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit dbec696930327ff07b39282e3084eef4ded064c0)
2012-04-16 15:58:44 +10:00
Martin Schwenke
76d75f8c81 tests/takeover - Restructure according to new convention
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f94897ef9504c144937409688fa7a646e0b0ceae)
2012-04-16 15:57:16 +10:00
Martin Schwenke
8c5fdb40cf tests/onnode - Restructure according to new convention
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4c87888b2a559c0d1f285919a42de450a537a02f)
2012-04-16 15:57:16 +10:00
Martin Schwenke
006b18dec4 tests/tool - Restructure according to new convention
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 89571585d87b391ff79647cd1f0f6ac193079e72)
2012-04-16 15:06:48 +10:00
Amitay Isaacs
612f0d91d2 tests/tool: New nodestatus test
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ca9e75eaea9c9b02bb44ca338e28fdae0c8d582c)
2012-04-16 15:04:43 +10:00
Amitay Isaacs
1d7f023f1a tests/tool: Fix the nodestatus test
Although not obvious, when asking each node for nodestatus, it will report
each node is the current node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a65ba7211ec7f102b32060b173606a61fb5c20a9)
2012-04-16 15:02:49 +10:00
Martin Schwenke
8e71c5ec90 tests - run_tests includes common.sh, uses die()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 21df43c74bfcff420fdaf9df5440c25529c543d2)
2012-04-16 14:57:45 +10:00
Martin Schwenke
9267727edb tests - run_tests can take a directory as an argument
This makes it run all tests in the specified directory.

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

(This used to be ctdb commit 89719384a74161ffa0c03602ecdd9e758d521d75)
2012-04-16 14:57:45 +10:00
Martin Schwenke
6eb8bf776e tests - add -v option to set TEST_VERBOSE=true
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 43badc5418b9f533398cd579607d9f1fc0f8f417)
2012-04-16 14:57:45 +10:00
Martin Schwenke
fec6fe6287 tests - move functions only used by scripts/run_tests into that script
Along with minor logic tweaks and removal of test_exit().

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

(This used to be ctdb commit 00713eb46cce638339845799bba2da041b3d02fb)
2012-04-16 14:57:45 +10:00
Martin Schwenke
f6178fcc9d tests - add scripts/unit.sh
This will be sourced by all unit tests.

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

(This used to be ctdb commit afdaa5f032938d56ff315d9553cb285ebc413c4c)
2012-04-16 14:57:45 +10:00