Skip to content

Commit

Permalink
Add tests for setting redis_service_name
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWittman committed Jul 12, 2016
1 parent 84c32d9 commit 6a8adca
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 18 deletions.
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ suites:
- name: logfile
- name: sentinel
- name: checksum
- name: service-name
29 changes: 12 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
GEM
remote: https://rubygems.org/
specs:
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
highline (1.7.8)
kitchen-ansible (0.0.39)
librarian-ansible
artifactory (2.3.3)
kitchen-ansible (0.44.6)
net-ssh (~> 3.0)
test-kitchen (~> 1.4)
kitchen-vagrant (0.19.0)
kitchen-vagrant (0.20.0)
test-kitchen (~> 1.4)
librarian (0.1.2)
highline
thor (~> 0.15)
librarian-ansible (3.0.0)
faraday
librarian (~> 0.1.0)
mixlib-install (0.7.1)
mixlib-install (1.1.0)
artifactory
mixlib-shellout
mixlib-versioning
mixlib-shellout (2.2.6)
multipart-post (2.0.0)
mixlib-versioning (1.1.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.1.0)
net-ssh (3.2.0)
safe_yaml (1.0.4)
test-kitchen (1.6.0)
mixlib-install (~> 0.7)
test-kitchen (1.10.2)
mixlib-install (~> 1.0, >= 1.0.4)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (>= 2.9, < 4.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ redis_repl_backlog_size: false
redis_logfile: '""'
# Enable syslog. "yes" or "no"
redis_syslog_enabled: "yes"
redis_syslog_ident: {{ redis_service_name }}
redis_syslog_ident: "{{ redis_service_name }}"
# Syslog facility. Must be USER or LOCAL0-LOCAL7
redis_syslog_facility: USER
Expand Down
5 changes: 5 additions & 0 deletions test/integration/service-name/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
roles:
- role: ansible-redis
redis_service_name: redis
29 changes: 29 additions & 0 deletions test/integration/service-name/serverspec/redis_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'spec_helper'

describe 'Redis' do
describe service('redis') do
it { should be_enabled }
it { should be_running }
end

describe port(6379) do
it { should be_listening.on('0.0.0.0').with('tcp') }
end

describe file('/etc/redis/6379.conf') do
it { should be_file }
it { should be_owned_by 'redis' }
its(:content) { should match /port 6379/ }
end

describe file('/var/run/redis/6379.pid') do
it { should be_file }
it { should be_owned_by 'redis' }
its(:size) { should > 0 }
end

describe file('/proc/sys/vm/overcommit_memory') do
it { should be_file }
it { should contain '1' }
end
end
2 changes: 2 additions & 0 deletions test/integration/service-name/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'serverspec'
set :backend, :exec

0 comments on commit 6a8adca

Please sign in to comment.