Skip to content

Commit

Permalink
(spec) use os_facts "ruby" var to avoid shadowing facts "rspec" var
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 16, 2023
1 parent 5f85527 commit a333e34
Show file tree
Hide file tree
Showing 181 changed files with 518 additions and 524 deletions.
4 changes: 2 additions & 2 deletions spec/classes/archive/commmon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::archive::common' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }
let(:pre_condition) do
<<~PP
# change service unit name from sssd.service to sssd
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/archive/data/auxtel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::archive::data::auxtel' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/archive/data/comcam_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::archive::data::comcam' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/archive/data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::archive::data' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/ccs/common_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::ccs::common' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts.merge(site: 'ls') }
let(:facts) { override_facts(os_facts, site: 'ls') }
let(:pre_condition) do
<<~PP
include ssh
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/ccs/el9_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
require 'spec_helper'

describe 'profile::ccs::el9' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
next unless os =~ %r{almalinux-9-x86_64}

context "on #{os}" do
let(:facts) { facts.merge(site: 'ls') }
let(:facts) { override_facts(os_facts, site: 'ls') }
let(:pre_condition) do
<<~PP
include ssh
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/ccs/file_transfer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::ccs::file_transfer' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with param install => true' do
let(:params) do
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/ccs/graphical_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::ccs::graphical' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }
let(:unwanted_pkgs) do
%w[
gnome-initial-setup
Expand All @@ -22,9 +22,9 @@

it { is_expected.to compile.with_all_deps }

include_examples 'x2go packages', facts: facts
include_examples 'x2go packages', os_facts: os_facts

if facts[:os]['release']['major'] == '7'
if os_facts[:os]['release']['major'] == '7'
it do
unwanted_pkgs.each do |pkg|
is_expected.to contain_yum__group('GNOME Desktop').with(
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/ccs/sal_dx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::ccs::sal_dx' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with no params' do
it { is_expected.to compile.with_all_deps }
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/bash_completion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
require 'spec_helper'

describe 'profile::core::bash_completion' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

include_examples 'bash_completion', facts: facts
include_examples 'bash_completion', os_facts: os_facts
end
end
end
4 changes: 2 additions & 2 deletions spec/classes/core/ca_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::ca' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('ca-certificates').with_ensure('latest') }
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/common_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::common' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }
let(:pre_condition) do
<<~PP
# change service unit name from sssd.service to sssd
Expand All @@ -22,7 +22,7 @@ class { 'sssd': service_names => ['sssd'] }
it { is_expected.to contain_class('profile::core::nm_dispatch') }
it { is_expected.to contain_package('ca-certificates').with_ensure('latest') }

if facts[:os]['release']['major'] == '7'
if os_facts[:os]['release']['major'] == '7'
it { is_expected.to contain_class('network') }
else
it { is_expected.not_to contain_class('network') }
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/convenience_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::convenience' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/debugutils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::debugutils' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::docker' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand All @@ -24,7 +24,7 @@
.that_notifies('Service[docker]')
end

if facts[:os]['release']['major'] == '9'
if os_facts[:os]['release']['major'] == '9'
it do
is_expected.to contain_systemd__dropin_file('ceph.conf').with(
unit: 'containerd.service',
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/dtn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::dtn' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/firewall_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::firewall' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('firewall') }
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/foreman/fog_hack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::foreman::fog_hack' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::foreman' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }
let(:params) { { smee_url: 'https://foo.example.org' } }

it { is_expected.to compile.with_all_deps }
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/hardware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# XXX testing for classes in the catalog is not a great practice but it is
# expendent to do here as the goal is primary to test branching based on facts.
describe 'profile::core::hardware' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with PowerEdge' do
let(:facts) do
Expand Down Expand Up @@ -53,7 +53,7 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('ipmi') }

if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7')
if (os_facts[:os]['family'] == 'RedHat') && (os_facts[:os]['release']['major'] == '7')
it { is_expected.to contain_class('profile::core::kernel::pcie_aspm') }
it { is_expected.to contain_class('profile::core::kernel::nvme_apst') }

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/ipa_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::ipa' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with no params' do
it { is_expected.to compile.with_all_deps }
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/core/kernel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::kernel' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with no params' do
it { is_expected.to compile.with_all_deps }
Expand Down
6 changes: 2 additions & 4 deletions spec/classes/core/keytab_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
require 'spec_helper'

describe 'profile::core::keytab' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) do
facts
end
let(:facts) { os_facts }

context 'with no parameters' do
it { is_expected.to compile.with_all_deps }
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/krb5_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
require 'spec_helper'

describe 'profile::core::krb5' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with no params' do
it { is_expected.to compile.with_all_deps }

include_examples 'krb5.conf.d files', facts: facts
include_examples 'krb5.conf.d files', os_facts: os_facts
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/letsencrypt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'spec_helper'

describe 'profile::core::letsencrypt' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

context 'with no params' do
it { is_expected.to compile.with_all_deps }
Expand All @@ -25,7 +25,7 @@

it { is_expected.to contain_package('python-s3transfer') }

if facts[:os]['name'] == 'CentOS'
if os_facts[:os]['name'] == 'CentOS'
it { is_expected.to contain_package('python2-futures.noarch') }
end

Expand Down
6 changes: 3 additions & 3 deletions spec/classes/core/lhnrouting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
require 'spec_helper'

describe 'profile::core::lhnrouting' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { facts }
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

if facts[:os]['release']['major'] == '7'
if os_facts[:os]['release']['major'] == '7'
it { is_expected.to contain_kmod__load('dummy') }

it do
Expand Down
Loading

0 comments on commit a333e34

Please sign in to comment.