diff options
author | Martin Schwenke <martin@meltin.net> | 2011-11-21 13:44:30 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-02-06 16:02:09 +1100 |
commit | c497e4bc195095896330d0dae4ba4c5e09882fd1 (patch) | |
tree | 782d3dc1ffac459387fe3a3351f4b8c8280ca018 | |
parent | 4e01fedea5633bee2d39e877fbbae8c623ebeb8f (diff) | |
download | samba-c497e4bc195095896330d0dae4ba4c5e09882fd1.tar.gz samba-c497e4bc195095896330d0dae4ba4c5e09882fd1.tar.xz samba-c497e4bc195095896330d0dae4ba4c5e09882fd1.zip |
Tests: eventscripts - fix breakage in some NFS tests
1341329f6125d491b82c873f793af819e677f714 either contains typos or
attempts to influence the test depending on the host system. Whatever
the cause, a test system (e.g. my laptop) might not have
/etc/sysconfig/nfs, so that can't be used to cause the stub
etc/sysconfig/nfs to be loaded.
We make the tests work by default again, leaving in some flexibility
over configuration file location.
If the goal is to force a Debian-style test mode then:
* The tests are currently probably quite RHEL-centric anyway, so more
work is probably needed.
* Use an environment variable to indicate the distro test mode and
make functions like setup_nfs() remove all of the various
configuration files and create one in the distro-specific location.
I won't do this now... ENOTIME...
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 4aa4a5790ea9ad20e4d25404760c449b358b5260)
-rw-r--r-- | ctdb/tests/eventscripts/common.sh | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/ctdb/tests/eventscripts/common.sh b/ctdb/tests/eventscripts/common.sh index a79c293e01..df9656b831 100644 --- a/ctdb/tests/eventscripts/common.sh +++ b/ctdb/tests/eventscripts/common.sh @@ -460,16 +460,13 @@ rpc_set_service_failure_response () # the flexibility to set the number of failures. _numfails="${2:-${iteration}}" - if [ -f /etc/sysconfig/nfs ]; then - _c="${CTDB_ETCDIR}/sysconfig/nfs" - elif [ -f /etc/default/nfs ]; then - _c="${CTDB_ETCDIR}/default/nfs" - elif [ -f /etc/ctdb/sysconfig/nfs ]; then - _c="${CTDB_ETCDIR}/ctdb/sysconfig/nfs" - fi - if [ -r "$_c" ] ; then - . "$_c" - fi + _etc="$CTDB_ETCDIR" # shortcut for readability + for _c in "$_etc/sysconfig/nfs" "$_etc/default/nfs" "$_etc/ctdb/sysconfig/nfs" ; do + if [ -r "$_c" ] ; then + . "$_c" + break + fi + done # A handy newline. :-) _nl=" |