[Python-modules-commits] [elasticsearch-curator] 02/02: Add DEP-8 tests

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Fri Oct 30 09:30:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository elasticsearch-curator.

commit 7c5c64b68ec4fc60455fb235c8d63c99c685b81a
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Fri Oct 30 10:30:17 2015 +0200

    Add DEP-8 tests
    
    Run upstream's test suite as DEP-8 tests against a real ES instance.
    Depend on elasticsearch and enforce the following restrictions:
    
     - isolation-container: we need to have a clean networking environment
       for elasticsearch to operate.
     - breaks-testbed: tests modify/delete elasticsearch data.
     - needs-root: we need to be able to (re-)start elasticsearch.
     - allow-stderr: the tests emit various harmless messages in stderr.
---
 debian/tests/control | 17 +++++++++++++++++
 debian/tests/curator | 30 ++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..5628064
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,17 @@
+Tests: curator
+Restrictions: needs-root,
+              allow-stderr,
+              breaks-testbed,
+              isolation-container
+Depends: elasticsearch,
+         curl,
+         python-elasticsearch-curator,
+         python-mock,
+         python-nose,
+         python-coverage,
+         python-nosexcover,
+         python3-elasticsearch-curator,
+         python3-mock,
+         python3-nose,
+         python3-coverage,
+         python3-nosexcover
diff --git a/debian/tests/curator b/debian/tests/curator
new file mode 100755
index 0000000..4b2ef46
--- /dev/null
+++ b/debian/tests/curator
@@ -0,0 +1,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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/elasticsearch-curator.git



More information about the Python-modules-commits mailing list