Skip to content

Commit

Permalink
Merge pull request #216 from oranenj/tmp_dir
Browse files Browse the repository at this point in the history
Ensure the module build tmp/ directory is actually a directory
  • Loading branch information
dhollinger authored May 4, 2017
2 parents 394ddfa + 094a47b commit 0942937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
force => true,
}

# created by refpolicy builder and our simple builder
# ensure it does not get purged
file {"${module_build_dir}/tmp": selinux_ignore_defaults => true }
# needed by refpolicy builder and our simple builder
file {"${module_build_dir}/tmp":
ensure => 'directory',
selinux_ignore_defaults => true,
}
}
4 changes: 4 additions & 0 deletions spec/classes/selinux_config_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
it { is_expected.to have_exec_resource_count(0) }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules/tmp').with_ensure('directory') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/bin/selinux_build_module_simple.sh') }
it { is_expected.not_to contain_file_line('set-selinux-config-type-to-targeted') }
it { is_expected.not_to contain_file_line('set-selinux-config-type-to-minimum') }
Expand All @@ -27,6 +28,7 @@

it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules/tmp').with_ensure('directory') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/bin/selinux_build_module_simple.sh') }
it { is_expected.to contain_file_line('set-selinux-config-type-to-targeted').with(line: 'SELINUXTYPE=targeted') }
end
Expand All @@ -35,6 +37,7 @@

it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules/tmp').with_ensure('directory') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/bin/selinux_build_module_simple.sh') }
it { is_expected.to contain_file_line('set-selinux-config-type-to-minimum').with(line: 'SELINUXTYPE=minimum') }
end
Expand All @@ -44,6 +47,7 @@

it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/modules/tmp').with_ensure('directory') }
it { is_expected.to contain_file('/var/lib/puppet/puppet-selinux/bin/selinux_build_module_simple.sh') }
it { is_expected.to contain_file_line('set-selinux-config-type-to-mls').with(line: 'SELINUXTYPE=mls') }
end
Expand Down

0 comments on commit 0942937

Please sign in to comment.