Code

t/integration/simple_config.sh: Test reconfiguration.
authorSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:42:46 +0000 (14:42 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:42:46 +0000 (14:42 +0200)
t/integration/simple_config.sh
t/integration/test_lib.sh

index dd77055b0c25432287f49075e4048ec5a869df0d..175416d59b5e08a9fff31aa0e85d59a2e446a6d6 100755 (executable)
@@ -53,7 +53,14 @@ Listen "$SOCKET_FILE"
 EOF
 
 run_sysdbd -D -C "$SYSDBD_CONF"
-
 wait_for_sysdbd
+
+# reconfigure
+cat <<EOF > "$SYSDBD_CONF"
+Listen "${SOCKET_FILE}-2"
+EOF
+kill -HUP $SYSDBD_PID
+wait_for_sysdbd "${SOCKET_FILE}-2"
+
 stop_sysdbd
 
index 63be63beef326ded85f739040d6542785838ab41..c02feffc7d4ac392582b72de418397833f02a199 100644 (file)
@@ -62,7 +62,7 @@ function run_sysdbd_foreground() {
 }
 
 function stop_sysdbd() {
-       if test -z $SYSDBD_PID; then
+       if test -z "$SYSDBD_PID"; then
                echo "Cannot stop sysdbd; PID unknown" >&2
                exit 1
        fi
@@ -72,9 +72,13 @@ function stop_sysdbd() {
 }
 
 function wait_for_sysdbd() {
+       local socket="$SOCKET_FILE"
        local i
+       if test -n "$1"; then
+               socket="$1"
+       fi
        for (( i=0; i<10; i++ )); do
-               if test -e "$SOCKET_FILE"; then
+               if test -e "$socket"; then
                        break
                fi
                sleep 1