/
linux_spec.rb
51 lines (42 loc) · 1.4 KB
/
linux_spec.rb
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
require 'serverspec'
set :backend, :exec
puts "os: #{os}"
prefix_dir = os[:family] == 'redhat' ? '/opt/rh/mysql51/root' : nil
if %w(debian ubuntu redhat suse fedora).include? os[:family]
describe file("#{prefix_dir}/etc/mysql-default") do
it { should be_directory }
it { should be_mode 755 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end
describe file("#{prefix_dir}/etc/mysql-default/conf.d") do
it { should be_directory }
it { should be_mode 750 }
it { should be_owned_by 'mysql' }
it { should be_grouped_into 'mysql' }
end
describe file("#{prefix_dir}/etc/mysql-default/conf.d/hello.cnf") do
it { should be_file }
it { should be_mode 640 }
it { should be_owned_by 'mysql' }
it { should be_grouped_into 'mysql' }
end
describe file("#{prefix_dir}/etc/mysql-foo") do
it { should be_directory }
it { should be_mode 755 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end
describe file("#{prefix_dir}/etc/mysql-foo/conf.d") do
it { should be_directory }
it { should be_mode 750 }
it { should be_owned_by 'mysql' }
it { should be_grouped_into 'mysql' }
end
describe file("#{prefix_dir}/etc/mysql-foo/conf.d/hello_again.cnf") do
it { should be_file }
it { should be_mode 640 }
it { should be_owned_by 'mysql' }
it { should be_grouped_into 'mysql' }
end
end