summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-04-24 16:59:38 +1000
committerMartin Schwenke <martin@meltin.net>2012-04-27 15:42:42 +1000
commita14671f829ccfa8a415cb85e2d4ae7b06135d5be (patch)
treeffc178c9d62f78cf4164ad7dc5a96169b30bb5f1 /ctdb/tests/eventscripts/scripts
parentdc2dfbdb93eadd4e3112af9cdd33b43042f7ec20 (diff)
downloadsamba-a14671f829ccfa8a415cb85e2d4ae7b06135d5be.tar.gz
samba-a14671f829ccfa8a415cb85e2d4ae7b06135d5be.tar.xz
samba-a14671f829ccfa8a415cb85e2d4ae7b06135d5be.zip
tests/eventscripts: Add sanity check to esnure events.d/ can be found
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)
Diffstat (limited to 'ctdb/tests/eventscripts/scripts')
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index 79d0ea053a..25003052a0 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -29,6 +29,31 @@ else
fi
export CTDB_BASE
+if [ ! -d "${CTDB_BASE}/events.d" ] ; then
+ cat <<EOF
+ERROR: Directory ${CTDB_BASE}/events.d does not exist.
+
+That means that no eventscripts can be tested.
+
+One possible explanation:
+
+ You have CTDB installed via RPMs (or similar), so the regular
+ CTDB_BASE directory is in /etc/ctdb/
+
+ BUT
+
+ You have done a regular "configure" and "make install" so the tests
+ are installed under /usr/local/.
+
+If so, one possible hack to fix this is to create a symlink:
+
+ ln -s /etc/ctdb /usr/local/etc/ctdb
+
+This is nasty but it works... :-)
+EOF
+ exit 1
+fi
+
export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_VAR_DIR}/unit_eventscripts"
if [ "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/unit_eventscripts" ] ; then
rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR"