]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Don't allow simple tests to use environment for config
authorMartin Schwenke <martin@meltin.net>
Fri, 23 Feb 2018 03:54:51 +0000 (14:54 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 19 Mar 2018 01:23:18 +0000 (02:23 +0100)
This was a mistake.

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

index 09898707e03e0a2495642ddae3459d3f81931ea9..0fda44f8a028a66eaade93f8c3c2a4f44875a41c 100644 (file)
@@ -28,15 +28,6 @@ export ONNODE_SSH="${TEST_SUBDIR}/scripts/ssh_local_daemons.sh"
 
 #######################################
 
-config_from_environment ()
-{
-       # Override from the environment.  This would be easier if env was
-       # guaranteed to quote its output so it could be reused.
-       env |
-       grep '^CTDB_' |
-       sed -e 's@=\([^"]\)@="\1@' -e 's@[^"]$@&"@' -e 's@="$@&"@'
-}
-
 # If the given IP is hosted then print 2 items: maskbits and iface
 have_ip ()
 {
@@ -196,10 +187,6 @@ CTDB_DBDIR_STATE="${db_dir}/state"
 CTDB_PUBLIC_ADDRESSES="${public_addresses}"
 CTDB_NOSETSCHED=yes
 EOF
-
-               # Append any configuration variables set in environment to
-               # configuration file so they affect CTDB after each restart.
-               config_from_environment >>"$conf"
        done
 }
 
@@ -211,28 +198,12 @@ start_ctdb_1 ()
        local conf=$(node_conf "$pnn")
        local socket=$(node_socket "$pnn")
 
-       # If there is any CTDB configuration in the environment then
-       # append it to the regular configuration in a temporary
-       # configuration file and use it just this once.
-       local tmp_conf=""
-       local env_conf=$(config_from_environment)
-       if [ -n "$env_conf" ] ; then
-               tmp_conf=$(mktemp --tmpdir="$SIMPLE_TESTS_VAR_DIR")
-               cat "$conf" >"$tmp_conf"
-               echo "$env_conf" >>"$tmp_conf"
-               conf="$tmp_conf"
-       fi
-
        CTDBD="${VALGRIND} ctdbd --sloppy-start --nopublicipcheck" \
             CTDB_BASE="$node_dir" \
             CTDBD_CONF="$conf" \
             CTDB_PIDFILE="$pidfile" \
             CTDB_SOCKET="$socket" \
             ctdbd_wrapper start
-
-       if [ -n "$tmp_conf" ] ; then
-               rm -f "$tmp_conf"
-       fi
 }
 
 daemons_start ()