From cc387c084353a420deaabd4277aa5b147f5f37e7 Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Tue, 21 Jun 2016 08:16:05 -0400 Subject: [PATCH] refs #15217 - puppet 4 support --- .travis.yml | 21 ++++++++++- metadata.json | 2 +- spec/classes/capsule_spec.rb | 72 ++++++++++++++---------------------- 3 files changed, 49 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ed90189..46424bf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,30 @@ # This file is managed centrally by modulesync # https://github.com/katello/foreman-installer-modulesync rvm: - - 1.8.7 - 1.9.3 - 2.0.0 - 2.1.5 env: - PUPPET_VERSION=3.5 + - PUPPET_VERSION=3.5 FUTURE_PARSER=yes + - PUPPET_VERSION=4.0 +matrix: + fast_finish: true + exclude: + # No support for Ruby 1.9.3 on Puppet 4.x + - rvm: 1.9.3 + env: PUPPET_VERSION=4.0 + include: + # Only platforms left to support ruby 1.8.7 + - rvm: 1.8.7 + env: PUPPET_VERSION=3.5 + - rvm: 1.8.7 + env: PUPPET_VERSION=3.5 FUTURE_PARSER=yes + # Only Puppet 4.x supports Ruby 2.2. Also limit the OS set we test Ruby 2.2 with. + - rvm: 2.2.3 + env: PUPPET_VERSION=4.0 + # Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with. + - rvm: 2.3.0 + env: PUPPET_VERSION=4.4 bundler_args: --without development sudo: false diff --git a/metadata.json b/metadata.json index 63275e3d..ecb0036c 100644 --- a/metadata.json +++ b/metadata.json @@ -56,7 +56,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 3.2.0 < 4.0.0" + "version_requirement": ">= 3.2.0 < 5.0.0" } ], "operatingsystem_support": [ diff --git a/spec/classes/capsule_spec.rb b/spec/classes/capsule_spec.rb index f82ec25d..d45adedf 100644 --- a/spec/classes/capsule_spec.rb +++ b/spec/classes/capsule_spec.rb @@ -1,50 +1,34 @@ require 'spec_helper' describe 'capsule' do - - context 'on redhat' do - let :facts do - { - :concat_basedir => '/tmp', - :operatingsystem => 'RedHat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :osfamily => 'RedHat', - } - end - - it { should contain_package('katello-debug') } - it { should contain_package('katello-client-bootstrap') } - end - - context 'with pulp' do - let :facts do - { - :concat_basedir => '/tmp', - :operatingsystem => 'RedHat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :osfamily => 'RedHat', - } - end - - let(:params) do - { - :pulp_oauth_secret => 'mysecret', - :qpid_router => false - } - end - - let(:pre_condition) do - "class {'foreman_proxy::plugin::pulp': pulpnode_enabled => true} - class {'apache': apache_version => '2.4'}" + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge(:concat_basedir => '/tmp', :mongodb_version => '2.4.14') + end + + it { should contain_package('katello-debug') } + it { should contain_package('katello-client-bootstrap') } + + context 'with pulp' do + let(:params) do + { + :pulp_oauth_secret => 'mysecret', + :qpid_router => false + } + end + + let(:pre_condition) do + "class {'foreman_proxy::plugin::pulp': pulpnode_enabled => true} + class {'apache': apache_version => '2.4'}" + end + + it { should contain_class('crane').with( {'key' => '/etc/pki/katello/private/katello-apache.key', + 'cert' => '/etc/pki/katello/certs/katello-apache.crt'} ) } + + it { should contain_pulp__apache__fragment('gpg_key_proxy').with({ + :ssl_content => %r{ProxyPass /katello/api/repositories/}} ) } + end end - - it { should contain_class('crane').with( {'key' => '/etc/pki/katello/private/katello-apache.key', - 'cert' => '/etc/pki/katello/certs/katello-apache.crt'} ) } - - it { should contain_pulp__apache__fragment('gpg_key_proxy').with({ - :ssl_content => %r{ProxyPass /katello/api/repositories/}} ) } end - end