From 9a8351180182094393b2e15720b5234b3fd35ddd Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Sat, 23 Jul 2016 20:23:56 +0100 Subject: [PATCH] Templates with shield tested --- .../helpers/serverspec/xpack_spec.rb | 17 +++++++++++++++++ test/integration/xpack.yml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/integration/helpers/serverspec/xpack_spec.rb b/test/integration/helpers/serverspec/xpack_spec.rb index 268dcb7..0e9809a 100644 --- a/test/integration/helpers/serverspec/xpack_spec.rb +++ b/test/integration/helpers/serverspec/xpack_spec.rb @@ -141,6 +141,23 @@ shared_examples 'xpack::init' do |es_version| its(:exit_status) { should eq 0 } end + describe file('/etc/elasticsearch/templates') do + it { should be_directory } + it { should be_owned_by 'elasticsearch' } + end + + describe file('/etc/elasticsearch/templates/basic.json') do + it { should be_file } + it { should be_owned_by 'elasticsearch' } + end + + describe 'Template Installed' do + it 'should be reported as being installed', :retry => 3, :retry_wait => 10 do + command = command('curl -s "localhost:9200/_template/basic" -u es_admin:changeMe') + expect(command.stdout).to match(/basic/) + expect(command.exit_status).to eq(0) + end + end #Test contents of Elasticsearch.yml file end diff --git a/test/integration/xpack.yml b/test/integration/xpack.yml index 2c6dbcb..f927ce8 100644 --- a/test/integration/xpack.yml +++ b/test/integration/xpack.yml @@ -4,7 +4,7 @@ roles: - { role: elasticsearch, es_config: { "http.port": 9200, "transport.tcp.port":9300, discovery.zen.ping.unicast.hosts: "localhost:9300" }, es_instance_name: "shield_node" } vars: - es_templates: false + es_templates: true es_enable_xpack: true es_xpack_features: - shield