mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
a6f9df105c
* Allow use encryption for distributed tables * wip * fix * rename encryption to secure * Fix DirectoryMonitor with +secure * fix * fix * Update DirectoryMonitor.cpp * Update DirectoryMonitor.cpp
59 lines
2.0 KiB
Bash
Executable File
59 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
set -x
|
|
|
|
for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do
|
|
apt-get install -y --force-yes "$PKG" || true
|
|
apt-get remove -y "$PKG" || true
|
|
done
|
|
|
|
dpkg -i /tmp/buildd/*.deb || true
|
|
apt install -y -f --allow-downgrades
|
|
|
|
|
|
# Some test references uses specific timezone
|
|
ln -fs /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
|
echo 'Europe/Moscow' > /etc/timezone
|
|
dpkg-reconfigure -f noninteractive tzdata
|
|
|
|
mkdir -p /etc/clickhouse-server/config.d /etc/clickhouse-client/config.d
|
|
|
|
TEST_CONNECT=${TEST_CONNECT=1}
|
|
if [ "${TEST_CONNECT}" ]; then
|
|
|
|
TEST_SSL=${TEST_SSL=1}
|
|
if [ "${TEST_SSL}" ]; then
|
|
echo "<yandex><https_port>8443</https_port><tcp_port_secure>9440</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
|
|
|
|
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
|
|
CLIENT_ADD="--secure"
|
|
fi
|
|
|
|
function finish {
|
|
service clickhouse-server stop
|
|
tail -n 100 /var/log/clickhouse-server/*
|
|
sleep 1
|
|
killall -9 clickhouse-server || true
|
|
}
|
|
trap finish EXIT SIGINT SIGQUIT SIGTERM
|
|
|
|
service clickhouse-server start
|
|
sleep 3
|
|
|
|
# TODO: remove me or make only on error:
|
|
tail -n100 /var/log/clickhouse-server/*
|
|
|
|
clickhouse-client -q "SELECT * from system.build_options;"
|
|
clickhouse-client ${CLIENT_ADD} -q "SELECT toDateTime(1);"
|
|
|
|
( [ "${TEST_RUN}" ] && clickhouse-test --queries /usr/share/clickhouse-test/queries --tmp /tmp/clickhouse-test/ ${TEST_OPT} ) || ${TEST_TRUE:=true}
|
|
|
|
service clickhouse-server stop
|
|
|
|
fi
|
|
|
|
# Test debug symbols
|
|
# gdb -ex quit --args /usr/bin/clickhouse-server
|