---
language: ruby
-rvm:
- - 1.8.7
- - 1.9.2
- - 1.9.3
script: rake spec
notifications:
email: false
gemfile:
- gemfiles/gemfile.ci
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
+env:
+ # Latest 2.7.x & Facter 1.6.x
+ - BUILD_PUPPET_VER=2.7.14 BUILD_FACTER_VER=1.6.9
+ # Latest 2.6.x & Facter 1.6.x
+ - BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.9
+
+ # Mageia 2
+ - BUILD_PUPPET_VER=2.7.11 BUILD_FACTER_VER=1.6.6
+ # Ubuntu 12.04
+ - BUILD_PUPPET_VER=2.7.11 BUILD_FACTER_VER=1.6.5
+ # openSUSE 12.1
+ - BUILD_PUPPET_VER=2.7.6 BUILD_FACTER_VER=1.6.0
+ # Ubuntu 11.10 & Mandriva 2011 Contrib
+ - BUILD_PUPPET_VER=2.7.1 BUILD_FACTER_VER=1.5.9
+
+ # RHEL 5/6 EPEL
+ - BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.6
+ # Mageia 1
+ - BUILD_PUPPET_VER=2.6.8 BUILD_FACTER_VER=1.5.8
+ # Ubuntu 11.04 & openSUSE 11.4
+ - BUILD_PUPPET_VER=2.6.4 BUILD_FACTER_VER=1.5.8
+ # Debian 6 Main & Mandriva 2010 Contrib Backports
+ - BUILD_PUPPET_VER=2.6.2 BUILD_FACTER_VER=1.5.7
+matrix:
+ exclude:
+ # Puppet 2.6.x is not compatible with Ruby 1.9.x
+ - rvm: 1.9.2
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.9
+ - rvm: 1.9.3
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.9
+ - rvm: 1.9.2
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.6
+ - rvm: 1.9.3
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.16 BUILD_FACTER_VER=1.6.6
+ - rvm: 1.9.2
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.8 BUILD_FACTER_VER=1.5.8
+ - rvm: 1.9.3
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.8 BUILD_FACTER_VER=1.5.8
+ - rvm: 1.9.2
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.4 BUILD_FACTER_VER=1.5.8
+ - rvm: 1.9.3
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.4 BUILD_FACTER_VER=1.5.8
+ - rvm: 1.9.2
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.2 BUILD_FACTER_VER=1.5.7
+ - rvm: 1.9.3
+ gemfile: gemfiles/gemfile.ci
+ env: BUILD_PUPPET_VER=2.6.2 BUILD_FACTER_VER=1.5.7
source 'http://rubygems.org'
-# These are the base gems that facter requires for CI testing. This is a
-# duplicate of what the Puppetlabs Jenkins environment was running at the
-# time this file was created.
-gem 'rspec', '2.9.0'
-gem 'rspec-core', '2.9.0'
-gem 'rspec-expectations', '2.9.0'
-gem 'rspec-mocks', '2.9.0'
-gem 'rake', '0.8.7'
-gem 'mocha', '0.10.5'
+gem 'rspec', '2.10.0'
+gem 'rspec-core', '2.10.1'
+gem 'rspec-expectations', '2.10.0'
+gem 'rspec-mocks', '2.10.1'
+gem 'rake', '0.9.2.2'
+gem 'mocha', '0.11.4'
gem 'diff-lcs', '1.1.3'
-gem 'puppet', '2.7.6'
-gem 'facter', '1.6.3'
+gem 'puppet', ENV['BUILD_PUPPET_VER']
+gem 'facter', ENV['BUILD_FACTER_VER']
# States should always be sorted. This normalizes the resource states to
# keep it consistent with the sorted result from iptables-save.
def should=(values)
- @should = super(values).sort
+ @should = super(values).sort_by {|sym| sym.to_s}
end
def is_to_s(value)
Puppet.settings.clear
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
- Puppet::Util::ExecutionStub.reset
+ if Puppet::Util.const_defined?("ExecutionStub")
+ Puppet::Util::ExecutionStub.reset
+ end
PuppetSpec::Files.cleanup
})
resource.provider.class.to_s.should == "Puppet::Type::Firewall::ProviderIptables"
end
-
- it "should raise a default provider error when there are no commands" do
- # Stub all commands lookups so they return nothing
- exists.any_instance.stubs(:which).returns false
-
- # Instantiate a resource instance and make sure it raises an exception
- lambda { resource = Puppet::Type.type(:firewall).new({
- :name => '000 test foo' }) }.should raise_error(Puppet::DevError,
- "Could not find a default provider for firewall")
- end
end
describe 'iptables provider' do
# If this option is enabled, make sure the parameters exactly match
if data[:compare_all] then
it "the parameter hash keys should be the same as returned by rules_to_hash" do
- resource.keys.sort.should == data[:params].keys.sort
+ resource.keys.should =~ data[:params].keys
end
end