summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts
Commit message (Collapse)AuthorAgeFilesLines
...
* eventscripts: kill_tcp_connections() should send connections to stdinMartin Schwenke2013-07-295-0/+84
| | | | | | | | | | | | | | | This avoids issuing multiple "ctdb killtcp" commands to terminate tcp connections, one per connection. This will considerably reduce the time when there is a large number of tcp connections. This also makes it possible to avoid calling "ctdb killtcp" when there are no connections. Add a couple of unit tests for killtcp and update eventscript unit test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)
* tests/eventscripts: Add tests for monitoring of missing interfacesMartin Schwenke2013-07-194-54/+108
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 53e4eca74429f76adc81d98e3d11d1bd61194d71)
* tests/eventscripts: Add some rudimentary tests for 60.ganeshaMartin Schwenke2013-07-054-0/+81
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e1cf1f728236d808bb41265e74bc65f54bf1c133)
* tests/eventscripts: New tests for 00.ctdb "init" eventMartin Schwenke2013-06-2016-6/+258
| | | | | | | | | | | | | | | These test dropping of IPs and TDB checking. New stubs for date, tdbdump, tdbtool. Enhance ip stub to handle "ip addr show to ..." Tweak some infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
* tests/eventscripts: setup_ctdb() should always set $CTDB_PUBLIC_ADDRESSESMartin Schwenke2013-06-201-1/+2
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c3e7a6e10d486ba0dbafdf110db540675b2317bc)
* tests/eventscripts: Unit tests for $CTDB_NFS_DUMP_STUCK_THREADSMartin Schwenke2013-06-145-1/+63
| | | | | | | | Includes minor test infrastructure updates. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit cd4358b01c6c3d413b431f5760029d2b163b9c03)
* tests/eventscripts: Fix -X tracing in iterate_test()Martin Schwenke2013-06-141-6/+5
| | | | | | | | ... and delete a bogus comment. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0e2b5a8f89440a53f996482ac0c98b31a4f2cad3)
* tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNTMartin Schwenke2013-06-145-0/+53
| | | | | | | | Includes minor test infrastructure updates. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ce2ef2be8aa22c0baf868daac8d4cf27246baa14)
* eventscripts: 60.nfs uses nfs_check_rpc_services() to check NFS RPC servicesMartin Schwenke2013-05-075-89/+16
| | | | | | | | | | | | | | | | | | | * New directory nfs-rpc-checks.d/ replaces hardcoded rules in 60.nfs * Installation and packaging additions to handle nfs-rpc-checks.d/ * Unit test updates, including deleting 1 test that sanity checked test infrastructure * Test infrastructure changes to use nfs-rpc-checks.d/ Note that this removes support for $CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK in 60.nfs. To get the equivalent behaviour, edit 20.nfsd.check and remove/comment all lines. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7e792d6768d9ca420ce3713cb122e63afd594b15)
* eventscripts: Clean up ctdb_check_command()Martin Schwenke2013-05-061-1/+1
| | | | | | | | | | * Command is now multiple arguments, preserving quoting * $service_name no longer printed, no longer an argument * Debug output from failed command Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9e25fb261447a196de05937052779b36e75e7215)
* eventscripts: Simplify handling of $service name in "managed" functionsMartin Schwenke2013-05-065-15/+25
| | | | | | | | | | | | | | | | | | | | Complicated argument handling was introduced to deal with multiple services per eventscript. This was a failure and we split 50.samba. This simplifies several functions to use global $service_name unconditionally instead of having an optional argument. $service_name is no automatically longer set in the functions file. This means it needs to be explicitly set in 13.per_ip_routing because this script uses ctdb_service_check_reconfigure(). Eventscript unit test infrastructure needs to set $service_name during fake service setup, and policy routing tests need to be updated accordingly. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 27aab8783898a50da8c4bc887b512d8f0c0d842c)
* scripts: Use $CTDB_SCRIPT_DEBUGLEVEL instead of something more complexMartin Schwenke2013-04-194-24/+3
| | | | | | | | | | | | | | | | | | | The current logic is horrible and creates an unnecessary file. Let's make the script debug level independent of ctddb's debug level. * Have debug() use $CTDB_SCRIPT_DEBUGLEVEL directly * Remove ctdb_set_current_debuglevel() * Remove the "getdebug" command from ctdb stub in eventscript unit tests * Update relevant eventscript unit tests to use $CTDB_SCRIPT_DEBUGLEVEL Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 85efa446c7f5c5af1c3a960001aa777775ae562f)
* tests/eventscripts: Ratchet down debug level for ctdb_takeover_testsMartin Schwenke2013-01-081-1/+2
| | | | | | | | | | | | | | The default IP allocation algorithm used by ctdb_takeover_tests changed from "non-deterministic IPs" to "LCP2". The latter generates a lot more debug output. ctdb_takeover_tests is used by the ctdb tool stub to calculate IP address changes for failovers. This resulted in unexpected debug output that caused tests to fail. Since eventscript tests don't care how IP allocations are arrived at, the best solution is to turn down the debug level. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3cc596d2b459d834f9785b3a98027e46431ff2b9)
* Eventscripts: Do not restart NFS on reconfigureMartin Schwenke2013-01-076-12/+0
| | | | | | | | | | | | | | | | | | | | It looks like this restart was accidentally reintroduced in commit fc0678d351187cfa4c71123f97c0f493aacd5d16 when $service_reconfigure became unset so the default action of restarting the service would occur. From there cleanups have explicitly reintroduced it and carried it through the code. Also update the unit tests affected by this change. The restart was originally removed in commit bc481c3f1a44c50648488c4f8a7f15ec395d446f. The default reconfigure action of restarting a service is clearly suboptimal and will be addressed in a separate patch. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2629de72e1f37b5e46772c2ef8d8d0012fc4ed37)
* Revert "Eventscripts - add facility to 10.interface to delete unmanaged IPs"Martin Schwenke2012-10-181-22/+0
| | | | | | | | | | This reverts commit 88f88d86b0d08240f749fb721b8c401c2eeb1099. This is dangerous and, on reflection, I can't see it being useful. There are often permanent IPs on interfaces that CTDB shares with its public IPs. (This used to be ctdb commit 16aba4eb620844626a1c71c58b51658caf44dea6)
* tests/eventscripts: add unit tests for policy routing reconfigureMartin Schwenke2012-10-114-0/+77
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bd4ff176387372b1c233373c0bc8ced523fc9670)
* tests/eventscripts: add extra infrastructure for policy routing testsMartin Schwenke2012-10-1116-317/+170
| | | | | | | | Less copying and pasting is a good thing... Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7d4b8cce96f33fff647a0c9d259c121dfc8403e9)
* eventscripts: Auto-start/stop services in backgroundMartin Schwenke2012-10-035-22/+38
| | | | | | | | | | | 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)
* Eventscripts: split 50.samba into 49.winbind and 50.sambaMartin Schwenke2012-10-038-15/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | winbind and samba can be separately managed. This makes the service starting and stopping code way too complicated, and even adds a small amount of complexity to the monitoring code. The sensible option is to split this eventscript in two. There are two potentially backward incompatible changes here: * Functionality has been removed that allowed 50.samba to manage winbind when CTDB_MANAGES_WINBIND was unset but the smb.conf "security" parameter was set to "ADS" or "DOMAIN". Maintaining this functionality would have required moving the testparm-related code to the functions file, deciding where the cache file should go, and then calling it from both 49.winbind and 50.samba. This feature wasn't of great value and asking administrators to set an extra variable in exchange for code simplicity seems like a reasonable deal. * External code will need to be changed if it calls 50.samba directly with winbind-related expectations. This is fairly obvious! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 34535ae64420926b9a3bf7d453fed4e6f4c90115)
* tests/eventscripts: New policy routing test with invalid table IDMartin Schwenke2012-09-111-0/+41
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 93c97c3ba3ff714dfa0d056a91ff45010a6e2d66)
* tests/eventscripts: Modify ip stub to simulate invalid table IDMartin Schwenke2012-09-111-15/+36
| | | | | | | | | | This involves refactoring ip_route_check_table() into a new function ip_check_table() which tables the operation type (i.e. rule/route) as an argument. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit acdaa04079a9827885f32a7bc078d3365c89b474)
* tests/eventscript: unit test for 13.per_ip_routing bogus route removalMartin Schwenke2012-09-111-0/+47
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d41208074f0e9b56c585bca7eb39aaed653c4ca)
* tests/eventscripts: Add a policy routing unit test for "ip rule del" failureMartin Schwenke2012-09-111-0/+38
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0ce5b079f327aba55b62800ccb22d79976fac665)
* tests/eventscripts: Extra cases for policy routing missing config testMartin Schwenke2012-07-301-2/+5
| | | | | | | | Test the startup and monitor events too. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c29a943f9bbcfecb861e71d007c7698a53dc8773)
* tests/eventscripts: Rewrite the testparm stubMartin Schwenke2012-07-261-8/+23
| | | | | | | | | | It currently needs the real testparm command installed even though it only uses limited features. It is easy enough to fake up the functionality that 50.samba uses. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7ef9916bd95ff2472359a412eac5489f1aad2dce)
* tests/eventscripts: Tweak expected output for lockd:b restartMartin Schwenke2012-05-251-1/+1
| | | | | | | Commit 13acd58c41fba1a33894fbd654fed69ea0eac322 mades this test fail, since lockd:b and lockd:bs were incorrectly producing the same output. (This used to be ctdb commit fd3b73d7e634f16cbb99d7d5a548e12f00d1aadb)
* tests/eventscripts: Fix a policy routing testMartin Schwenke2012-05-111-1/+1
| | | | | | | | | The previous commit 55006ea8999ab3721fcde81b92692661065f0688 highlighted an error in this test. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9f20fbf91706db94f65f62dbd6a4e087890c1da9)
* tests/eventscripts: $CTDB_BASE needs to be in $TEST_VAR_DIRMartin Schwenke2012-05-111-1/+2
| | | | | | | | | | | | | The policy routing tests write the configuration file into $CTDB_BASE, as per rcommended practice. Unless this is in $TEST_VAR_DIR this won't work sensible when the tests are installed. Things are done slightly different than for /etc. Here we use symlinks and we want them to be dereferenced. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 61c80f58a8cfbaca7e669ef8cd95b4f6b5dc66c7)
* tests/eventscripts: $CTDB_ETCDIR should be in $TEST_VAR_DIRMartin Schwenke2012-04-271-12/+12
| | | | | | | | | | | | | The policy routing tests modify /etc/iproute2/rt_tables, so this directory should not be in the installation area. Instead the contents of tests/eventscripts/etc are copied into a place under $TEST_VAR_DIR where the directory can be modified with gay abandon. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a0afb4195caab39891a304b8b4eadd94cab7c4a7)
* tests/eventscripts: Use a canned ctdb.sysconfig rather than a linkMartin Schwenke2012-04-271-1/+2
| | | | | | | | | | | The link is hard to manage and has no real advantage. The canned config is 2 of the 3 currently non-comment/whitespace lines in config/ctdb.sysconfig. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 66d0b913301c3b1037278bcaa0452ecbe07248df)
* tests/eventscripts: Explicitly set CTDB_SERVICE_AUTOSTARTSTOP="yes"Martin Schwenke2012-04-272-0/+2
| | | | | | | | | No use depending on defaults in the initscript - the tests should control what is tested. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1c37abac5fd18c139aa55989d0fb6b475f4c22f1)
* tests/eventscripts: Be more defensive about removing the var directoryMartin Schwenke2012-04-271-1/+2
| | | | | | | | | Could add -r but that might avoid error. The only time it doesn't exist is the 1st time a top-level var directory is used. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 047d97dc84a5943556efb31bb2856fd04835fffa)
* tests/eventscripts: Add sanity check to esnure events.d/ can be foundMartin Schwenke2012-04-271-0/+25
| | | | | | | | | If it can't, the installation is probably inconsistent, so a (hopefully) helpful message is printed. :-) Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit df732ca8e27f0f3417b4d5d259157bd0e0632124)
* tests/eventscripts: $FAKE_IP_STATE is always set in ip command stubMartin Schwenke2012-04-271-2/+0
| | | | | | | | 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)
* tests: Unit tests should use $TEST_VAR_DIRMartin Schwenke2012-04-271-7/+2
| | | | | | | | | 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)
* tests: Make run_tests -X more flexible - it now works with onnodeMartin Schwenke2012-04-271-1/+5
| | | | | | | | | 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: Update README files and add new README files where missingMartin Schwenke2012-04-271-16/+20
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit bef03b32f8ec114a64c55b25951aeeb939d87b33)
* tests: Programs run by tests should be found in $PATHMartin Schwenke2012-04-271-1/+1
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b5308142d03332d6d4e0c3b77283c772462fbb23)
* tests: More unit test factoring/rationalisation and bug fixesMartin Schwenke2012-04-183-181/+9
| | | | | | | | | | | | | | | | | 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/eventscripts: Share directories must be absolute in eventscript testsMartin Schwenke2012-04-181-0/+5
| | | | | | | | | | 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)
* tests/eventscripts: Tweak an error message in a policy routing testMartin Schwenke2012-04-171-1/+1
| | | | | | | | | 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)
* tests/eventscripts - Restructure according to new conventionMartin Schwenke2012-04-1677-110/+86
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit eb13507713ba6732271b7c3024bfddbda6da5ffc)
* Tests - eventscripts - initial policy routing testsMartin Schwenke2012-03-2212-0/+422
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 7d7488a49bc7e799f39f3da3fa81be7a2e14480a)
* Tests - eventscripts - new function simple_test_command()Martin Schwenke2012-03-221-15/+34
| | | | | | | | | Allows running arbitrary command and comparing output against expected. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit da2e9650a97f99e7d694659926d9958927edd8ad)
* Tests - eventscripts - change summary columnsMartin Schwenke2012-03-221-1/+1
| | | | | | | | To accommodate 13.per_ip-routing in output. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0142729c96b8bfecfabe35439071557bcc6ed4da)
* Tests - eventscripts - rationalise CTDB fakery supportMartin Schwenke2012-03-221-22/+4
| | | | | | | | | | | Remove functions for marking nodes as down/up. This is now done via ctdb disable/enable in the stub. Also more consistent temporary directory use. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 1db9a533aacc6e02ddbadf76241429144a949e1c)
* Tests - eventscripts - improved support functions for handling public IPsMartin Schwenke2012-03-221-9/+27
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 299ce89fb3deeefcc7c01b20197dc6adee1e8194)
* Tests - eventscripts - add support functions for policy routing testingMartin Schwenke2012-03-221-0/+55
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 79eec235ac9b051333751186c32924d92e6ebeff)
* Tests - eventscripts - fix hardcoding errorMartin Schwenke2012-03-221-1/+5
| | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9c30bf7fd3d94884e27a258571a28dca5e460177)
* Tests - eventscripts - stub ctdb command updatesMartin Schwenke2012-03-221-50/+158
| | | | | | | | | | * Proper IP (re)allocation using ctdbd's IP allocation algorithm. * Therefore, "ctdb ip" works sensibly. * Add enable, disable, moveip. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d4b4b1293ba960d8fdf81958d6e8dd23c9d771a)