<commit_before>require 'spec_helper'

# $stdout.puts self.catalogue.to_yaml

active_modules = "/etc/selinux/targeted/modules/active/modules"
describe 'selinux::module', :type => :define do
  let(:title) { 'selinux::module' }

  describe "loading module" do
    modname = 'rsynclocal'
    modules_dir = '/var/lib/puppet/selinux'
    this_module_dir = "#{modules_dir}/#{modname}"
    source = "puppet:///modules/selinux/#{modname}"
    let(:title) { modname }
    let(:params) {{
      :source      => source,
      :modules_dir => modules_dir,
    }}
    let(:facts) { {
        :osfamily      => 'RedHat',
        :operatingsystemrelease => '6.4'
    } }

    it { should create_class('selinux') }
    it { should create_class('selinux::params') }
    it { should create_class('selinux::config') }
    it { should create_class('selinux::install') }
    it { should create_package('policycoreutils') }
    it { should create_package('checkpolicy') }
    it { should create_package('selinux-policy') }
    it { should create_package('make') }
    it { should create_selinux__module(modname) }
    it { should create_file("#{this_module_dir}")\
      .with(
        :ensure  => 'directory',
        :recurse => 'remote',
        :source  => source,
      ) } 
    it { should create_file("#{this_module_dir}/#{modname}.te")\
      .with(<commit_msg>module: spec check for ignore param<commit_after>require 'spec_helper'

# $stdout.puts self.catalogue.to_yaml

active_modules = "/etc/selinux/targeted/modules/active/modules"
describe 'selinux::module', :type => :define do
  let(:title) { 'selinux::module' }

  describe "loading module" do
    modname = 'rsynclocal'
    modules_dir = '/var/lib/puppet/selinux'
    this_module_dir = "#{modules_dir}/#{modname}"
    source = "puppet:///modules/selinux/#{modname}"
    ignore = [ 'CVS', '.svn' ]
    let(:title) { modname }
    let(:params) {{
      :source      => source,
      :modules_dir => modules_dir,
      :ignore      =>  ignore
    }}
    let(:facts) { {
        :osfamily      => 'RedHat',
        :operatingsystemrelease => '6.4'
    } }

    it { should create_class('selinux') }
    it { should create_class('selinux::params') }
    it { should create_class('selinux::config') }
    it { should create_class('selinux::install') }
    it { should create_package('policycoreutils') }
    it { should create_package('checkpolicy') }
    it { should create_package('selinux-policy') }
    it { should create_package('make') }
    it { should create_selinux__module(modname) }
    it { should create_file("#{this_module_dir}")\
      .with(
        :ensure  => 'directory',
        :recurse => 'remote',
        :source  => source,
        :ignore  => ignore
      ) } 
    it { should create_file("#{this_module_dir}/#{modname}.te")\
      .with(
{'fraction_non_alphanumeric': 0.15845824411134904, 'fraction_numerical': 0.0014275517487508922, 'mean_word_length': 3.08600583090379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1540155', 'n_tokens_mistral': 946, 'n_tokens_neox': 914, 'n_words': 167}