1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

124 Commits

Author SHA1 Message Date
Martin Schwenke
529db4d52c tests/integration: Improve debug output for unhealthy cluster after restart
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 25a6fd784cde96f3d20a79f70b5589b5c4aca675)
2013-05-28 14:24:16 +10:00
Martin Schwenke
7dca442057 tests/scripts: Delete unused $rows and $ww variables from run_tests
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 80b3cf2c652c6098390cdd0dbb3edc648f7df487)
2013-05-28 14:24:16 +10:00
Martin Schwenke
66019e3287 scripts: Provide mktemp function for platforms without mktemp command
This is needed for AIX and possibly others.

Also provide a cheaper mktemp function is needed in the run_tests
script.

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

(This used to be ctdb commit b2b572e9049c7138bd223226475bef8fe3e01f10)
2013-05-27 15:14:33 +10:00
Martin Schwenke
17d7288440 tests: Fix integration tests to use real private IPs
192.0.2.x was a typo.

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

(This used to be ctdb commit c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a)
2013-05-27 12:23:43 +10:00
Amitay Isaacs
e6673f2c46 tests: Fix output of run_tests usage
(This used to be ctdb commit 29911fa44a480c17c701528ef46919b2a962a366)
2013-05-24 09:06:40 +10:00
Amitay Isaacs
ae25420e56 locking: Use separate locking helper binary for locking
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7cde53a6cbe74b1e46f7e1bca298df82c08de866)
2013-05-24 09:06:40 +10:00
Martin Schwenke
b416376e68 tests: Unit test diff output should use filtered output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9721aae001b3023e9c8b4af2b143c0db3442d623)
2013-05-07 16:20:46 +10:00
Amitay Isaacs
8cbf3211b7 tests: Support waiting for "recovered" state in tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 2438f3a4944f7adbcae4cc1b9d5452714244afe7)
2013-04-17 21:16:45 +10:00
Martin Schwenke
ef7329a415 tests/simple: Add test to check recovery daemon IP verification
Also update ips_are_on_nodeglob() to handle negation.

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

(This used to be ctdb commit 13a5944f8a27d43006acfffba76958693cae7702)
2013-01-08 13:27:10 +11:00
Martin Schwenke
f6be6f387a tests: new function ip2ipmask() for integration testing
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8164d9b29bf9080ccc76b1305fb6c07f1ed61d55)
2013-01-07 12:19:33 +11:00
Martin Schwenke
5cf98c80ff tests: Local daemons should use --listen instead of --node-ip
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 3221fce9ee2f6fdd3bb17a5e1629ad52a32f90d6)
2013-01-07 10:35:39 +11:00
Martin Schwenke
3189eef7d9 tests: Local daemons should use the logging ringbuffer
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7547e011005f0dd5bd38e67572280126cf16e229)
2012-10-22 12:47:04 +11:00
Martin Schwenke
2d719e5c84 eventscripts: Auto-start/stop services in background
If $CTDB_SERVICE_AUTOSTARTSTOP="yes" then service start/stop is done
in the background with logging.

Fix some unit tests for samba and winbind.

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

(This used to be ctdb commit 3a3dae4cb5ec8b4b8381a4013adda25b87641f3a)
2012-10-03 08:48:23 +10:00
Martin Schwenke
523be079ea tests: select_test_node_and_ips() should try to avoid failing
Sometimes "ctdb sync" doesn't do its job, so we end up with unassigned
IPs.

If $test_node isn't set then this is bad.  However, try a few times to
ensure it is set.

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

(This used to be ctdb commit 2fd0157382b42aa5c5212b8e743c6f589edc6662)
2012-07-26 22:03:00 +10:00
Martin Schwenke
959e37da7b tests: simple tests against local daemons should check $TEST_LOCAL_DEAMONS
Note the old $CTDB_TEST_REAL_CLUSTER - it doesn't exist anymore...

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

(This used to be ctdb commit 47180dc75d15f3d61470705603565b718491c9f8)
2012-07-26 22:03:00 +10:00
Martin Schwenke
053174c07b tests: run_tests should exit with $status with -e option
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 619af3e857c2ced3840abfd86135cc954796da97)
2012-07-26 22:03:00 +10:00
Martin Schwenke
c075c2e5c9 tests: select_test_node_and_ips() should never select non-node -1
Instead of selecting the 1st pnn found, select the 1st one that isn't -1.

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

(This used to be ctdb commit f02e501342112aab67aee95f253e29a670b29273)
2012-07-26 22:03:00 +10:00
Michael Adam
27ce9dc366 run_tests: improve spacing
(This used to be ctdb commit a0a0f5588445aeabe07b0e4d65087db454dc09da)
2012-07-03 14:30:25 +02:00
Amitay Isaacs
cfe030e297 tests: Use per node log files when running tests with local daemons
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 61df417821762d87ed01a7b5e64c35079940344d)
2012-05-25 15:25:15 +10:00
Martin Schwenke
4563865fb6 tests: Fix a typo in daemons_setup()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 863ad337fa3c4effe1fd370d3ba414027c600bd6)
2012-05-14 15:13:41 +10:00
Martin Schwenke
8880484658 tests: New function get_ctdbd_command_line_option() for integration testing
This allows, for example, the public addresses file used by a
particular daemon to be known.

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

(This used to be ctdb commit f4b7d14f2e3c7345e7a09abb27c32923fb78cbc4)
2012-05-14 15:13:41 +10:00
Martin Schwenke
e3d357b9c3 tests: Use per-daemon public_addresses file for local daemons
This allows a node's public addresses file to be hacked for testing.

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

(This used to be ctdb commit c7d6e4557d00de674737e2c8d6cbebaa2461c303)
2012-05-14 15:02:19 +10:00
Martin Schwenke
594601bdad tests: Fix wrapper scripts to handle options and tests without breakage
If the -V option is given and no tests are supplied, the "cd" command
in run_tests.sh cause scripts/run_tests to interpret the argument to
-V incorrectly.  Therefore, the wrapper scripts can't use "cd" because
they don't know what the options are doing!

Instead scripts/run_tests searches for each test relative to the
current directory and, if not previously found, then searches relative
to the top-level tests directory.  This is a much better way of doing
things.

Given that run_tests.sh and run_cluster_tests.sh were starting to
contain duplicate complex logic, remove run_cluster_tests.sh and
replace it with a symlink to run_tests.sh.  Run_tests.sh checks $0 to
see what options/defaults to use.  Update INSTALL to deal with this.

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

(This used to be ctdb commit ed2db1f4e8d2b222d7f912a4a007ce48a23e83b0)
2012-05-14 15:02:19 +10:00
Martin Schwenke
f510ae64cb tests: In integration tests, use --node-ip to avoid locking weirdness
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a00e80c701a0f9695f41c24e0360c25c0873d49d)
2012-05-11 10:33:27 +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
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
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
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
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
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
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
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
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
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
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