require 'spec_helper'

describe 'pacemaker::new::setup', type: :class do
  on_supported_os.each do |os, facts|
    context "on #{os}" do
      let(:facts) { facts }

      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::setup') }

        it { is_expected.to contain_class('pacemaker::new::setup::auth_key') }

        if facts[:osfamily] == 'Debian'
          it { is_expected.to contain_class('pacemaker::new::setup::debian') }
        end

        release = facts[:operatingsystemrelease].split('.')
        major = release.first
        minor = release.last

        if facts[:osfamily] == 'RedHat' and ( (major == '7') or (minor == '6' and major.to_i >= 6) )
          it { is_expected.to contain_class('pacemaker::new::setup::pcsd') }
        else
          it { is_expected.to contain_class('pacemaker::new::setup::config') }
        end

      end

    end
  end
end

require 'spec_helper'

describe 'pacemaker::new::setup', type: :class do
  on_supported_os.each do |os, facts|
    context "on #{os}" do
      let(:facts) { facts }

      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::setup') }

        it { is_expected.to contain_class('pacemaker::new::setup::auth_key') }

        if facts[:osfamily] == 'Debian'
          it { is_expected.to contain_class('pacemaker::new::setup::debian') }
        end

        release = facts[:operatingsystemrelease].split('.')
        major = release.first
        minor = release.last

        if facts[:osfamily] == 'RedHat' and ( (major == '8') or (major == '7') or (minor == '6' and major.to_i >= 6) )
          it { is_expected.to contain_class('pacemaker::new::setup::pcsd') }
        else
          it { is_expected.to contain_class('pacemaker::new::setup::config') }
        end

      end

    end
  end
end

Fix CI for new centos8 + puppet6
Fix CI for new centos8 + puppet6

Currently broken with:
 pacemaker::new::setup on centos-8-x86_64 with default parameters is expected to contain Class[pacemaker::new::setup::config]

  Failure/Error: it { is_expected.to contain_class('pacemaker::new::setup::config') }
    expected that the catalogue would contain Class[pacemaker::new::setup::config]
     ./spec/classes/pacemaker_setup_spec.rb:29:in `block (5 levels) in <top (required)>'

Change-Id: Ie85521f1f1c1591a07b6e1a7b31ebb98b0e20e73
