From: Sebastian Harl Date: Sat, 19 Jul 2014 12:42:46 +0000 (+0200) Subject: t/integration/simple_config.sh: Test reconfiguration. X-Git-Tag: sysdb-0.3.0~43 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=551b7e143c98fbe771d6cebd7fecba32c503bfdb;p=sysdb.git t/integration/simple_config.sh: Test reconfiguration. --- diff --git a/t/integration/simple_config.sh b/t/integration/simple_config.sh index dd77055..175416d 100755 --- a/t/integration/simple_config.sh +++ b/t/integration/simple_config.sh @@ -53,7 +53,14 @@ Listen "$SOCKET_FILE" EOF run_sysdbd -D -C "$SYSDBD_CONF" - wait_for_sysdbd + +# reconfigure +cat < "$SYSDBD_CONF" +Listen "${SOCKET_FILE}-2" +EOF +kill -HUP $SYSDBD_PID +wait_for_sysdbd "${SOCKET_FILE}-2" + stop_sysdbd diff --git a/t/integration/test_lib.sh b/t/integration/test_lib.sh index 63be63b..c02feff 100644 --- a/t/integration/test_lib.sh +++ b/t/integration/test_lib.sh @@ -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