mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 12:22:12 +00:00
71 lines
3.0 KiB
Bash
Executable File
71 lines
3.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
kill_clickhouse () {
|
|
echo "clickhouse pids" `ps aux | grep clickhouse` | ts '%Y-%m-%d %H:%M:%S'
|
|
kill `pgrep -u clickhouse` 2>/dev/null
|
|
|
|
for i in {1..10}
|
|
do
|
|
if ! kill -0 `pgrep -u clickhouse`; then
|
|
echo "No clickhouse process" | ts '%Y-%m-%d %H:%M:%S'
|
|
break
|
|
else
|
|
echo "Process" `pgrep -u clickhouse` "still alive" | ts '%Y-%m-%d %H:%M:%S'
|
|
sleep 10
|
|
fi
|
|
done
|
|
}
|
|
|
|
start_clickhouse () {
|
|
LLVM_PROFILE_FILE='server_%h_%p_%m.profraw' sudo -Eu clickhouse /usr/bin/clickhouse-server --config /etc/clickhouse-server/config.xml &
|
|
}
|
|
|
|
chmod 777 /
|
|
|
|
dpkg -i package_folder/clickhouse-common-static_*.deb; \
|
|
dpkg -i package_folder/clickhouse-common-static-dbg_*.deb; \
|
|
dpkg -i package_folder/clickhouse-server_*.deb; \
|
|
dpkg -i package_folder/clickhouse-client_*.deb; \
|
|
dpkg -i package_folder/clickhouse-test_*.deb
|
|
|
|
|
|
mkdir -p /var/lib/clickhouse
|
|
mkdir -p /var/log/clickhouse-server
|
|
chmod 777 -R /var/lib/clickhouse
|
|
chmod 777 -R /var/log/clickhouse-server/
|
|
|
|
ln -s /usr/share/clickhouse-test/config/zookeeper.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/listen.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/part_log.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/text_log.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/metric_log.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/query_masking_rules.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/log_queries.xml /etc/clickhouse-server/users.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/readonly.xml /etc/clickhouse-server/users.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/ints_dictionary.xml /etc/clickhouse-server/; \
|
|
ln -s /usr/share/clickhouse-test/config/strings_dictionary.xml /etc/clickhouse-server/; \
|
|
ln -s /usr/share/clickhouse-test/config/decimals_dictionary.xml /etc/clickhouse-server/; \
|
|
ln -s /usr/share/clickhouse-test/config/macros.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/disks.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/secure_ports.xml /etc/clickhouse-server/config.d/; \
|
|
ln -s /usr/share/clickhouse-test/config/server.key /etc/clickhouse-server/; \
|
|
ln -s /usr/share/clickhouse-test/config/server.crt /etc/clickhouse-server/; \
|
|
ln -s /usr/share/clickhouse-test/config/dhparam.pem /etc/clickhouse-server/; \
|
|
ln -sf /usr/share/clickhouse-test/config/client_config.xml /etc/clickhouse-client/config.xml; \
|
|
ln -s /usr/lib/llvm-8/bin/llvm-symbolizer /usr/bin/llvm-symbolizer
|
|
|
|
service zookeeper start
|
|
sleep 5
|
|
|
|
start_clickhouse
|
|
|
|
sleep 10
|
|
|
|
LLVM_PROFILE_FILE='client_coverage.profraw' clickhouse-test --testname --shard --zookeeper $ADDITIONAL_OPTIONS $SKIP_TESTS_OPTION 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee test_output/test_result.txt
|
|
|
|
kill_clickhouse
|
|
|
|
sleep 3
|
|
|
|
cp /*.profraw /profraw ||:
|