Skip some tests for Ubuntu 18.04 and puppet 4.8.

We already had an issue and we fixed it with an hack[1]. Puppet would
assign runit service provider for Ubuntu.  runit being the fallback
when nothing else match.

As a matter of fact puppet doesn't properly detect Ubuntu 18.04
systemd usage before puppet 5.  For instance here the code for the 4.x
branch[2]:

    defaultfor :operatingsystem => :ubuntu, :operatingsystemmajrelease => ["15.04","15.10","16.04","16.10","17.04","17.10"]

So let's get rid of those tests for 4.8 and Ubuntu 18.04.

I only test < 5 as the first maintained branch is 5.3 and has the
support for Ubuntu 18.04 services.

[1] https://bugs.launchpad.net/puppet-pacemaker/+bug/1783302
[2] https://github.com/puppetlabs/puppet/blob/4.10.x/lib/puppet/provider/service/systemd.rb#L28

Change-Id: I9828b9a837c652fdc87131a84c73591c4e84d387
Closes-Bug: #1802140
This commit is contained in:
Sofer Athlan-Guyot 2018-11-07 17:44:24 +01:00 committed by Sofer Athlan-Guyot
parent b7c38e2cf3
commit fafb72f488
2 changed files with 56 additions and 51 deletions

View File

@ -3,48 +3,51 @@ require 'spec_helper'
describe 'pacemaker::new::service', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
# Work around a puppet-spec issue
# https://github.com/rodjek/rspec-puppet/issues/629
let(:facts) do
facts.merge({initsystem: 'systemd'})
end
let(:facts) { facts }
if facts[:operatingsystem] == 'Ubuntu' \
and facts[:operatingsystemmajrelease] == '18.04' \
and facts[:puppetversion].split('.')[0].to_i < 5
it "is unsuported" do
skip "Puppet service provider supports Ubuntu 18.04 from version >=5 (got #{facts[:puppetversion]})"
end
else
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new::service') }
it { is_expected.to contain_class('pacemaker::new::service') }
it { is_expected.to contain_service('corosync') }
it { is_expected.to contain_service('corosync') }
it { is_expected.to contain_service('pacemaker') }
it { is_expected.to contain_service('pacemaker') }
it { is_expected.to contain_service('pcsd') }
end
it { is_expected.to contain_service('pcsd') }
end
context 'with service manage disabled' do
let(:params) do
{
context 'with service manage disabled' do
let(:params) do
{
:corosync_manage => false,
:pacemaker_manage => false,
:pcsd_manage => false,
}
}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new::service') }
it { is_expected.not_to contain_service('corosync') }
it { is_expected.not_to contain_service('pacemaker') }
it { is_expected.not_to contain_service('pcsd') }
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new::service') }
it { is_expected.not_to contain_service('corosync') }
it { is_expected.not_to contain_service('pacemaker') }
it { is_expected.not_to contain_service('pcsd') }
end
end
end
end

View File

@ -3,28 +3,30 @@ require 'spec_helper'
describe 'pacemaker::new', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
# Work around a puppet-spec issue
# https://github.com/rodjek/rspec-puppet/issues/629
let(:facts) do
facts.merge({initsystem: 'systemd'})
let(:facts) { facts }
if facts[:operatingsystem] == 'Ubuntu' and \
facts[:operatingsystemmajrelease] == '18.04' and \
facts[:puppetversion].split('.')[0].to_i < 5
it "is unsuported" do
skip "Puppet service provider supports Ubuntu 18.04 from version >=5 (got #{facts[:puppetversion]})"
end
else
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new') }
it { is_expected.to contain_class('pacemaker::new::firewall') }
it { is_expected.to contain_class('pacemaker::new::install') }
it { is_expected.to contain_class('pacemaker::new::setup') }
it { is_expected.to contain_class('pacemaker::new::service') }
end
end
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pacemaker::new::params') }
it { is_expected.to contain_class('pacemaker::new') }
it { is_expected.to contain_class('pacemaker::new::firewall') }
it { is_expected.to contain_class('pacemaker::new::install') }
it { is_expected.to contain_class('pacemaker::new::setup') }
it { is_expected.to contain_class('pacemaker::new::service') }
end
end
end
end