Merge pull request #17 from electrical/testing
Initial commit for acceptance testing
This commit is contained in:
commit
6d6b3e4efb
7 changed files with 100 additions and 0 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
.kitchen/
|
||||
.kitchen.local.yml
|
||||
*.lock
|
||||
.vendor
|
||||
.bundle
|
||||
Converging
|
||||
49
.kitchen.yml
Normal file
49
.kitchen.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
driver:
|
||||
name: docker
|
||||
|
||||
provisioner:
|
||||
name: ansible_playbook
|
||||
hosts: localhost
|
||||
roles_path: ../
|
||||
require_ansible_repo: true
|
||||
ansible_verbose: true
|
||||
|
||||
platforms:
|
||||
- name: ubuntu-14.04
|
||||
driver_config:
|
||||
image: electrical/ubuntu:14.04
|
||||
privileged: true
|
||||
provision_command: apt-get -y -q install ansible python-apt python-pycurl ruby
|
||||
- name: debian-7
|
||||
driver_config:
|
||||
image: electrical/debian:7.3
|
||||
privileged: true
|
||||
provision_command:
|
||||
- echo 'deb http://http.debian.net/debian/ wheezy-backports main' >> /etc/apt/sources.list
|
||||
- apt-get update
|
||||
- apt-get install -y -q ansible ruby
|
||||
- name: debian-8
|
||||
driver_config:
|
||||
image: electrical/debian:8
|
||||
privileged: true
|
||||
provision_command: apt-get -y -q install ansible ruby
|
||||
- name: centos-6
|
||||
driver_config:
|
||||
image: electrical/centos:6.4
|
||||
privileged: true
|
||||
- name: centos-7
|
||||
driver_config:
|
||||
image: electrical/centos:7
|
||||
provision_command:
|
||||
- sed -ri 's/^#?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
- sed -ri 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
||||
privileged: true
|
||||
|
||||
verifier:
|
||||
ruby_bindir: '/usr/bin'
|
||||
|
||||
suites:
|
||||
- name: default
|
||||
run_list:
|
||||
attributes:
|
||||
5
Gemfile
Normal file
5
Gemfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'test-kitchen'
|
||||
gem "kitchen-docker"
|
||||
gem 'kitchen-ansible'
|
||||
9
test/integration/default.yml
Normal file
9
test/integration/default.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: wrapper playbook for kitchen testing "elasticsearch"
|
||||
hosts: localhost
|
||||
roles:
|
||||
- elasticsearch
|
||||
vars:
|
||||
es_plugins:
|
||||
- plugin: lmenezes/elasticsearch-kopf
|
||||
version: master
|
||||
2
test/integration/default/default.yaml
Normal file
2
test/integration/default/default.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- host: test-kitchen
|
||||
27
test/integration/default/serverspec/default_spec.rb
Normal file
27
test/integration/default/serverspec/default_spec.rb
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
require 'spec_helper'
|
||||
|
||||
context "basic tests" do
|
||||
|
||||
describe user('elasticsearch') do
|
||||
it { should exist }
|
||||
end
|
||||
|
||||
describe service('elasticsearch') do
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
describe package('elasticsearch') do
|
||||
it { should be_installed }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should be_file }
|
||||
end
|
||||
|
||||
describe command('curl localhost:9200/_nodes/?plugin | grep kopf') do
|
||||
its(:stdout) { should match /kopf/ }
|
||||
its(:exit_status) { should eq 0 }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
2
test/integration/default/serverspec/spec_helper.rb
Normal file
2
test/integration/default/serverspec/spec_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require 'serverspec'
|
||||
set :backend, :exec
|
||||
Loading…
Add table
Add a link
Reference in a new issue