Browse Source

Merge pull request #80 from hunner/fix_aix

AIX exits with 2 on file doesn't exist.
Ashley Penney 10 years ago
parent
commit
d17dcfbe96

+ 11 - 11
spec/acceptance/ini_setting_spec.rb

@@ -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

+ 7 - 7
spec/acceptance/ini_subsetting_spec.rb

@@ -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

+ 13 - 11
spec/spec_helper_acceptance.rb

@@ -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