summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/scripts/run_tests
Commit message (Collapse)AuthorAgeFilesLines
* ctdb/tests/scripts: Promote scripts/run_testsMartin Schwenke2013-12-051-311/+0
| | | | | | | The wrapper is not needed anymore. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/scripts: Simplify the top-level test scriptsMartin Schwenke2013-12-051-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ctdb/tests/scripts: Sort command-line optionsMartin Schwenke2013-12-051-16/+16
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: run_tests should ignore bogus test directoriesMartin Schwenke2013-11-271-0/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests: Add -S option to support socket wrapperMartin Schwenke2013-11-271-1/+9
| | | | | | | | Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Always tally the number of passed/failed testsMartin Schwenke2013-07-291-2/+5
| | | | | | | | Regardless of whether a summary is being printed! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a69e03a5e4671e998d45b4fef8611a421bbdb3e1)
* tests: Fix exit status of run_tests when a single test is run with -HMartin Schwenke2013-07-221-6/+6
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9d6e1c147bd036d832b98c155f405ee2a5d6f57f)
* tests/scripts: Delete unused $rows and $ww variables from run_testsMartin Schwenke2013-05-281-3/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 80b3cf2c652c6098390cdd0dbb3edc648f7df487)
* scripts: Provide mktemp function for platforms without mktemp commandMartin Schwenke2013-05-271-0/+21
| | | | | | | | | | | 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)
* tests: Fix output of run_tests usageAmitay Isaacs2013-05-241-2/+2
| | | | (This used to be ctdb commit 29911fa44a480c17c701528ef46919b2a962a366)
* tests: run_tests should exit with $status with -e optionMartin Schwenke2012-07-261-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 619af3e857c2ced3840abfd86135cc954796da97)
* run_tests: improve spacingMichael Adam2012-07-031-1/+2
| | | | (This used to be ctdb commit a0a0f5588445aeabe07b0e4d65087db454dc09da)
* tests: Fix wrapper scripts to handle options and tests without breakageMartin Schwenke2012-05-141-18/+42
| | | | | | | | | | | | | | | | | | | | | 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)
* tests: New run_tests -C (cleanup) optionMartin Schwenke2012-04-271-1/+12
| | | | | | | | | 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)
* tests: Add a -V option to set new variable TEST_VAR_DIRMartin Schwenke2012-04-271-12/+21
| | | | | | | | | | | | | | | | | | | 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)
* tests: Make run_tests -X more flexible - it now works with onnodeMartin Schwenke2012-04-271-2/+2
| | | | | | | | | 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)
* tests: run_tests should exit with failed test status if running with -HMartin Schwenke2012-04-271-1/+5
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6eb7fa572e7fc212332ddd68793e3f35161baf7c)
* tests: Add new -H option for run_tests to avoid printing header/footerMartin Schwenke2012-04-271-3/+6
| | | | | | | | | 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)
* tests: Add -e option to cause run_tests to exit on first test failureMartin Schwenke2012-04-271-1/+10
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f45295a3005474957852d0e7a5c3807e30ab519d)
* tests: Remove ctdb_test_envMartin Schwenke2012-04-271-5/+2
| | | | | | | | 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)
* tests: Move relative directory path hack from run_tests to common.shMartin Schwenke2012-04-271-4/+0
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 66a7fece867966528689d2784a284e32d687a0f5)
* tests: Local daemons are no longer the default, now require run_tests -lMartin Schwenke2012-04-271-1/+4
| | | | | | | | | | | | | | | | | | 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)
* tests: Rationalise integration test infrastructureMartin Schwenke2012-04-271-4/+6
| | | | | | | | | | | | | * 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)
* tests: More unit test factoring/rationalisation and bug fixesMartin Schwenke2012-04-181-1/+16
| | | | | | | | | | | | | | | | | 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)
* tests - run_tests needs to expand directories like "." and "..".Martin Schwenke2012-04-161-0/+4
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit fd08fc6c88cb80190ce87325867de0391cf1af51)
* tests - run_tests ignores trailing '/' on directoriesMartin Schwenke2012-04-161-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dbec696930327ff07b39282e3084eef4ded064c0)
* tests - run_tests includes common.sh, uses die()Martin Schwenke2012-04-161-3/+3
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 21df43c74bfcff420fdaf9df5440c25529c543d2)
* tests - run_tests can take a directory as an argumentMartin Schwenke2012-04-161-5/+23
| | | | | | | | 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)
* tests - add -v option to set TEST_VERBOSE=trueMartin Schwenke2012-04-161-1/+4
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 43badc5418b9f533398cd579607d9f1fc0f8f417)
* tests - move functions only used by scripts/run_tests into that scriptMartin Schwenke2012-04-161-1/+62
| | | | | | | | 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)
* Tests: run_tests script no longer prints filename in summary descriptions.Martin Schwenke2011-08-031-2/+1
| | | | | | | | | | | If filenames should be printed in descriptions in the summary then the descriptions should include the filename. A better option is to include something more human-readable that makes the test just as easily identifiable. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0efdbd61bdc2343e5459959b300bccc9986b1d78)
* Tests: change output format of run_tests script and add -q optionMartin Schwenke2011-08-031-14/+28
| | | | | | | | | | | | | Putting PASSED/FAILED on the left makes it easier to scan the results and simplifies the code. Also put starts around the word "*FAILED*" to make it more obvious. Also add a -q option to throw away test output and only display the summary (if -s is also specified). Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c44b632b010b7d57007f3c8f294271c7e0217e0d)
* Test suite: add a -d option to the run_tests script.Martin Schwenke2011-08-031-2/+17
| | | | | | | | | | This causes summary lines (when used with -s) to be pretty printed and include the test description. This is the 4th line of the test output - that is, immediately after the header. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0e5cc2a58b0d38e10a2ef9e81dc887c20f3fbdcb)
* Fix the run_tests script so that the number of columns is never 0.Martin Schwenke2009-07-031-1/+1
| | | | | | | | | Sometimes "stty size" reports 0, for example when running in a shell under Emacs. In this case, we just change it to 80. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e309cb3f95efcf6cff7d7c19713d7b161a138383)
* Add tests/README. ctdb_test_env and, therefore, run_tests can now beMartin Schwenke2009-01-091-1/+1
| | | | | | | | | | | | | run from the tests subdirectory... and most other sensible places. Rename $CTDB_TEST_REMOTE_SCRIPTS_DIR to $CTDB_TEST_REMOTE_DIR since it is now intented that this directory can contain test binaries too. daemons_start() now passes a full path to the events.d directory when starting ctdbd. Also fixed the path to ctdbd. 41_ctdb_ban.sh and 42_ctdb_unban.sh fail immediately if they fail to select a test node. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3ecce31d3a3f72b9fa851ac99291865c119e551e)
* Delete some unstructured tests ({fetch,peristent,transaction}.sh) andMartin Schwenke2009-01-081-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | replace them with new simple tests (52_ctdb_fetch.sh, 53_ctdb_transaction.sh, 61_ctdb_persistent_safe.sh, 62_ctdb_persistent_unsafe.sh). Remove "_simple" from some test filenames in the simple subdirectory - that's redundant. Always run ctdb as $CTDB to allow $VALGRIND magic to be used. Use pgrep/pkill to detect/kill local daemons so those running under valgrind can be found too - to support this, always run local daemons with the full path to the executable. run_tests now supports -s option to print sumamry when done - with more and more tests, it is getting hard to follow progress. Sort the output of commands in 06_ctdb_getpid.sh to make sure they compare nicely and also allow the processes' executables to be called "memcheck" to catch those running under valgrind. Remove redundant calls to onnode in commands run from calls try_command_on_node in some tests. 41_ctdb_ban.sh and 42_ctdb_unban.sh avoid banning the recmaster, since this causes the recmaster to be reassigned and all nodes to be unbanned. Minor cleanups. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 33cdf3e4bcfadf8e20822ca352babf7acca16821)
* New test 09_ctdb_ping.sh. Add documentation and command-lineMartin Schwenke2008-11-241-25/+6
| | | | | | | | | | | | processing to all tests. New script ctdb_test_env sets up environment for tests, is now sourced by run_tests, and can also take a test on the command-line, complete with options. Various cleanups and improvements. Document tests that have been properly implemented in ctdbd.sh. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 826e85fe5291067b8d0b9c22918d63024aa6141c)
* Move tests/*.c to tests/src/*.c and adjust Makefile.in accordingly.Martin Schwenke2008-11-211-2/+16
| | | | | | | | | | | | | | | | | | Move setting of $CTDB_NODES_SOCKETS to tests/scripts/run_tests and make it only happen if $CTDB_TEST_REAL_CLUSTER is not set. Bugfix in function ips_are_on_nodeglob. New/proper implementations of functions stop_daemons and start_daemons, now called by function restart_ctdb. In start_daemons.sh, add public addresses file generation/usage, use new option --nopublicipcheck to ctdbd to avoid crazy behaviour and kill ctdbd more carefully to avoid killing real daemons on a real cluster - this should be able to coexist on a node of a real cluster. start_daemons.sh is temporarily incompatible with start_daemons function, but expecting to replace that script with function calls very soon anyway... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4c54772c5c2fa7d2a25963379b5b96caf0c2521c)
* Add some simple tests that can be run from within the tree.Martin Schwenke2008-11-201-0/+46
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eacb2ef82ea4809d874158756db973dd1e3fc8fc)