Skip to content

Commit

Permalink
switch to stringified facts
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Aug 3, 2024
1 parent 115af3f commit 0e0fc28
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
spec/spec_helper.rb:
mock_with: ':mocha'
facterdb_string_keys: true
.puppet-lint.rc:
disabled_lint_checks:
- anchor_resource
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/selinux_config_mode_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
context "on #{os}" do
context 'when in enforcing mode' do
let(:facts) do
override_facts(os_facts, os: { selinux: {
override_facts(os_facts, 'os' => { 'selinux' => {
'enabled' => true,
'enforced' => true,
'config_mode' => 'enforcing',
Expand Down Expand Up @@ -68,15 +68,15 @@
let(:facts) do
# Get a deep copy and then fully override the selinux facts
result = override_facts(os_facts)
result[:os]['selinux'] = { 'enabled' => false }
result['os']['selinux'] = { 'enabled' => false }
result
end

%w[permissive enforcing].each do |target_mode|
context "and requesting #{target_mode} mode" do
let(:params) { { mode: target_mode } }

if os_facts[:osfamily] == 'Debian'
if os_facts['os']['family'] == 'Debian'
it { is_expected.to contain_exec('activate-selinux') }
else
it { is_expected.not_to contain_exec('activate-selinux') }
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/selinux_boolean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

context 'SELinux enabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: true } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => true } })
end

['on', true, 'present'].each do |value|
Expand Down Expand Up @@ -56,7 +56,7 @@

context 'SELinux disabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: false } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => false } })
end

['on', true, 'present'].each do |value|
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/selinux_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

context 'SELinux enabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: true } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => true } })
end

context 'ordering' do
Expand Down Expand Up @@ -201,7 +201,7 @@

context 'SELinux disabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: false } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => false } })
end

context 'make sure it compiles' do
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/selinux_permissive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

context 'SELinux enabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: true } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => true } })
end

context 'ensure selinux_permissive oddjob_mkhomedir_t is present' do
Expand Down Expand Up @@ -54,7 +54,7 @@

context 'SELinux disabled' do
let(:facts) do
override_facts(super(), os: { selinux: { enabled: false } })
override_facts(super(), 'os' => { 'selinux' => { 'enabled' => false } })
end

context 'make sure it compiles' do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require 'voxpupuli/test/spec_helper'

RSpec.configure do |c|
c.facterdb_string_keys = false
c.facterdb_string_keys = true
c.mock_with :mocha
end

Expand Down

0 comments on commit 0e0fc28

Please sign in to comment.