]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Use environment variable for specifying socket
authorMartin Schwenke <martin@meltin.net>
Wed, 21 Feb 2018 03:54:36 +0000 (14:54 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 19 Mar 2018 01:23:18 +0000 (02:23 +0100)
Use environment variables for test-only options.  Don't put them in
the configuration file.

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

index 07758fb74fba5edaf57367c354220b03e5b53ddf..b9b6232bbe8720cdd3f8c90723141e6fe8d03656 100644 (file)
@@ -169,7 +169,6 @@ setup_ctdb ()
                local node_ip=$(sed -n -e "$(($pnn + 1))p" "$CTDB_NODES")
 
                local conf=$(node_conf "$pnn")
-               local socket=$(node_socket "$pnn")
 
                local db_dir="${node_dir}/db"
                mkdir -p "${db_dir}/persistent"
@@ -184,7 +183,6 @@ CTDB_DBDIR="${db_dir}"
 CTDB_DBDIR_PERSISTENT="${db_dir}/persistent"
 CTDB_DBDIR_STATE="${db_dir}/state"
 CTDB_PUBLIC_ADDRESSES="${public_addresses}"
-CTDB_SOCKET="${socket}"
 CTDB_NOSETSCHED=yes
 EOF
 
@@ -200,6 +198,7 @@ start_ctdb_1 ()
        local node_dir=$(node_dir "$pnn")
        local pidfile=$(node_pidfile "$pnn")
        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
@@ -217,6 +216,7 @@ start_ctdb_1 ()
             CTDB_BASE="$node_dir" \
             CTDBD_CONF="$conf" \
             CTDB_PIDFILE="$pidfile" \
+            CTDB_SOCKET="$socket" \
             ctdbd_wrapper start
 
        if [ -n "$tmp_conf" ] ; then
@@ -240,10 +240,12 @@ stop_ctdb_1 ()
        local node_dir=$(node_dir "$pnn")
        local pidfile=$(node_pidfile "$pnn")
        local conf=$(node_conf "$pnn")
+       local socket=$(node_socket "$pnn")
 
        CTDB_BASE="$node_dir" \
                 CTDBD_CONF="$conf" \
                 CTDB_PIDFILE="$pidfile" \
+                CTDB_SOCKET="$socket" \
                 ctdbd_wrapper stop
 }