summaryrefslogtreecommitdiff
path: root/qa/vagrant
diff options
context:
space:
mode:
authorTanguy Leroux <tlrx.dev@gmail.com>2016-11-23 11:59:36 +0100
committerGitHub <noreply@github.com>2016-11-23 11:59:36 +0100
commit67f02363cebf1f6cb3e18fd5beea27ebc8d2a605 (patch)
tree35ad2750bd9d76f6f30858f10fbb1bd23d2cd13b /qa/vagrant
parent10a945ae72fadeb6e83946efeab6df7a82068f05 (diff)
Update packaging tests after lang-groovy removal (#21748)
The packaging tests must be adapted since 'lang-groovy' has been removed from master.
Diffstat (limited to 'qa/vagrant')
-rw-r--r--qa/vagrant/src/test/resources/packaging/tests/example/scripts/is_guide.painless6
-rw-r--r--qa/vagrant/src/test/resources/packaging/utils/utils.bash17
2 files changed, 18 insertions, 5 deletions
diff --git a/qa/vagrant/src/test/resources/packaging/tests/example/scripts/is_guide.painless b/qa/vagrant/src/test/resources/packaging/tests/example/scripts/is_guide.painless
index d19029afd4..f07435eaf6 100644
--- a/qa/vagrant/src/test/resources/packaging/tests/example/scripts/is_guide.painless
+++ b/qa/vagrant/src/test/resources/packaging/tests/example/scripts/is_guide.painless
@@ -1 +1,5 @@
-_source['title'] == 'Elasticsearch - The Definitive Guide'
+def min = 300;
+if (params.min_num_pages != null) {
+ min = params.min_num_pages;
+}
+return doc['pages'].value >= min;
diff --git a/qa/vagrant/src/test/resources/packaging/utils/utils.bash b/qa/vagrant/src/test/resources/packaging/utils/utils.bash
index 7fb742b438..7b22692281 100644
--- a/qa/vagrant/src/test/resources/packaging/utils/utils.bash
+++ b/qa/vagrant/src/test/resources/packaging/utils/utils.bash
@@ -482,22 +482,31 @@ run_elasticsearch_tests() {
echo "$output" | grep -w "green"
curl -s -XPOST 'http://localhost:9200/library/book/1?refresh=true&pretty' -d '{
- "title": "Elasticsearch - The Definitive Guide"
+ "title": "Book #1",
+ "pages": 123
+ }'
+
+ curl -s -XPOST 'http://localhost:9200/library/book/2?refresh=true&pretty' -d '{
+ "title": "Book #2",
+ "pages": 456
}'
curl -s -XGET 'http://localhost:9200/_count?pretty' |
- grep \"count\"\ :\ 1
+ grep \"count\"\ :\ 2
curl -s -XPOST 'http://localhost:9200/library/book/_count?pretty' -d '{
"query": {
"script": {
"script": {
"file": "is_guide",
- "lang": "painless"
+ "lang": "painless",
+ "params": {
+ "min_num_pages": 100
+ }
}
}
}
- }' | grep \"count\"\ :\ 1
+ }' | grep \"count\"\ :\ 2
curl -s -XGET 'http://localhost:9200/library/book/_search/template?pretty' -d '{
"file": "is_guide"