Add test: client reads host and port from config

This commit is contained in:
vdimir 2022-02-21 12:53:16 +00:00
parent e546721f67
commit 0156c20ee3
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 20 additions and 0 deletions

View File

@ -20,6 +20,9 @@
1
1
1
=== Values form config
1
1
===
1
1

View File

@ -52,6 +52,23 @@ error="$(${CLICKHOUSE_CLIENT} --host "${ipv6_host_with_brackets}" --port "${not_
echo "${error}" | grep -Fc "Code: 210"
echo "${error}" | grep -Fc "${ipv6_host_with_brackets}:${not_alive_port}"
echo '=== Values form config'
CUSTOM_CONFIG="$CURDIR/02100_config.xml"
rm -f ${CUSTOM_CONFIG}
cat << EOF > ${CUSTOM_CONFIG}
<config>
<host>${not_alive_host}</host>
<port>${not_alive_port}</port>
</config>
EOF
error="$(${CLICKHOUSE_CLIENT} --config ${CUSTOM_CONFIG} --query "SELECT 1" 2>&1 > /dev/null)"
echo "${error}" | grep -Fc "DB::NetException"
echo "${error}" | grep -Fc "${not_alive_host}:${not_alive_port}"
rm -f ${CUSTOM_CONFIG}
echo '==='
${CLICKHOUSE_CLIENT} --query "SELECT 1";