File: selinux_spec.rb

package info (click to toggle)
ruby-specinfra 2.94.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: ruby: 10,538; sh: 4; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'spec_helper'

property[:os] = nil
set :os, :family => 'linux'

describe get_command(:check_selinux_has_mode, 'disabled') do
  it do
    should eq %Q{test ! -f /etc/selinux/config || ( ( (} +
              %Q{getenforce | grep -i -- disabled) ||} +
              %Q{ (getenforce | grep -i -- permissive) )} +
              %Q{ && grep -iE -- '^\\s*SELINUX=disabled\\>' /etc/selinux/config)}
  end
end

describe get_command(:check_selinux_has_mode, 'permissive', nil) do
  it do
    should eq %Q{(getenforce | grep -i -- permissive)} +
              %Q{ && grep -iE -- '^\\s*SELINUX=permissive\\>' /etc/selinux/config}
  end
end

describe get_command(:check_selinux_has_mode, 'enforcing', 'targeted') do
  it do
    should eq %Q{(getenforce | grep -i -- enforcing)} +
              %Q{ && grep -iE -- '^\\s*SELINUX=enforcing\\>' /etc/selinux/config} +
              %Q{ && grep -iE -- '^\\s*SELINUXTYPE=targeted\\>' /etc/selinux/config}
  end
end