mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Add a test for custom TLD
This commit is contained in:
parent
916cbd6610
commit
8875767b87
9
tests/config/config.d/top_level_domains_lists.xml
Normal file
9
tests/config/config.d/top_level_domains_lists.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<yandex>
|
||||
<top_level_domains_lists>
|
||||
<!-- relative to application.path, i.e.:
|
||||
- /var/lib/clickhouse/ on CI
|
||||
- $PWD local
|
||||
-->
|
||||
<public_suffix_list>public_suffix_list.dat</public_suffix_list>
|
||||
</top_level_domains_lists>
|
||||
</yandex>
|
@ -30,6 +30,7 @@ ln -sf $SRC_PATH/config.d/database_atomic.xml $DEST_SERVER_PATH/config.d/
|
||||
ln -sf $SRC_PATH/config.d/test_cluster_with_incorrect_pw.xml $DEST_SERVER_PATH/config.d/
|
||||
ln -sf $SRC_PATH/config.d/logging_no_rotate.xml $DEST_SERVER_PATH/config.d/
|
||||
ln -sf $SRC_PATH/config.d/tcp_with_proxy.xml $DEST_SERVER_PATH/config.d/
|
||||
ln -sf $SRC_PATH/config.d/top_level_domains_lists.xml $DEST_SERVER_PATH/config.d/
|
||||
ln -sf $SRC_PATH/users.d/log_queries.xml $DEST_SERVER_PATH/users.d/
|
||||
ln -sf $SRC_PATH/users.d/readonly.xml $DEST_SERVER_PATH/users.d/
|
||||
ln -sf $SRC_PATH/users.d/access_management.xml $DEST_SERVER_PATH/users.d/
|
||||
@ -41,6 +42,12 @@ ln -sf $SRC_PATH/strings_dictionary.xml $DEST_SERVER_PATH/
|
||||
ln -sf $SRC_PATH/decimals_dictionary.xml $DEST_SERVER_PATH/
|
||||
ln -sf $SRC_PATH/executable_dictionary.xml $DEST_SERVER_PATH/
|
||||
|
||||
# For CI when it is runned via init service
|
||||
mkdir -p /var/lib/clickhouse/cores
|
||||
ln -sf $SRC_PATH/public_suffix_list.dat /var/lib/clickhouse/cores/
|
||||
# For fasttest, that runs server just in background
|
||||
ln -sf $SRC_PATH/public_suffix_list.dat ./
|
||||
|
||||
ln -sf $SRC_PATH/server.key $DEST_SERVER_PATH/
|
||||
ln -sf $SRC_PATH/server.crt $DEST_SERVER_PATH/
|
||||
ln -sf $SRC_PATH/dhparam.pem $DEST_SERVER_PATH/
|
||||
|
13491
tests/config/public_suffix_list.dat
Normal file
13491
tests/config/public_suffix_list.dat
Normal file
File diff suppressed because it is too large
Load Diff
11
tests/queries/0_stateless/01601_custom_tld.reference
Normal file
11
tests/queries/0_stateless/01601_custom_tld.reference
Normal file
@ -0,0 +1,11 @@
|
||||
no-tld
|
||||
|
||||
foo.there-is-no-such-domain
|
||||
foo.there-is-no-such-domain
|
||||
foo
|
||||
generic
|
||||
kernel
|
||||
kernel.biz.ss
|
||||
difference
|
||||
biz.ss
|
||||
kernel.biz.ss
|
16
tests/queries/0_stateless/01601_custom_tld.sql
Normal file
16
tests/queries/0_stateless/01601_custom_tld.sql
Normal file
@ -0,0 +1,16 @@
|
||||
select 'no-tld';
|
||||
select cutToFirstSignificantSubdomainCustom('there-is-no-such-domain', 'public_suffix_list');
|
||||
-- even if there is no TLD, 2-nd level by default anyway
|
||||
-- FIXME: make this behavior optional (so that TLD for host never changed, either empty or something real)
|
||||
select cutToFirstSignificantSubdomainCustom('foo.there-is-no-such-domain', 'public_suffix_list');
|
||||
select cutToFirstSignificantSubdomainCustom('bar.foo.there-is-no-such-domain', 'public_suffix_list');
|
||||
select firstSignificantSubdomainCustom('bar.foo.there-is-no-such-domain', 'public_suffix_list');
|
||||
|
||||
select 'generic';
|
||||
select firstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss
|
||||
select cutToFirstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss
|
||||
|
||||
select 'difference';
|
||||
-- biz.ss is not in the default TLD list, hence:
|
||||
select cutToFirstSignificantSubdomain('foo.kernel.biz.ss'); -- biz.ss
|
||||
select cutToFirstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss
|
Loading…
Reference in New Issue
Block a user