@@ -18,6 +18,7 @@ trap finish EXIT
18
18
19
19
setup_es () {
20
20
download_url=$1
21
+ xpack_download_url=$2
21
22
if [[ ! -d elasticsearch ]]; then
22
23
curl -sL $download_url > elasticsearch.tar.gz
23
24
mkdir elasticsearch
@@ -30,7 +31,12 @@ setup_es() {
30
31
31
32
# If we're running with xpack SSL/Users enabled...
32
33
if [[ " $SECURE_INTEGRATION " == " true" ]]; then
33
- yes y | elasticsearch/bin/elasticsearch-plugin install x-pack
34
+ if [[ " $xpack_download_url " == " " ]]; then
35
+ yes y | elasticsearch/bin/elasticsearch-plugin install x-pack
36
+ else
37
+ curl -sL $xpack_download_url > elasticsearch/xpack.zip
38
+ yes y | elasticsearch/bin/elasticsearch-plugin install file://$BUILD_DIR /elasticsearch/xpack.zip
39
+ fi
34
40
35
41
es_yml=elasticsearch/config/elasticsearch.yml
36
42
cp -rv $BUILD_DIR /spec/fixtures/test_certs elasticsearch/config/test_certs
@@ -49,6 +55,9 @@ start_es() {
49
55
es_url=" http://localhost:9200"
50
56
if [[ " $SECURE_INTEGRATION " == " true" ]]; then
51
57
es_url=" https://localhost:9200 -k"
58
+
59
+ elasticsearch/bin/x-pack/users useradd simpleuser -p abc123 -r superuser
60
+ elasticsearch/bin/x-pack/users useradd ' f@ncyuser' -p ' ab%12#' -r superuser
52
61
fi
53
62
54
63
while ! curl --silent $es_url && [[ $count -ne 0 ]]; do
@@ -58,28 +67,6 @@ start_es() {
58
67
done
59
68
echo " Elasticsearch is Up !"
60
69
61
- if [[ " $SECURE_INTEGRATION " == " true" ]]; then
62
- curl -XPUT -k ' https://elastic:changeme@localhost:9200/_xpack/security/user/elastic/_password' -H " Content-Type: application/json" -d ' {
63
- "password" : "testpass"
64
- }'
65
-
66
- # These are the two users used for secure integration tests
67
- curl -XPOST -k ' https://elastic:testpass@localhost:9200/_xpack/security/user/simpleuser' -H " Content-Type: application/json" -d ' {
68
- "password" : "abc123",
69
- "full_name" : "John Doe",
70
- "email" : "john.doe@anony.mous",
71
- "roles" : [ "superuser" ]
72
- }'
73
-
74
- curl -XPOST -k ' https://elastic:testpass@localhost:9200/_xpack/security/user/f%40ncyuser' -H " Content-Type: application/json" -d ' {
75
- "password" : "ab%12#",
76
- "full_name" : "John Doe",
77
- "email" : "john.doe@anony.mous",
78
- "roles" : [ "superuser" ]
79
- }'
80
-
81
- fi
82
-
83
70
return 0
84
71
}
85
72
@@ -128,6 +115,12 @@ else
128
115
fi
129
116
130
117
case " $ES_VERSION " in
118
+ 6.* )
119
+ setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION} -SNAPSHOT.tar.gz https://snapshots.elastic.co/downloads/packs/x-pack/x-pack-$ES_VERSION -SNAPSHOT.zip
120
+ start_es
121
+ # Run all tests which are for versions > 5 but don't run ones tagged < 5.x. Include ingest, new template
122
+ bundle exec rspec -fd $extra_tag_args --tag version_greater_than_equal_to_5x --tag update_tests:painless --tag update_tests:groovy --tag ~ version_less_than_5x $spec_path
123
+ ;;
131
124
5.* )
132
125
setup_es https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION} .tar.gz
133
126
start_es -Escript.inline=true -Escript.stored=true -Escript.file=true
0 commit comments