ctdb-tests: Fix logic to handle PATH additions for tests
authorMartin Schwenke <martin@meltin.net>
Wed, 15 Mar 2017 04:50:46 +0000 (15:50 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 14 Aug 2017 03:15:25 +0000 (05:15 +0200)
commite8c5d0e25e850d9a5f2fbd6b95b38deabedc0c64
treec2d8ee201ba8dfafb52afd04566e60074aae647c
parent661426df40abea0960ab3a0f55063dbb009ae6b6
ctdb-tests: Fix logic to handle PATH additions for tests

When using non-standard test subdirectories, the current code can fail
to find the test bin directory and stupidly just adds /bin to PATH.

Switch to using CTDB_TESTS_ARE_INSTALLED along with some sanity checks
to determine the mode of operation.

With this change, test directories can now be created as
subdirectories of arbitrary component directories.  Tests can then be
run directly, either by specifying the subdirectory or individual test
cases.

Integration into the top-level tests/ directory is then done via a
symbolic link, which enables 2 things:

* Ability to run a directory of test cases from top level by simply
  specifying the link name.

* Ease of installation - the installation code just works with the
  symbolic link.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/scripts/common.sh