Skip to content

Commit 6d6b3e4

Browse files
committed
Merge pull request elastic#17 from electrical/testing
Initial commit for acceptance testing
2 parents 4480946 + f5a5fed commit 6d6b3e4

File tree

7 files changed

+100
-0
lines changed

7 files changed

+100
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.kitchen/
2+
.kitchen.local.yml
3+
*.lock
4+
.vendor
5+
.bundle
6+
Converging

.kitchen.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
driver:
3+
name: docker
4+
5+
provisioner:
6+
name: ansible_playbook
7+
hosts: localhost
8+
roles_path: ../
9+
require_ansible_repo: true
10+
ansible_verbose: true
11+
12+
platforms:
13+
- name: ubuntu-14.04
14+
driver_config:
15+
image: electrical/ubuntu:14.04
16+
privileged: true
17+
provision_command: apt-get -y -q install ansible python-apt python-pycurl ruby
18+
- name: debian-7
19+
driver_config:
20+
image: electrical/debian:7.3
21+
privileged: true
22+
provision_command:
23+
- echo 'deb http://http.debian.net/debian/ wheezy-backports main' >> /etc/apt/sources.list
24+
- apt-get update
25+
- apt-get install -y -q ansible ruby
26+
- name: debian-8
27+
driver_config:
28+
image: electrical/debian:8
29+
privileged: true
30+
provision_command: apt-get -y -q install ansible ruby
31+
- name: centos-6
32+
driver_config:
33+
image: electrical/centos:6.4
34+
privileged: true
35+
- name: centos-7
36+
driver_config:
37+
image: electrical/centos:7
38+
provision_command:
39+
- sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
40+
- sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
41+
privileged: true
42+
43+
verifier:
44+
ruby_bindir: '/usr/bin'
45+
46+
suites:
47+
- name: default
48+
run_list:
49+
attributes:

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'test-kitchen'
4+
gem "kitchen-docker"
5+
gem 'kitchen-ansible'

test/integration/default.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- name: wrapper playbook for kitchen testing "elasticsearch"
3+
hosts: localhost
4+
roles:
5+
- elasticsearch
6+
vars:
7+
es_plugins:
8+
- plugin: lmenezes/elasticsearch-kopf
9+
version: master

test/integration/default/default.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
- host: test-kitchen
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'spec_helper'
2+
3+
context "basic tests" do
4+
5+
describe user('elasticsearch') do
6+
it { should exist }
7+
end
8+
9+
describe service('elasticsearch') do
10+
it { should be_running }
11+
end
12+
13+
describe package('elasticsearch') do
14+
it { should be_installed }
15+
end
16+
17+
describe file('/etc/elasticsearch/elasticsearch.yml') do
18+
it { should be_file }
19+
end
20+
21+
describe command('curl localhost:9200/_nodes/?plugin | grep kopf') do
22+
its(:stdout) { should match /kopf/ }
23+
its(:exit_status) { should eq 0 }
24+
end
25+
26+
end
27+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'serverspec'
2+
set :backend, :exec

0 commit comments

Comments
 (0)