summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/scripts
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-tests: Add a new NFS tickle testMartin Schwenke2014-03-281-4/+4
| | | | | | | | | This one ensures that a newly started node gets an up-to-date tickle list. Tweak some of the integration test functions to accommodate this. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* 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/integration: Decentralise the daemon restart codeMartin Schwenke2013-12-051-7/+8
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Update daemons shutdown pseudo-testMartin Schwenke2013-12-051-0/+6
| | | | | | | | Don't scatter the TEST_LOCAL_DAEMONS logic around the code. Limit it to the local daemons file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Local daemons version of setup_ctdb() overridesMartin Schwenke2013-12-051-3/+2
| | | | | | | | setup_ctdb() doesn't need to do anything on a cluster. To avoid a conditional, just override it for local daemons. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Remove some unused functionsMartin Schwenke2013-12-051-43/+0
| | | | | | | This was the start of some refactorisation that was never completed. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Remove the time logging codeMartin Schwenke2013-12-051-53/+0
| | | | | | | | This hasn't been required for a long time and is probably broken. If it is needed in future then we know where to find it. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/simple: Move the local daemons code to its own fileMartin Schwenke2013-12-051-124/+0
| | | | | | | This is just a straight move. The clever stuff will follow. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb/tests/integration: Update NFS tickles test and supporting codeMartin Schwenke2013-12-051-150/+15
| | | | | | | | | | | | | | | This currently requires an eventscript to be dynamically installed. This eventscript is only used to help determine when a monitor event has occurred. This code is horrible and fragile. A better way is to just monitor the output of "ctdb scriptstatus". When changes it changes then a monitor event has occurred. Also remove the old code that checks for tickle information in shared storage. CTDB hasn't done things this way for a long time. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:test: remove unused ip2ipmask from integration.bashMichael Adam2013-11-281-7/+0
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb:tests: ignore SIGPIPE in unit testsMichael Adam2013-11-281-0/+2
| | | | | | | | | | | This makes scripts called in the unit tests behave like when called from ctdbd which ignodes SIGPIPE. This also makes the scrips behave the same when called from "make autotest" directly and via autobuild (python). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* 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>
* ctdb:tests: Rework unit test result filteringMartin Schwenke2013-11-271-5/+17
| | | | | | | Using a variable is too fragile, so use a function instead. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb:tests/integration: Be more careful when killing ctdbdMartin Schwenke2013-11-271-1/+1
| | | | | | | | Also match $TEST_VAR_DIR in the socket name. This means that we'll only ever kill ctdbd process belong to our own test run. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/integration: Neaten up some of the persistent database testsMartin Schwenke2013-11-271-0/+36
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-tests/integration: try_command_on_node() shouldn't lose onnode optionsMartin Schwenke2013-11-271-1/+1
| | | | | | | | Currently it only passes the last (non -v) option seen. It should pass them all. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* build: Move the default CTDB socket from /tmp to /var/run/ctdbAmitay Isaacs2013-10-251-4/+0
| | | | | | | | | | | | | | | | | Use /var/run/ctdb/ctdbd.socket because there might be other daemons that need sockets in the future. The local daemons test code to create a link for the default convenience socket has to be removed because the link can't be created as a regular user in the new location. This should be OK since all calls to the ctdb tool in the test code should be wrapped in onnode. When debugging tests, a developer will have to set CTDB_SOCKET by hand. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-with: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dc67a4e24af9d07aead2a1710eeaf5d6cc409201)
* common: New function mkdir_p()Martin Schwenke2013-10-251-4/+0
| | | | | | | | | Behaves like mkdir -p. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit afe2145d91725daf1399f0a24f1cddcf65f0ec31)
* tests/integration: Pass --valgrinding option when running under valgrindMartin Schwenke2013-10-221-0/+4
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 913f229508302378212678d98c22606a4954b09c)
* scripts: Remove support for CTDB_OPTIONS configuration variableMartin Schwenke2013-10-221-6/+0
| | | | | | | | | | | Allowing people to put random options in CTDB_OPTIONS complicates some logic (particularly around use of syslog). If we're going to have variables for options then let's make sure we have a variable for each option and make people use them. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e55f3a1577eff0182802b0341d865d961aeae1c7)
* tests/integration: Tweak ctdbd startup optionsMartin Schwenke2013-10-221-5/+1
| | | | | | | | | | * --public-interface is not needed * Add --sloppy-start to speed up restarts Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d0dec5b8e60316701fdd02150c4dd8f01aacbfda)
* 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/complex: Fix NFS tests to work with root_squashMartin Schwenke2013-07-231-0/+36
| | | | | | | | | Refactor the NFS test setup/cleanup code into new common functions. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 29e98017221326bdc9b1c4f7c05b3b495c1de29b)
* 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: Integration tests use "ctdb nodestatus" for healthy cluster checkMartin Schwenke2013-06-221-15/+2
| | | | | | | | Also check that we're not in recovery mode. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b7aaa28b3a6a2de923417f3d143f8d516447711e)
* tests: Integration test infrastructure should do only a single recoveryMartin Schwenke2013-06-221-4/+0
| | | | | | | | No need for 2 recoveries after a restart. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b953524185632d7f96a76d8f3bbed7ac1d143d40)
* tests/integration: Improve debug output for unhealthy cluster after restartMartin Schwenke2013-05-281-4/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 25a6fd784cde96f3d20a79f70b5589b5c4aca675)
* 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 integration tests to use real private IPsMartin Schwenke2013-05-271-2/+2
| | | | | | | | 192.0.2.x was a typo. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a)
* tests: Fix output of run_tests usageAmitay Isaacs2013-05-241-2/+2
| | | | (This used to be ctdb commit 29911fa44a480c17c701528ef46919b2a962a366)
* locking: Use separate locking helper binary for lockingAmitay Isaacs2013-05-241-0/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cde53a6cbe74b1e46f7e1bca298df82c08de866)
* tests: Unit test diff output should use filtered outputMartin Schwenke2013-05-071-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9721aae001b3023e9c8b4af2b143c0db3442d623)
* tests: Support waiting for "recovered" state in testsAmitay Isaacs2013-04-171-1/+4
| | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> (This used to be ctdb commit 2438f3a4944f7adbcae4cc1b9d5452714244afe7)
* tests/simple: Add test to check recovery daemon IP verificationMartin Schwenke2013-01-081-6/+18
| | | | | | | | Also update ips_are_on_nodeglob() to handle negation. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 13a5944f8a27d43006acfffba76958693cae7702)
* tests: new function ip2ipmask() for integration testingMartin Schwenke2013-01-071-0/+7
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 8164d9b29bf9080ccc76b1305fb6c07f1ed61d55)
* tests: Local daemons should use --listen instead of --node-ipMartin Schwenke2013-01-071-1/+1
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3221fce9ee2f6fdd3bb17a5e1629ad52a32f90d6)
* tests: Local daemons should use the logging ringbufferMartin Schwenke2012-10-221-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7547e011005f0dd5bd38e67572280126cf16e229)
* eventscripts: Auto-start/stop services in backgroundMartin Schwenke2012-10-031-1/+1
| | | | | | | | | | | 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)
* tests: select_test_node_and_ips() should try to avoid failingMartin Schwenke2012-07-261-1/+19
| | | | | | | | | | | | 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)
* tests: simple tests against local daemons should check $TEST_LOCAL_DEAMONSMartin Schwenke2012-07-261-1/+1
| | | | | | | | 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)
* 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)
* tests: select_test_node_and_ips() should never select non-node -1Martin Schwenke2012-07-261-5/+4
| | | | | | | | 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)
* run_tests: improve spacingMichael Adam2012-07-031-1/+2
| | | | (This used to be ctdb commit a0a0f5588445aeabe07b0e4d65087db454dc09da)
* tests: Use per node log files when running tests with local daemonsAmitay Isaacs2012-05-251-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 61df417821762d87ed01a7b5e64c35079940344d)
* tests: Fix a typo in daemons_setup()Martin Schwenke2012-05-141-2/+2
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 863ad337fa3c4effe1fd370d3ba414027c600bd6)
* tests: New function get_ctdbd_command_line_option() for integration testingMartin Schwenke2012-05-141-0/+21
| | | | | | | | | 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)