diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
commit | dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch) | |
tree | 66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/clickhouse-start.sh | |
parent | Initial commit. (diff) | |
download | rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip |
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/clickhouse-start.sh')
-rwxr-xr-x | tests/clickhouse-start.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/clickhouse-start.sh b/tests/clickhouse-start.sh new file mode 100755 index 0000000..200200c --- /dev/null +++ b/tests/clickhouse-start.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# This is not a real test, but a script to start clickhouse. It is +# implemented as test so that we can start clickhouse at the time we need +# it (do so via Makefile.am). +# Copyright (C) 2018 Pascal Withopf and Adiscon GmbH +# Released under ASL 2.0 +. ${srcdir:=.}/diag.sh init +set -x +if [ "$CLICKHOUSE_START_CMD" == "" ]; then + exit_test # no start needed +fi + +test_error_exit_handler() { + printf 'clickhouse startup failed, log is:\n' + $SUDO cat /var/log/clickhouse-server/clickhouse-server.err.log +} + +printf 'starting clickhouse...\n' +$CLICKHOUSE_START_CMD & +sleep 10 +#wait_startup_pid /var/run/clickhouse-server/clickhouse-server.pid +printf 'preparing clickhouse for testbench use...\n' +$SUDO ${srcdir}/../devtools/prepare_clickhouse.sh +clickhouse-client --query="select 1" +rc=$? +if [ $rc -ne 0 ]; then + printf 'clickhouse failed to start, exit code %d\n' $rc + error_exit 100 +fi +printf 'done, clickhouse ready for testbench\n' +exit_test |