This repository was archived by the owner on Feb 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +38
-40
lines changed
Expand file tree Collapse file tree 3 files changed +38
-40
lines changed Original file line number Diff line number Diff line change 1313 case $::osfamily {
1414 ' RedHat' : {
1515 case $::operatingsystem {
16- ' RedHat' : {
16+ ' Fedora' : {
17+ $sx_fs_mount = ' /sys/fs/selinux'
18+ $package_name = ' policycoreutils-python'
19+ }
20+ default: {
1721 case $::operatingsystemmajrelease {
1822 ' 7' : {
1923 $sx_fs_mount = ' /sys/fs/selinux'
3236 }
3337 }
3438 }
35- ' Fedora' : {
36- $sx_fs_mount = ' /sys/fs/selinux'
37- $package_name = ' policycoreutils-python'
38- }
39- default: {
40- fail(" ${::operatingsystem} is not supported" )
41- }
4239 }
4340 }
4441 default: {
Original file line number Diff line number Diff line change 11require 'spec_helper'
22
33describe 'selinux' do
4- context 'Redhat 7' do
5- include_context 'RedHat 7'
4+ [
5+ 'RedHat 7' ,
6+ 'CentOS 7' ,
7+ 'Fedora 22' ,
8+ ] . each do |ctx |
9+ context ctx do
10+ include_context ctx
611
7- it { should contain_class ( 'selinux::package' ) }
8- it { should contain_class ( 'selinux::config' ) }
9- end
10-
11- context 'Fedora 22' do
12- include_context 'Fedora 22'
13-
14- it { should contain_class ( 'selinux::package' ) }
15- it { should contain_class ( 'selinux::config' ) }
12+ it { should contain_class ( 'selinux::package' ) }
13+ it { should contain_class ( 'selinux::config' ) }
14+ end
1615 end
1716end
Original file line number Diff line number Diff line change 11require 'rubygems' if RUBY_VERSION < '1.9.0'
22require 'puppetlabs_spec_helper/module_spec_helper'
33
4+ facts = {
5+ :osfamily => 'RedHat' ,
6+ :operatingsystem => 'RedHat' ,
7+ :operatingsystemmajrelease => '7' ,
8+ :selinux_current_mode => 'enforcing' ,
9+ # concat facts
10+ :concat_basedir => '/tmp' ,
11+ :id => 0 ,
12+ :is_pe => false ,
13+ :path => '/tmp' ,
14+ }
15+
416shared_context 'RedHat 7' do
17+ let ( :facts ) { facts }
18+ end
19+
20+ shared_context 'CentOS 7' do
521 let ( :facts ) do
6- {
7- :osfamily => 'RedHat' ,
8- :operatingsystem => 'RedHat' ,
9- :operatingsystemmajrelease => '7' ,
10- :selinux_current_mode => 'enforcing' ,
11- # concat facts
12- :concat_basedir => '/tmp' ,
13- :id => 0 ,
14- :is_pe => false ,
15- :path => '/tmp' ,
16- }
22+ facts . dup . merge (
23+ :operatingsystem => 'CentOS' ,
24+ :operatingsystemmajrelease => '7'
25+ )
1726 end
1827end
1928
2029shared_context 'Fedora 22' do
2130 let ( :facts ) do
22- {
23- :osfamily => 'RedHat' ,
31+ facts . dup . merge (
2432 :operatingsystem => 'Fedora' ,
25- :operatingsystemmajrelease => '22' ,
26- :selinux_current_mode => 'enforcing' ,
27- # concat facts
28- :concat_basedir => '/tmp' ,
29- :id => 0 ,
30- :is_pe => false ,
31- :path => '/tmp' ,
32- }
33+ :operatingsystemmajrelease => '22'
34+ )
3335 end
3436end
You can’t perform that action at this time.
0 commit comments