1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/sh
set -e
# Configure and start elasticsearch
echo "START_DAEMON=true" >> /etc/default/elasticsearch
echo 'path.repo: ["/tmp"]' >> /etc/elasticsearch/elasticsearch.yml
echo "Restarting Elasticsearch"
invoke-rc.d --quiet elasticsearch restart
# Wait until ES is up
tries=0
echo -n "Waiting for Elasticsearch to initialize"
while ! curl -s -XGET 'http://localhost:9200/_cluster/health' >/dev/null; do
echo -n "."
tries=$(($tries + 1))
if [ $tries -gt 45 ]; then
echo
echo "Timed out waiting for elasticsearch to initialize"
exit 1
fi
sleep 1;
done
echo " done."
echo "Running tests"
# Run as the 'elasticsearch' user to ensure that the FS repo directories
# created by the tests will be accessible by ES.
cd test && su -s /bin/sh -c ./run_tests.py elasticsearch
|