-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from yakara-ltd/selinux
Add SELinux support
- Loading branch information
Showing
4 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,4 @@ | |
|
||
depends 'ulimit', '>= 0.1.2' | ||
depends 'build-essential' | ||
depends 'selinux_policy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
require 'spec_helper' | ||
|
||
prefix = os[:family] == 'freebsd' ? '/usr/local' : '' | ||
|
||
describe 'Redis' do | ||
it_behaves_like 'redis on port', 6379 | ||
end | ||
|
||
if os[:family] == 'freebsd' | ||
describe file('/usr/local/etc/redis/savetest.conf') do | ||
it { should be_file } | ||
describe file("#{prefix}/etc/redis/savetest.conf") do | ||
it { should be_file } | ||
|
||
['save a', 'save b', 'save c'].each do |m| | ||
its(:content) { should match(m) } | ||
end | ||
['save a', 'save b', 'save c'].each do |m| | ||
its(:content) { should match(m) } | ||
end | ||
else | ||
describe file('/etc/redis/savetest.conf') do | ||
it { should be_file } | ||
end | ||
|
||
['save a', 'save b', 'save c'].each do |m| | ||
its(:content) { should match(m) } | ||
if system('command -v semanage &>/dev/null') | ||
describe command('semanage fcontext --list --noheading | grep -F redis') do | ||
[ | ||
%r{^/etc/redis\(/\.\*\)\?\s.*:redis_conf_t:}, | ||
%r{^/var/lib/redis\(/\.\*\)\?\s.*:redis_var_lib_t:}, | ||
%r{^/var/run/redis\(/\.\*\)\?\s.*:redis_var_run_t:}, | ||
%r{^/var/log/redis\(/\.\*\)\?\s.*:redis_log_t:} | ||
].each do |pattern| | ||
its(:stdout) { should match(pattern) } | ||
end | ||
end | ||
end |
43 changes: 14 additions & 29 deletions
43
test/integration/multisentinel/serverspec/multiple_sentinels_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters