1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

24 Commits

Author SHA1 Message Date
Martin Schwenke
ac1b1d8c8a ctdb-tests: run_tests.sh sets evironment variable CTDB_TEST_DIR
Instead of just local variable test_dir.  The environment variable can
be accessed from other test infrastructure scripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-14 05:15:25 +02:00
Martin Schwenke
e78b887531 ctdb-tests: Catch cases where mktemp fails due to missing TMPDIR
TMPDIR sometimes goes missing during autobuild.  When that happens the
error messages produced by CTDB tests are not very helpful.  This
should make it clear.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Mar 20 08:53:02 CET 2017 on sn-devel-144
2017-03-20 08:53:01 +01:00
Martin Schwenke
89b4920539 ctdb-tests: Add tests for takeover helper
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:08 +01:00
Amitay Isaacs
ca0894e932 ctdb-tests: Add tests for event daemon
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-18 14:23:23 +01:00
Martin Schwenke
5e4381d323 ctdb-tests: Use bash locals for readability
This is a bash script so use bash feature instead of using the leading
underscore convention for locals.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-10-13 14:25:09 +02:00
Martin Schwenke
e0aae9f0d3 ctdb-tests: Add shellcheck test suite
CTDB has a lot of scripts and shellcheck can be useful to find dubious
scripting practices.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jul 21 06:06:49 CEST 2016 on sn-devel-144
2016-07-21 06:06:49 +02:00
Amitay Isaacs
e5592f9fc0 ctdb-common: Add db_hash abstraction
A hash table implemented using in-memory tdb backend.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-07 14:53:28 +02:00
Amitay Isaacs
e118a36c4c ctdb-tests: Shutdown local daemons if the tests exit abnormally
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-08 10:17:54 +02:00
Martin Schwenke
3c81066105 ctdb/tests/scripts: Promote scripts/run_tests
The wrapper is not needed anymore.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:46 +01:00
Martin Schwenke
318f2cf912 ctdb/tests/scripts: Simplify the top-level test scripts
At the moment run_tests.sh has quite fragile argument processing.  It
needs that annoying "--" between options and tests.  The random
default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in
various places.

Instead:

* Change the default behaviour to print a summary, add new option -N
  to turn off summary, and remove old -s option.

* Change the default behaviour to run integration tests with local
  daemons, add new options -c to run on a cluster, remove old -l
  option.

* Make $testdir/var the default if the tests are not installed, and
  $(mktemp -d ) the default if tests are installed.

* Move the default tests for local/cluster into scripts/run_tests.

run_tests.sh (and the run_cluster_tests.sh symlink) should behave as
before but with slightly more reasonable defaults.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 00:46:04 +01:00
Martin Schwenke
5e0eb7bf84 tests: When running local tests with run_tests.sh, use fixed TEST_VAR_DIR
Otherwise we end up with lots of useless temporary directories.

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

(This used to be ctdb commit 63924ff372b066cd878b79e71f06de4c24c814a2)
2013-10-22 13:07:13 +11:00
Michael Adam
334557680c run_tests.sh: fix a comment
(This used to be ctdb commit 0e515115b3c21cb179fd7a6356164ac1b5d423e0)
2012-07-03 14:30:24 +02: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
af2ab74beb tests: Allow run_tests.sh to take options
However, options must be followed by "--".

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

(This used to be ctdb commit db8cf8f5e644a0b21a6040287887fee40f38d4db)
2012-05-11 10:33:27 +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
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
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
38593aa3e1 For now, make tests/run_tests.sh runs the new test suite. Add
tests/TODO.  Remove tests/start_daemons.sh - no longer used.

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

(This used to be ctdb commit 5cdbef46b74e6a5ba2383ef025e69fe605fa4f6e)
2009-01-12 15:47:12 +11:00
Andrew Tridgell
bf32a8e6c3 cleanup on SIGINT
(This used to be ctdb commit 008533d971aec9c28c6e4750ef4677dd943633ff)
2008-07-30 13:21:02 +10:00
Andrew Tridgell
68963d865a first step towards fixing "make test" with the new daemon system
(This used to be ctdb commit f95f7e4c93dea482e6cf0614b5415229a7c9f3fb)
2007-06-02 13:16:11 +10:00
Andrew Tridgell
bbf358cfcf added attach command in ctdb_control
(This used to be ctdb commit 172ee33306be2ef5ce17a5b9d7fbcc1f265a1b0b)
2007-04-30 15:54:06 +02:00
Andrew Tridgell
f455d3f44b saner logfile code
testing of ctdbd

(This used to be ctdb commit 05789da5818f8b20f04779b0df5125914d9047f6)
2007-04-29 22:42:23 +02:00
Andrew Tridgell
6e09bfdaf9 much simpler redirect logic
(This used to be ctdb commit 95db9afa7dd039e1700e2f3078782f6ac66e9f51)
2007-04-28 18:18:33 +02:00
Andrew Tridgell
76381c4493 added make test and make valgrindtest targets
(This used to be ctdb commit b69fb43643993ee5aaabf8711bb874f95d468f35)
2007-04-28 10:57:58 +02:00