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:
name: dokken
privileged: true # because Docker and SystemD/Upstart
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
chef_license: accept-no-persist
transport:
name: dokken
......@@ -10,6 +9,7 @@ transport:
provisioner:
name: dokken
deprecations_as_errors: true
chef_license: accept-no-persist
verifier:
name: inspec
......
......@@ -41,7 +41,7 @@ describe 'rsyslog::client' do
context 'on SmartOS' 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']['custom_remote'] = custom_remote
end.converge(described_recipe)
......@@ -84,7 +84,7 @@ describe 'rsyslog::client' do
context 'on SmartOS' 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
end.converge(described_recipe)
end
......
......@@ -60,7 +60,7 @@ describe 'rsyslog::default' do
it 'exits fatally' do
expect do
chef_run
end.to raise_error
end.to raise_error(RuntimeError)
end
end
end
......@@ -84,7 +84,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' 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
let(:directory) { chef_run.directory('/opt/local/etc/rsyslog.d') }
......@@ -150,7 +150,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' 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
let(:template) { chef_run.template('/opt/local/etc/rsyslog.conf') }
......@@ -203,7 +203,7 @@ describe 'rsyslog::default' do
context 'on SmartOS' 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
let(:template) { chef_run.template('/opt/local/etc/rsyslog.d/50-default.conf') }
......@@ -253,35 +253,12 @@ describe 'rsyslog::default' do
end
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
ChefSpec::ServerRunner.new(platform: 'omnios', version: '151018').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)
ChefSpec::ServerRunner.new(platform: 'smartos', version: '5.11').converge(described_recipe)
end
it 'notifies rsyslog to restart when importing the manifest' do
expect(execute).to notify('service[system/rsyslogd]').to(:restart)
it "stops the system-log service on #{p}" do
expect(chef_run).to disable_service('system-log')
end
end
......
......@@ -56,7 +56,7 @@ describe 'rsyslog::server' do
context 'on SmartOS' 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
end.converge(described_recipe)
end
......@@ -103,7 +103,7 @@ describe 'rsyslog::server' do
end
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
end.converge(described_recipe)
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