AIX exits with 2 on file doesn't exist.

This commit is contained in:
Hunter Haugen 2014-02-26 13:14:19 -08:00
parent 5e841a91f7
commit 17a59b2b13
3 changed files with 31 additions and 29 deletions

View file

@ -2,16 +2,16 @@ require 'spec_helper_acceptance'
describe 'ini_setting resource' do
after :all do
shell("rm /tmp/*.ini", :acceptable_exit_codes => [0,1])
shell("rm /tmp/*.ini", :acceptable_exit_codes => [0,1,2])
end
shared_examples 'has_content' do |path,pp,content|
before :all do
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
after :all do
shell("cat #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("cat #{path}", :acceptable_exit_codes => [0,1,2])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
it 'applies the manifest twice with no stderr' do
@ -27,11 +27,11 @@ describe 'ini_setting resource' do
shared_examples 'has_error' do |path,pp,error|
before :all do
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
after :all do
shell("cat #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("cat #{path}", :acceptable_exit_codes => [0,1,2])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
it 'applies the manifest and gets a failure message' do
@ -106,8 +106,8 @@ describe 'ini_setting resource' do
shell('echo -e "four = five\n[one]\ntwo = three" > /tmp/ini_setting.ini')
end
after :all do
shell("cat /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1])
shell("rm /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1])
shell("cat /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
shell("rm /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
end
pp = <<-EOS
@ -136,8 +136,8 @@ describe 'ini_setting resource' do
shell('echo -e "four = five\n[one]\ntwo = three" > /tmp/ini_setting.ini')
end
after :all do
shell("cat /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1])
shell("rm /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1])
shell("cat /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
shell("rm /tmp/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
end
pp = <<-EOS

View file

@ -2,16 +2,16 @@ require 'spec_helper_acceptance'
describe 'ini_subsetting resource' do
after :all do
shell("rm /tmp/*.ini", :acceptable_exit_codes => [0,1])
shell("rm /tmp/*.ini", :acceptable_exit_codes => [0,1,2])
end
shared_examples 'has_content' do |path,pp,content|
before :all do
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
after :all do
shell("cat #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("cat #{path}", :acceptable_exit_codes => [0,1,2])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
it 'applies the manifest twice with no stderr' do
@ -27,11 +27,11 @@ describe 'ini_subsetting resource' do
shared_examples 'has_error' do |path,pp,error|
before :all do
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
after :all do
shell("cat #{path}", :acceptable_exit_codes => [0,1])
shell("rm #{path}", :acceptable_exit_codes => [0,1])
shell("cat #{path}", :acceptable_exit_codes => [0,1,2])
shell("rm #{path}", :acceptable_exit_codes => [0,1,2])
end
it 'applies the manifest and gets a failure message' do

View file

@ -1,17 +1,19 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
hosts.each do |host|
if host['platform'] =~ /debian/
on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
end
if host.is_pe?
install_pe
else
# Install Puppet
install_package host, 'rubygems'
on host, 'gem install puppet --no-ri --no-rdoc'
on host, "mkdir -p #{host['distmoduledir']}"
unless ENV['RS_PROVISION'] == 'no'
hosts.each do |host|
if host['platform'] =~ /debian/
on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
end
if host.is_pe?
install_pe
else
# Install Puppet
install_package host, 'rubygems'
on host, 'gem install puppet --no-ri --no-rdoc'
on host, "mkdir -p #{host['distmoduledir']}"
end
end
end