2018-01-09 20:20:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-02-09 15:46:30 +00:00
|
|
|
set -e
|
2018-01-09 20:20:13 +00:00
|
|
|
set -x
|
|
|
|
|
|
|
|
for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do
|
2018-03-14 05:29:05 +00:00
|
|
|
apt-get install -y --force-yes "$PKG" || true
|
|
|
|
apt-get remove -y "$PKG" || true
|
2018-01-09 20:20:13 +00:00
|
|
|
done
|
|
|
|
|
2018-04-10 18:25:08 +00:00
|
|
|
dpkg --auto-deconfigure -i /tmp/buildd/*.deb || true
|
|
|
|
apt install -y -f --allow-downgrades || true
|
|
|
|
dpkg -l | grep clickhouse || true
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-01-10 11:48:32 +00:00
|
|
|
# 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
|
|
|
|
|
2018-03-14 16:57:15 +00:00
|
|
|
mkdir -p /etc/clickhouse-server/config.d /etc/clickhouse-client/config.d
|
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
TEST_CONNECT=${TEST_CONNECT=1}
|
|
|
|
if [ "${TEST_CONNECT}" ]; then
|
2018-03-14 23:04:35 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
TEST_SSL=${TEST_SSL=1}
|
|
|
|
if [ "${TEST_SSL}" ]; then
|
2018-03-29 01:41:06 +00:00
|
|
|
echo "<yandex><https_port>8443</https_port><tcp_port_secure>9440</tcp_port_secure></yandex>" > /etc/clickhouse-server/config.d/ssl.xml
|
2018-03-20 17:24:39 +00:00
|
|
|
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
|
2018-03-29 01:41:06 +00:00
|
|
|
CLIENT_ADD="--secure"
|
2018-03-20 17:24:39 +00:00
|
|
|
fi
|
2018-01-10 11:48:32 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
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
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
service clickhouse-server start
|
|
|
|
sleep 3
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
# TODO: remove me or make only on error:
|
|
|
|
tail -n100 /var/log/clickhouse-server/*
|
2018-01-10 11:48:32 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
clickhouse-client -q "SELECT * from system.build_options;"
|
|
|
|
clickhouse-client ${CLIENT_ADD} -q "SELECT toDateTime(1);"
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
( [ "${TEST_RUN}" ] && clickhouse-test --queries /usr/share/clickhouse-test/queries --tmp /tmp/clickhouse-test/ ${TEST_OPT} ) || ${TEST_TRUE:=true}
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
service clickhouse-server stop
|
2018-01-09 20:20:13 +00:00
|
|
|
|
2018-03-20 17:24:39 +00:00
|
|
|
fi
|
2018-01-15 18:57:10 +00:00
|
|
|
|
|
|
|
# Test debug symbols
|
2018-02-07 15:58:48 +00:00
|
|
|
# gdb -ex quit --args /usr/bin/clickhouse-server
|