1
1
require 'spec_helper_system'
2
2
3
3
describe 'selenium class' do
4
- case node . facts [ 'osfamily' ]
5
- when 'RedHat' , 'Debian'
6
- package_name = 'selenium'
7
- service_name = 'selenium'
8
- end
9
-
10
4
describe 'running puppet code' do
11
5
# Using puppet_apply as a helper
12
6
it 'should work with no errors' do
13
7
pp = <<-EOS
8
+ include java
9
+ Class['java'] -> Class['selenium']
10
+
14
11
class { 'selenium': }
15
12
EOS
16
13
@@ -23,12 +20,30 @@ class { 'selenium': }
23
20
end
24
21
end
25
22
26
- describe package ( package_name ) do
27
- it { should be_installed }
23
+ %w[ /opt/selenium /opt/selenium/jars /opt/selenium/log ] . each do |file |
24
+ describe file ( file ) do
25
+ it { should be_directory }
26
+ it { should be_owned_by 'selenium' }
27
+ it { should be_grouped_into 'selenium' }
28
+ it { should be_mode 755 }
29
+ end
30
+ end
31
+
32
+ describe file ( '/var/log/selenium' ) do
33
+ it { should be_linked_to '/opt/selenium/log' }
34
+ end
35
+
36
+ describe file ( '/opt/selenium/jars/selenium-server-standalone-2.39.0.jar' ) do
37
+ it { should be_file }
38
+ it { should be_owned_by 'selenium' }
39
+ it { should be_grouped_into 'selenium' }
40
+ it { should be_mode 644 }
28
41
end
29
42
30
- describe service ( service_name ) do
31
- it { should be_running }
32
- it { should be_enabled }
43
+ describe file ( '/etc/logrotate.d/selenium' ) do
44
+ it { should be_file }
45
+ it { should be_owned_by 'root' }
46
+ it { should be_grouped_into 'root' }
47
+ it { should be_mode 444 }
33
48
end
34
49
end
0 commit comments