ClickHouse/tests/queries/0_stateless/02922_server_exit_code.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
594 B
Bash
Raw Normal View History

2023-11-23 16:18:11 +00:00
#!/usr/bin/env bash
# Tags: no-fasttest
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
# We will check that the server's exit code corresponds to the exception code if it was terminated after exception.
# In this example, we provide an invalid path to the server's config, ignore its logs and check the exit code.
2024-06-11 14:42:39 +00:00
# The exception code is 76 = CANNOT_OPEN_FILE, so the exit code will be 76 % 256.
2023-11-23 16:18:11 +00:00
2024-06-11 14:42:39 +00:00
${CLICKHOUSE_SERVER_BINARY} -- --path /dev/null 2>/dev/null; [[ "$?" == "$((76 % 256))" ]] && echo 'Ok' || echo 'Fail'