mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Added FT testcase
This commit is contained in:
parent
d67e061915
commit
06e8b78efa
@ -323,25 +323,30 @@ void LocalServer::setupUsers()
|
||||
auto & access_control = global_context->getAccessControl();
|
||||
access_control.setNoPasswordAllowed(config().getBool("allow_no_password", true));
|
||||
access_control.setPlaintextPasswordAllowed(config().getBool("allow_plaintext_password", true));
|
||||
if (config().has("users_config") || config().has("config-file") || fs::exists("config.xml"))
|
||||
if (config().has("config-file") || fs::exists("config.xml"))
|
||||
{
|
||||
String config_path = config().getString("config-file","");
|
||||
bool has_user_directories = config().has("user_directories");
|
||||
const auto config_dir = std::filesystem::path{config_path}.remove_filename().string();
|
||||
String users_config_path = config().getString("users_config","");
|
||||
if (users_config_path.empty())
|
||||
if (users_config_path.empty() && !has_user_directories)
|
||||
users_config = getConfigurationFromXMLString(minimal_default_user_xml);
|
||||
else
|
||||
{
|
||||
if (!has_user_directories)
|
||||
users_config_path = config_path;
|
||||
}
|
||||
if (has_user_directories)
|
||||
users_config_path = config().getString("user_directories.users_xml.path","");
|
||||
if (users_config_path.empty())
|
||||
{
|
||||
if (!has_user_directories)
|
||||
users_config_path = config_path;
|
||||
}
|
||||
if (has_user_directories)
|
||||
users_config_path = config().getString("user_directories.users_xml.path","");
|
||||
|
||||
if (std::filesystem::path{users_config_path}.is_relative() && std::filesystem::exists(config_dir + users_config_path))
|
||||
users_config_path = config_dir + users_config_path;
|
||||
ConfigProcessor config_processor(users_config_path);
|
||||
const auto loaded_config = config_processor.loadConfig();
|
||||
users_config = loaded_config.configuration;
|
||||
if (std::filesystem::path{users_config_path}.is_relative() && std::filesystem::exists(config_dir + users_config_path))
|
||||
users_config_path = config_dir + users_config_path;
|
||||
ConfigProcessor config_processor(users_config_path);
|
||||
const auto loaded_config = config_processor.loadConfig();
|
||||
users_config = loaded_config.configuration;
|
||||
}
|
||||
}
|
||||
else
|
||||
users_config = getConfigurationFromXMLString(minimal_default_user_xml);
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
54
tests/queries/0_stateless/02360_clickhouse_local_config-option.sh
Executable file
54
tests/queries/0_stateless/02360_clickhouse_local_config-option.sh
Executable file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
echo "<?xml version="1.0"?>
|
||||
<clickhouse>
|
||||
<logger>
|
||||
<level>trace</level>
|
||||
<console>true</console>
|
||||
</logger>
|
||||
|
||||
<tcp_port>9000</tcp_port>
|
||||
|
||||
<path>./</path>
|
||||
|
||||
<mark_cache_size>0</mark_cache_size>
|
||||
<user_directories>
|
||||
<users_xml>
|
||||
<!-- Path to configuration file with predefined users. -->
|
||||
<path>users.xml</path>
|
||||
</users_xml>
|
||||
</user_directories>
|
||||
</clickhouse>" > $CUR_DIR/config.xml
|
||||
|
||||
echo "<clickhouse>
|
||||
<profiles>
|
||||
<default></default>
|
||||
</profiles>
|
||||
<users>
|
||||
<default>
|
||||
<password></password>
|
||||
<networks>
|
||||
<ip>::/0</ip>
|
||||
</networks>
|
||||
<profile>default</profile>
|
||||
<quota>default</quota>
|
||||
</default>
|
||||
</users>
|
||||
<quotas>
|
||||
<default></default>
|
||||
</quotas>
|
||||
</clickhouse>" > $CUR_DIR/users.xml
|
||||
|
||||
local_opts=(
|
||||
"--config-file=$CUR_DIR/config.xml"
|
||||
"--send_logs_level=none")
|
||||
|
||||
${CLICKHOUSE_LOCAL} "${local_opts[@]}" --query 'Select 1' | grep -v -e 'Processing configuration file'
|
||||
|
||||
rm -rf $CUR_DIR/users.xml
|
||||
rm -rf $CUR_DIR/config.xml
|
Loading…
Reference in New Issue
Block a user