Fix minor bugs in server start/kill tests

This commit is contained in:
Andrew Bettison 2014-06-11 11:15:28 +09:30
parent afd31fe12c
commit 11dcc3e972
2 changed files with 14 additions and 1 deletions

View File

@ -387,7 +387,7 @@ start_servald_server() {
# - invoke "servald start" command with given args and suitable environment
servald_start() {
rm -r -f "$instance_dir/cache"
mkdir "$instance_dir/cache" || error "mkdir failed"
mkdir -p "$instance_dir/cache" || error "mkdir failed"
SERVALD_SERVER_CHDIR="$instance_dir" SERVALD_LOG_FILE="$instance_servald_log" $servald start "$@"
}

View File

@ -130,6 +130,19 @@ test_StartTwice() {
doc_RemovePid="Server stops when pid file removed"
setup_RemovePid() {
setup
# Set a watchdog alarm to ensure that the daemon wakes regularly, so the
# pidfile is checked quickly, otherwise the daemon will wait 30 seconds
# before waking itself to check.
>watchdog
chmod 0550 watchdog
executeOk_servald config \
set log.console.level debug \
set log.console.show_time true \
set log.console.show_pid true \
set debug.io true \
set debug.watchdog on \
set server.watchdog.executable "$PWD/watchdog" \
set server.watchdog.interval_ms 100
start_servald_server
}
test_RemovePid() {