Unverified Commit 452afcbc authored by Tim Smith's avatar Tim Smith Committed by GitHub

Merge pull request #157 from Rudikza/fixing_spec_tests_travis

Fixes spec tests locally and on travis-ci
parents ff941f4c 7a8ac09d
...@@ -2,7 +2,6 @@ driver: ...@@ -2,7 +2,6 @@ driver:
name: dokken name: dokken
privileged: true # because Docker and SystemD/Upstart privileged: true # because Docker and SystemD/Upstart
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
chef_license: accept-no-persist
transport: transport:
name: dokken name: dokken
...@@ -10,6 +9,7 @@ transport: ...@@ -10,6 +9,7 @@ transport:
provisioner: provisioner:
name: dokken name: dokken
deprecations_as_errors: true deprecations_as_errors: true
chef_license: accept-no-persist
verifier: verifier:
name: inspec name: inspec
......
...@@ -41,7 +41,7 @@ describe 'rsyslog::client' do ...@@ -41,7 +41,7 @@ describe 'rsyslog::client' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z') do |node| ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11') do |node|
node.normal['rsyslog']['server_ip'] = server_ip node.normal['rsyslog']['server_ip'] = server_ip
node.normal['rsyslog']['custom_remote'] = custom_remote node.normal['rsyslog']['custom_remote'] = custom_remote
end.converge(described_recipe) end.converge(described_recipe)
...@@ -84,7 +84,7 @@ describe 'rsyslog::client' do ...@@ -84,7 +84,7 @@ describe 'rsyslog::client' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z') do |node| ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11') do |node|
node.normal['rsyslog']['server_ip'] = server_ip node.normal['rsyslog']['server_ip'] = server_ip
end.converge(described_recipe) end.converge(described_recipe)
end end
......
...@@ -60,7 +60,7 @@ describe 'rsyslog::default' do ...@@ -60,7 +60,7 @@ describe 'rsyslog::default' do
it 'exits fatally' do it 'exits fatally' do
expect do expect do
chef_run chef_run
end.to raise_error end.to raise_error(RuntimeError)
end end
end end
end end
...@@ -84,7 +84,7 @@ describe 'rsyslog::default' do ...@@ -84,7 +84,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z').converge(described_recipe) ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11').converge(described_recipe)
end end
let(:directory) { chef_run.directory('/opt/local/etc/rsyslog.d') } let(:directory) { chef_run.directory('/opt/local/etc/rsyslog.d') }
...@@ -150,7 +150,7 @@ describe 'rsyslog::default' do ...@@ -150,7 +150,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z').converge(described_recipe) ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11').converge(described_recipe)
end end
let(:template) { chef_run.template('/opt/local/etc/rsyslog.conf') } let(:template) { chef_run.template('/opt/local/etc/rsyslog.conf') }
...@@ -203,7 +203,7 @@ describe 'rsyslog::default' do ...@@ -203,7 +203,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z').converge(described_recipe) ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11').converge(described_recipe)
end end
let(:template) { chef_run.template('/opt/local/etc/rsyslog.d/50-default.conf') } let(:template) { chef_run.template('/opt/local/etc/rsyslog.d/50-default.conf') }
...@@ -253,35 +253,12 @@ describe 'rsyslog::default' do ...@@ -253,35 +253,12 @@ describe 'rsyslog::default' do
end end
context 'system-log service' do context 'system-log service' do
{ 'omnios' => '151018', 'smartos' => 'joyent_20130111T180733Z' }.each do |p, pv|
let(:chef_run) do
ChefSpec::ServerRunner.new(platform: p, version: pv).converge(described_recipe)
end
it "stops the system-log service on #{p}" do
expect(chef_run).to disable_service('system-log')
end
end
end
context 'on OmniOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'omnios', version: '151018').converge(described_recipe) ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11').converge(described_recipe)
end
let(:template) { chef_run.template('/var/svc/manifest/system/rsyslogd.xml') }
let(:execute) { chef_run.execute('import rsyslog manifest') }
it 'creates the custom SMF manifest' do
expect(chef_run).to render_file(template.path)
end
it 'notifies svccfg to import the manifest' do
expect(template).to notify('execute[import rsyslog manifest]').to(:run)
end end
it 'notifies rsyslog to restart when importing the manifest' do it "stops the system-log service on #{p}" do
expect(execute).to notify('service[system/rsyslogd]').to(:restart) expect(chef_run).to disable_service('system-log')
end end
end end
......
...@@ -56,7 +56,7 @@ describe 'rsyslog::server' do ...@@ -56,7 +56,7 @@ describe 'rsyslog::server' do
context 'on SmartOS' do context 'on SmartOS' do
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z') do |node| ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11') do |node|
node.normal['rsyslog']['server'] = false node.normal['rsyslog']['server'] = false
end.converge(described_recipe) end.converge(described_recipe)
end end
...@@ -103,7 +103,7 @@ describe 'rsyslog::server' do ...@@ -103,7 +103,7 @@ describe 'rsyslog::server' do
end end
let(:chef_run) do let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'smartos', version: 'joyent_20130111T180733Z') do |node| ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11') do |node|
node.normal['rsyslog']['server'] = false node.normal['rsyslog']['server'] = false
end.converge(described_recipe) end.converge(described_recipe)
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment