Sha256: a3b3fcbdc2e8bf77312e0cc7956c3c72f67feb1bc6ef31628aacca8036d5ba0f
Contents?: true
Size: 1.88 KB
Versions: 45
Compression:
Stored size: 1.88 KB
Contents
require 'spec_helper' require 'serverspec/helper/base' include Serverspec::Helper::RedHat include Serverspec::Helper::Exec describe 'configurations are not set' do context file('/etc/passwd') do it { should be_file } its(:command) { should eq 'test -f /etc/passwd' } end end describe 'path is set' do let(:path) { '/sbin:/usr/sbin' } context file('/etc/passwd') do it { should be_file } its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' } end end describe 'pre_command is set' do let(:pre_command) { 'source ~/.zshrc' } context file('/etc/passwd') do it { should be_file } its(:command) { should eq 'source ~/.zshrc && test -f /etc/passwd' } end end describe 'path and pre_command are set' do let(:path) { '/sbin:/usr/sbin' } let(:pre_command) { 'source ~/.zshrc' } context file('/etc/passwd') do it { should be_file } its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH source ~/.zshrc && env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' } end end describe 'path is set for check_selinux' do let(:path) { '/sbin:/usr/sbin' } context selinux do it { should be_disabled } its(:command) { should eq "env PATH=/sbin:/usr/sbin:$PATH test ! -f /etc/selinux/config || (env PATH=/sbin:/usr/sbin:$PATH getenforce | grep -i -- disabled && env PATH=/sbin:/usr/sbin:$PATH grep -i -- ^SELINUX=disabled$ /etc/selinux/config)" } end context selinux do it { should be_enforcing } its(:command) { should eq "env PATH=/sbin:/usr/sbin:$PATH getenforce | grep -i -- enforcing && env PATH=/sbin:/usr/sbin:$PATH grep -i -- ^SELINUX=enforcing$ /etc/selinux/config" } end context selinux do it { should be_permissive } its(:command) { should eq "env PATH=/sbin:/usr/sbin:$PATH getenforce | grep -i -- permissive && env PATH=/sbin:/usr/sbin:$PATH grep -i -- ^SELINUX=permissive$ /etc/selinux/config" } end end
Version data entries
45 entries across 45 versions & 1 rubygems