Skip to content

Commit

Permalink
Refs #29215: Add RHEL 8 to metadata and run tests on all OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed May 7, 2020
1 parent 7c447e6 commit b22fea0
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 87 deletions.
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
Expand Down
32 changes: 18 additions & 14 deletions spec/classes/certs_apache_spec.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
require 'spec_helper'

describe 'certs::apache' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

describe 'with default parameters' do
it { should compile.with_all_deps }
end
describe 'with default parameters' do
it { should compile.with_all_deps }
end

describe "with group overridden" do
let :pre_condition do
"class {'certs': group => 'foreman',}"
end
describe "with group overridden" do
let :pre_condition do
"class {'certs': group => 'foreman',}"
end

it { should compile.with_all_deps }
it { should compile.with_all_deps }

it do
is_expected.to contain_certs__keypair('apache')
.with_key_group('foreman')
it do
is_expected.to contain_certs__keypair('apache')
.with_key_group('foreman')
end
end
end
end
end
14 changes: 9 additions & 5 deletions spec/classes/certs_candlepin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require 'spec_helper'

describe 'certs::candlepin' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

describe 'with default parameters' do
it { should compile.with_all_deps }
describe 'with default parameters' do
it { should compile.with_all_deps }
end
end
end
end
34 changes: 19 additions & 15 deletions spec/classes/certs_foreman_proxy_content_spec.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
require 'spec_helper'

describe 'certs::foreman_proxy_content' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

describe 'with default parameters' do
let :params do
{
certs_tar: '/tmp/tar',
foreman_proxy_fqdn: 'bar.example.com'
}
end
describe 'with default parameters' do
let :params do
{
certs_tar: '/tmp/tar',
foreman_proxy_fqdn: 'bar.example.com'
}
end

it { should compile.with_all_deps }
end
it { should compile.with_all_deps }
end

context 'with empty certs_tar' do
let(:params) { { certs_tar: '' } }
context 'with empty certs_tar' do
let(:params) { { certs_tar: '' } }

it { should compile.and_raise_error(/\'certs_tar\' expects a Stdlib::Absolutepath/) }
it { should compile.and_raise_error(/\'certs_tar\' expects a Stdlib::Absolutepath/) }
end
end
end
end
14 changes: 9 additions & 5 deletions spec/classes/certs_foreman_proxy_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require 'spec_helper'

describe 'certs::foreman_proxy' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

describe 'with default parameters' do
it { should compile.with_all_deps }
describe 'with default parameters' do
it { should compile.with_all_deps }
end
end
end
end
40 changes: 22 additions & 18 deletions spec/classes/certs_katello_spec.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
require 'spec_helper'

describe 'certs::katello' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

context 'with parameters' do
let :pre_condition do
"class {'certs': pki_dir => '/tmp', server_ca_name => 'server_ca', default_ca_name => 'default_ca'}"
end
context 'with parameters' do
let :pre_condition do
"class {'certs': pki_dir => '/tmp', server_ca_name => 'server_ca', default_ca_name => 'default_ca'}"
end

it { should contain_trusted_ca__ca('katello_server-host-cert').with_source('/tmp/certs/server_ca.crt') }
it { should contain_trusted_ca__ca('katello_server-host-cert').with_source('/tmp/certs/server_ca.crt') }

it do
should contain_certs_bootstrap_rpm('katello-ca-consumer-foo.example.com')
.with_dir('/var/www/html/pub')
.with_summary('Subscription-manager consumer certificate for Katello instance foo.example.com')
.with_description('Consumer certificate and post installation script that configures rhsm.')
.with_files(['/usr/bin/katello-rhsm-consumer:755=/var/www/html/pub/katello-rhsm-consumer'])
.with_bootstrap_script('/bin/bash /usr/bin/katello-rhsm-consumer')
.with_postun_script("if [ $1 -eq 0 ]; then\ntest -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf\nfi\n")
.with_alias('katello-ca-consumer-latest.noarch.rpm')
.that_subscribes_to(['Ca[server_ca]', 'Certs::Rhsm_reconfigure_script[/var/www/html/pub/katello-rhsm-consumer]'])
it do
should contain_certs_bootstrap_rpm('katello-ca-consumer-foo.example.com')
.with_dir('/var/www/html/pub')
.with_summary('Subscription-manager consumer certificate for Katello instance foo.example.com')
.with_description('Consumer certificate and post installation script that configures rhsm.')
.with_files(['/usr/bin/katello-rhsm-consumer:755=/var/www/html/pub/katello-rhsm-consumer'])
.with_bootstrap_script('/bin/bash /usr/bin/katello-rhsm-consumer')
.with_postun_script("if [ $1 -eq 0 ]; then\ntest -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf\nfi\n")
.with_alias('katello-ca-consumer-latest.noarch.rpm')
.that_subscribes_to(['Ca[server_ca]', 'Certs::Rhsm_reconfigure_script[/var/www/html/pub/katello-rhsm-consumer]'])
end
end
end
end
end
14 changes: 9 additions & 5 deletions spec/classes/certs_pulp_client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require 'spec_helper'

describe 'certs::pulp_client' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

describe 'with default parameters' do
it { should compile.with_all_deps }
describe 'with default parameters' do
it { should compile.with_all_deps }
end
end
end
end
18 changes: 13 additions & 5 deletions spec/classes/certs_puppet_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
require 'spec_helper'

describe 'certs::puppet' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

let :facts do
on_supported_os['redhat-7-x86_64']
end

describe 'with default parameters' do
it { should compile.with_all_deps }
describe 'with default parameters' do
it { should compile.with_all_deps }
end
end
end
end
8 changes: 5 additions & 3 deletions spec/classes/certs_qpid_client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
require 'spec_helper'

describe 'certs::qpid_client' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do facts end
on_supported_os.each do |os, os_facts|
context "on #{os}", if: os_facts[:operatingsystemmajrelease] == '7' do
let :facts do
os_facts
end

describe "with default parameters" do
it { is_expected.to compile.with_all_deps }
Expand Down
14 changes: 9 additions & 5 deletions spec/classes/certs_qpid_router_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require 'spec_helper'

describe 'certs::qpid_router' do
let :facts do
on_supported_os['redhat-7-x86_64']
end
on_supported_os.each do |os, os_facts|
context "on #{os}", if: os_facts[:operatingsystemmajrelease] == '7' do
let :facts do
os_facts
end

describe 'with default parameters' do
it { should compile.with_all_deps }
describe 'with default parameters' do
it { should compile.with_all_deps }
end
end
end
end
6 changes: 3 additions & 3 deletions spec/classes/certs_qpid_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'spec_helper'

describe 'certs::qpid' do
on_supported_os.each do |os, facts|
context "on #{os}" do
on_supported_os.each do |os, os_facts|
context "on #{os}", if: os_facts[:operatingsystemmajrelease] == '7' do
let :facts do
facts
os_facts
end

describe "with default parameters" do
Expand Down
16 changes: 8 additions & 8 deletions spec/classes/certs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require 'spec_helper'

describe 'certs' do

context 'on redhat' do
let :facts do
on_supported_os['redhat-7-x86_64']
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

it { should contain_class('certs::install') }
it { should contain_class('certs::config') }
end

it { should contain_class('certs::install') }
it { should contain_class('certs::config') }
end

end

0 comments on commit b22fea0

Please sign in to comment.