Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
895b8e65
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
895b8e65
编写于
5月 28, 2018
作者:
P
proller
提交者:
GitHub
5月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix test 00505_secure with random ports (#2433)
上级
421d1602
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
53 addition
and
23 deletion
+53
-23
dbms/tests/clickhouse-client.xml
dbms/tests/clickhouse-client.xml
+0
-1
dbms/tests/clickhouse-test-server
dbms/tests/clickhouse-test-server
+18
-6
dbms/tests/queries/0_stateless/00505_distributed_secure.data
dbms/tests/queries/0_stateless/00505_distributed_secure.data
+1
-1
dbms/tests/queries/0_stateless/00505_secure.reference
dbms/tests/queries/0_stateless/00505_secure.reference
+2
-2
dbms/tests/queries/0_stateless/00505_secure.sh
dbms/tests/queries/0_stateless/00505_secure.sh
+26
-8
debian/pbuilder-hooks/B90test-server
debian/pbuilder-hooks/B90test-server
+4
-4
utils/travis/normal.sh
utils/travis/normal.sh
+1
-1
utils/travis/pbuilder.sh
utils/travis/pbuilder.sh
+1
-0
未找到文件。
dbms/tests/clickhouse-client.xml
浏览文件 @
895b8e65
<yandex>
<yandex>
<tcp_port_secure>
59440
</tcp_port_secure>
<insert_format_max_block_size>
100000
</insert_format_max_block_size>
<insert_format_max_block_size>
100000
</insert_format_max_block_size>
</yandex>
</yandex>
dbms/tests/clickhouse-test-server
浏览文件 @
895b8e65
...
@@ -25,8 +25,8 @@ export CLICKHOUSE_CONFIG=${CLICKHOUSE_CONFIG:=${CONFIG_SERVER_DIR}server-test.xm
...
@@ -25,8 +25,8 @@ export CLICKHOUSE_CONFIG=${CLICKHOUSE_CONFIG:=${CONFIG_SERVER_DIR}server-test.xm
[
!
-d
"
$QUERIES_DIR
"
]
&&
[
-d
"/usr/share/clickhouse-test/queries"
]
&&
QUERIES_DIR
=
${
QUERIES_DIR
=/usr/share/clickhouse-test/queries
}
[
!
-d
"
$QUERIES_DIR
"
]
&&
[
-d
"/usr/share/clickhouse-test/queries"
]
&&
QUERIES_DIR
=
${
QUERIES_DIR
=/usr/share/clickhouse-test/queries
}
CLICKHOUSE_EXTRACT_CONFIG
=
${
CLICKHOUSE_EXTRACT_CONFIG
:
=
"
${
BIN_DIR
}${
CLICKHOUSE_BINARY
}
-extract-from-config --config=
$CLICKHOUSE_CONFIG
"
}
CLICKHOUSE_EXTRACT_CONFIG
=
${
CLICKHOUSE_EXTRACT_CONFIG
:
=
"
${
BIN_DIR
}${
CLICKHOUSE_BINARY
}
-extract-from-config --config=
$CLICKHOUSE_CONFIG
"
}
PORT_RANDOM
=
${
PORT_RANDOM
=1
}
TEST_PORT_RANDOM
=
${
TEST_
PORT_RANDOM
=1
}
if
[
"
${
PORT_RANDOM
}
"
]
;
then
if
[
"
${
TEST_
PORT_RANDOM
}
"
]
;
then
CLICKHOUSE_PORT_BASE
=
${
CLICKHOUSE_PORT_BASE
:
=
$((
(
RANDOM
%
50000
)
+
10000
))}
CLICKHOUSE_PORT_BASE
=
${
CLICKHOUSE_PORT_BASE
:
=
$((
(
RANDOM
%
50000
)
+
10000
))}
CLICKHOUSE_PORT_TCP
=
${
CLICKHOUSE_PORT_TCP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
1
))}
CLICKHOUSE_PORT_TCP
=
${
CLICKHOUSE_PORT_TCP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
1
))}
CLICKHOUSE_PORT_HTTP
=
${
CLICKHOUSE_PORT_HTTP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
2
))}
CLICKHOUSE_PORT_HTTP
=
${
CLICKHOUSE_PORT_HTTP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
2
))}
...
@@ -58,23 +58,35 @@ if [ "$TEST_GDB" ]; then
...
@@ -58,23 +58,35 @@ if [ "$TEST_GDB" ]; then
fi
fi
# Start a local clickhouse server which will be used to run tests
# Start a local clickhouse server which will be used to run tests
#PATH=$PATH:$BIN_DIR \
$GDB
${
BIN_DIR
}
clickhouse-server
--config-file
=
$CLICKHOUSE_CONFIG
--
--http_port
=
$CLICKHOUSE_PORT_HTTP
--tcp_port
=
$CLICKHOUSE_PORT_TCP
--https_port
=
$CLICKHOUSE_PORT_HTTPS
--tcp_port_secure
=
$CLICKHOUSE_PORT_TCP_SECURE
--interserver_http_port
=
$CLICKHOUSE_PORT_INTERSERVER
>
$LOG_DIR
/stdout 2>&1 &
# TODO: fix change shard ports:
# --remote_servers.test_shard_localhost_secure.shard.replica.port=$CLICKHOUSE_PORT_TCP_SECURE \
# --remote_servers.test_shard_localhost.shard.replica.port=$CLICKHOUSE_PORT_TCP \
$GDB
${
BIN_DIR
}
clickhouse-server
--config-file
=
$CLICKHOUSE_CONFIG
--
\
--http_port
=
$CLICKHOUSE_PORT_HTTP
\
--tcp_port
=
$CLICKHOUSE_PORT_TCP
\
--https_port
=
$CLICKHOUSE_PORT_HTTPS
\
--tcp_port_secure
=
$CLICKHOUSE_PORT_TCP_SECURE
\
--interserver_http_port
=
$CLICKHOUSE_PORT_INTERSERVER
\
>
$LOG_DIR
/stdout 2>&1 &
CH_PID
=
$!
CH_PID
=
$!
sleep
3
sleep
3
if
[
"
$GDB
"
]
;
then
if
[
"
$GDB
"
]
;
then
# Long symbols read
# Long symbols read
sleep
40
sleep
40
fi
fi
tail
-n50
$LOG_DIR
/
*
tail
-n50
$LOG_DIR
/
*
.log
||
true
# Define needed stuff to kill test clickhouse server after tests completion
# Define needed stuff to kill test clickhouse server after tests completion
function
finish
{
function
finish
{
kill
$CH_PID
||
true
kill
$CH_PID
||
true
wait
wait
tail
-n
50
$LOG_DIR
/
*
tail
-n
50
$LOG_DIR
/
*
.log
||
true
if
[
"
$GDB
"
]
;
then
if
[
"
$GDB
"
]
;
then
cat
$DATA_DIR
/gdb.log
||
true
cat
$DATA_DIR
/gdb.log
||
true
fi
fi
...
...
dbms/tests/queries/0_stateless/00505_distributed_secure.data
浏览文件 @
895b8e65
...
@@ -11,7 +11,7 @@ INSERT INTO test.secure1 VALUES (11,12,13,14,15);
...
@@ -11,7 +11,7 @@ INSERT INTO test.secure1 VALUES (11,12,13,14,15);
INSERT INTO test.secure2 VALUES (21,22,23,24,25);
INSERT INTO test.secure2 VALUES (21,22,23,24,25);
INSERT INTO test.secure3 VALUES (31,32,33,34,35);
INSERT INTO test.secure3 VALUES (31,32,33,34,35);
SELECT sleep(1);
SELECT
'sleep',
sleep(1);
SELECT * FROM test.secure1 ORDER BY a;
SELECT * FROM test.secure1 ORDER BY a;
SELECT * FROM test.secure2 ORDER BY a;
SELECT * FROM test.secure2 ORDER BY a;
...
...
dbms/tests/queries/0_stateless/00505_secure.reference
浏览文件 @
895b8e65
1
1
2
2
3
3
1
4
0
sleep
0
1970-01-02 2 3 4 5
1970-01-02 2 3 4 5
1970-01-12 12 13 14 15
1970-01-12 12 13 14 15
1970-01-22 22 23 24 25
1970-01-22 22 23 24 25
...
...
dbms/tests/queries/0_stateless/00505_secure.sh
浏览文件 @
895b8e65
#!/usr/bin/env bash
#!/usr/bin/env bash
#set -x
CURDIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
CURDIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
.
$CURDIR
/../shell_config.sh
.
$CURDIR
/../shell_config.sh
# Not default server config needed
# Not default server config needed
tcp_port_secure
=
`
$
{
CLICKHOUSE_EXTRACT_CONFIG
}
-k
tcp_port_secure 2>/dev/null
`
tcp_port_secure
=
`
$
CLICKHOUSE_EXTRACT_CONFIG
-k
tcp_port_secure 2>/dev/null
`
if
[
-z
$
{
tcp_port_secure
}
]
;
then
if
[
-z
$
tcp_port_secure
]
;
then
# Secure port disabled. Fake result
# Secure port disabled. Fake result
cat
$CURDIR
/00505_secure.reference
cat
$CURDIR
/00505_secure.reference
else
else
# Auto port detect
${
CLICKHOUSE_CLIENT
}
--secure
-q
"SELECT 1"
;
${
CLICKHOUSE_CLIENT
}
--secure
--port
=
${
CLICKHOUSE_PORT_TCP_SECURE
}
-q
"SELECT 2"
;
${
CLICKHOUSE_CURL
}
-sS
--insecure
${
CLICKHOUSE_URL_HTTPS
}
?query
=
SELECT%203
if
[[
$CLICKHOUSE_CLIENT
!=
*
"--port"
*
]]
;
then
CLICKHOUSE_CLIENT_SECURE
=
${
CLICKHOUSE_CLIENT_SECURE
:
=
"
$CLICKHOUSE_CLIENT
--secure --port=
$CLICKHOUSE_PORT_TCP_SECURE
"
}
# Auto port detect. Cant test with re-definedvia command line ports
$CLICKHOUSE_CLIENT
--secure
-q
"SELECT 1"
;
else
CLICKHOUSE_CLIENT_BINARY
=
${
CLICKHOUSE_CLIENT_BINARY
:
=
"
${
CLICKHOUSE_BINARY
}
-client"
}
CLICKHOUSE_CLIENT_SECURE
=
${
CLICKHOUSE_CLIENT_SECURE
:
=
"
$CLICKHOUSE_CLIENT_BINARY
--secure --port=
$CLICKHOUSE_PORT_TCP_SECURE
"
}
echo
1
fi
$CLICKHOUSE_CLIENT_SECURE
-q
"SELECT 2;"
$CLICKHOUSE_CURL
-sS
--insecure
${
CLICKHOUSE_URL_HTTPS
}
?query
=
SELECT%203
$CLICKHOUSE_CLIENT_SECURE
-q
"SELECT 4;"
${
CLICKHOUSE_CLIENT
}
--secure
-q
"SELECT 1"
;
# TODO: can test only on unchanged port. Possible solutions: generate config or pass shard port via command line
if
[[
"
$CLICKHOUSE_PORT_TCP_SECURE
"
=
"
$tcp_port_secure
"
]]
;
then
cat
$CURDIR
/00505_distributed_secure.data |
$CLICKHOUSE_CLIENT_SECURE
-n
-m
else
tail
-n
13
$CURDIR
/00505_secure.reference
fi
cat
$CURDIR
/00505_distributed_secure.data |
$CLICKHOUSE_CLIENT
--secure
-n
-m
fi
fi
debian/pbuilder-hooks/B90test-server
浏览文件 @
895b8e65
...
@@ -5,7 +5,7 @@ set -x
...
@@ -5,7 +5,7 @@ set -x
TEST_CONNECT
=
${
TEST_CONNECT
=1
}
TEST_CONNECT
=
${
TEST_CONNECT
=1
}
TEST_SSL
=
${
TEST_SSL
=1
}
TEST_SSL
=
${
TEST_SSL
=1
}
PACKAGE_INSTALL
=
${
PACKAGE_INSTALL
=1
}
PACKAGE_INSTALL
=
${
PACKAGE_INSTALL
=1
}
PORT_RANDOM
=
${
PORT_RANDOM
=1
}
TEST_PORT_RANDOM
=
${
TEST_
PORT_RANDOM
=1
}
if
[
"
${
PACKAGE_INSTALL
}
"
]
;
then
if
[
"
${
PACKAGE_INSTALL
}
"
]
;
then
for
PKG
in
$(
ls
/tmp/buildd/
*
.deb |
sed
-e
's,.*/,,;s,_.*,,'
)
;
do
for
PKG
in
$(
ls
/tmp/buildd/
*
.deb |
sed
-e
's,.*/,,;s,_.*,,'
)
;
do
...
@@ -25,7 +25,7 @@ fi
...
@@ -25,7 +25,7 @@ fi
mkdir
-p
/etc/clickhouse-server/config.d /etc/clickhouse-client/config.d
mkdir
-p
/etc/clickhouse-server/config.d /etc/clickhouse-client/config.d
if
[
"
${
PORT_RANDOM
}
"
]
;
then
if
[
"
${
TEST_
PORT_RANDOM
}
"
]
;
then
CLICKHOUSE_PORT_BASE
=
${
CLICKHOUSE_PORT_BASE
:
=
$((
(
RANDOM
%
50000
)
+
10000
))}
CLICKHOUSE_PORT_BASE
=
${
CLICKHOUSE_PORT_BASE
:
=
$((
(
RANDOM
%
50000
)
+
10000
))}
CLICKHOUSE_PORT_TCP
=
${
CLICKHOUSE_PORT_TCP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
1
))}
CLICKHOUSE_PORT_TCP
=
${
CLICKHOUSE_PORT_TCP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
1
))}
CLICKHOUSE_PORT_HTTP
=
${
CLICKHOUSE_PORT_HTTP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
2
))}
CLICKHOUSE_PORT_HTTP
=
${
CLICKHOUSE_PORT_HTTP
:
=
$((
$CLICKHOUSE_PORT_BASE
+
2
))}
...
@@ -41,10 +41,10 @@ export CLICKHOUSE_PORT_TCP_SECURE=${CLICKHOUSE_PORT_TCP_SECURE:=9440}
...
@@ -41,10 +41,10 @@ export CLICKHOUSE_PORT_TCP_SECURE=${CLICKHOUSE_PORT_TCP_SECURE:=9440}
export
CLICKHOUSE_PORT_HTTPS
=
${
CLICKHOUSE_PORT_HTTPS
:
=8443
}
export
CLICKHOUSE_PORT_HTTPS
=
${
CLICKHOUSE_PORT_HTTPS
:
=8443
}
if
[
"
${
TEST_CONNECT
}
"
]
;
then
if
[
"
${
TEST_CONNECT
}
"
]
;
then
[
"
${
PORT_RANDOM
}
"
]
&&
echo
"<yandex><http_port>
${
CLICKHOUSE_PORT_HTTP
}
</http_port><tcp_port>
${
CLICKHOUSE_PORT_TCP
}
</tcp_port><interserver_http_port>
${
CLICKHOUSE_PORT_INTERSERVER
}
</interserver_http_port></yandex>"
>
/etc/clickhouse-server/config.d/port.xml
[
"
${
TEST_
PORT_RANDOM
}
"
]
&&
echo
"<yandex><http_port>
${
CLICKHOUSE_PORT_HTTP
}
</http_port><tcp_port>
${
CLICKHOUSE_PORT_TCP
}
</tcp_port><interserver_http_port>
${
CLICKHOUSE_PORT_INTERSERVER
}
</interserver_http_port></yandex>"
>
/etc/clickhouse-server/config.d/port.xml
if
[
"
${
TEST_SSL
}
"
]
;
then
if
[
"
${
TEST_SSL
}
"
]
;
then
[
"
${
PORT_RANDOM
}
"
]
&&
echo
"<yandex><https_port>
${
CLICKHOUSE_PORT_HTTPS
}
</https_port><tcp_port_secure>
${
CLICKHOUSE_PORT_TCP_SECURE
}
</tcp_port_secure></yandex>"
>
/etc/clickhouse-server/config.d/ssl.xml
[
"
${
TEST_
PORT_RANDOM
}
"
]
&&
echo
"<yandex><https_port>
${
CLICKHOUSE_PORT_HTTPS
}
</https_port><tcp_port_secure>
${
CLICKHOUSE_PORT_TCP_SECURE
}
</tcp_port_secure></yandex>"
>
/etc/clickhouse-server/config.d/ssl.xml
echo
"<yandex><openSSL><client><verificationMode>none</verificationMode><invalidCertificateHandler><name>AcceptCertificateHandler</name></invalidCertificateHandler></client></openSSL></yandex>"
>
/etc/clickhouse-client/config.d/ssl.xml
echo
"<yandex><openSSL><client><verificationMode>none</verificationMode><invalidCertificateHandler><name>AcceptCertificateHandler</name></invalidCertificateHandler></client></openSSL></yandex>"
>
/etc/clickhouse-client/config.d/ssl.xml
openssl dhparam
-out
/etc/clickhouse-server/dhparam.pem 256
openssl dhparam
-out
/etc/clickhouse-server/dhparam.pem 256
openssl req
-subj
"/CN=localhost"
-new
-newkey
rsa:2048
-days
365
-nodes
-x509
-keyout
/etc/clickhouse-server/server.key
-out
/etc/clickhouse-server/server.crt
openssl req
-subj
"/CN=localhost"
-new
-newkey
rsa:2048
-days
365
-nodes
-x509
-keyout
/etc/clickhouse-server/server.key
-out
/etc/clickhouse-server/server.crt
...
...
utils/travis/normal.sh
浏览文件 @
895b8e65
...
@@ -37,6 +37,6 @@ cmake $CUR_DIR/../.. -DCMAKE_CXX_COMPILER=`which $DEB_CXX $CXX` -DCMAKE_C_COMPIL
...
@@ -37,6 +37,6 @@ cmake $CUR_DIR/../.. -DCMAKE_CXX_COMPILER=`which $DEB_CXX $CXX` -DCMAKE_C_COMPIL
`
# Skip tests:` \
`
# Skip tests:` \
`
# 00281 requires internal compiler` \
`
# 00281 requires internal compiler` \
`
# 00428 requires sudo (not all vms allow this)` \
`
# 00428 requires sudo (not all vms allow this)` \
&&
(
[
!
${
TEST_RUN
=1
}
]
||
(
(
cd
$CUR_DIR
/../..
&&
env
TEST_OPT
=
"--skip long compile 00428
$TEST_OPT
"
TEST_PERF
=
bash
-x
dbms/tests/clickhouse-test-server
)
||
${
TEST_TRUE
=false
}
)
)
&&
(
[
!
${
TEST_RUN
=1
}
]
||
(
(
cd
$CUR_DIR
/../..
&&
env
TEST_OPT
=
"--skip long compile 00428
$TEST_OPT
"
TEST_P
ORT_RANDOM
=
TEST_P
ERF
=
bash
-x
dbms/tests/clickhouse-test-server
)
||
${
TEST_TRUE
=false
}
)
)
date
date
utils/travis/pbuilder.sh
浏览文件 @
895b8e65
...
@@ -12,6 +12,7 @@ df -h
...
@@ -12,6 +12,7 @@ df -h
date
date
env
TEST_RUN
=
${
TEST_RUN
=1
}
\
env
TEST_RUN
=
${
TEST_RUN
=1
}
\
TEST_PORT_RANDOM
=
\
`
# Skip tests:` \
`
# Skip tests:` \
`
# 00281 requires internal compiler` \
`
# 00281 requires internal compiler` \
`
# 00416 requires patched poco from contrib/` \
`
# 00416 requires patched poco from contrib/` \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录