File tree 3 files changed +38
-7
lines changed
3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change 19
19
validate_string($java )
20
20
validate_string($jar_name )
21
21
22
- $init_script = " init-script-${name} "
22
+ # prog is the 'name' of the init.d script.
23
+ $prog = " selenium${name} "
23
24
24
25
case $::osfamily {
25
26
' debian' : {
26
27
ensure_packages([' daemon' ])
27
- Package[' daemon' ] -> File [$init_script ]
28
+ Package[' daemon' ] -> File [$prog ]
28
29
}
29
30
default : {}
30
31
}
31
32
32
- # prog is the 'name' of the init.d script.
33
- $prog = " selenium${name} "
34
-
35
- file { $init_script:
33
+ file { $prog:
36
34
ensure => ' file' ,
37
35
path => " /etc/init.d/${prog} " ,
38
36
owner => ' root' ,
Original file line number Diff line number Diff line change
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe 'selenium::hub & selenium::node on the same host' do
4
+ after ( :all ) do
5
+ shell "service seleniumhub stop"
6
+ shell "service seleniumnode stop"
7
+ end
8
+
9
+ describe 'running puppet code' do
10
+ # Using puppet_apply as a helper
11
+ it 'should work with no errors' do
12
+ pp = <<-EOS
13
+ include java
14
+ Class['java'] -> Class['selenium::hub']
15
+ Class['java'] -> Class['selenium::node']
16
+
17
+ class { 'selenium::hub': }
18
+ class { 'selenium::node': }
19
+ EOS
20
+
21
+ # Run it twice and test for idempotency
22
+ apply_manifest ( pp , :catch_failures => true )
23
+ apply_manifest ( pp , :catch_changes => true )
24
+ end
25
+ end
26
+
27
+ [ 'seleniumhub' , 'seleniumnode' ] . each do |service |
28
+ describe service ( service ) do
29
+ it { should be_running }
30
+ it { should be_enabled }
31
+ end
32
+ end
33
+ end
Original file line number Diff line number Diff line change 18
18
p . merge! ( params ) if params
19
19
20
20
it do
21
- should contain_file ( "init-script- #{ title } " ) . with ( {
21
+ should contain_file ( "selenium #{ title } " ) . with ( {
22
22
'ensure' => 'file' ,
23
23
'path' => "/etc/init.d/selenium#{ title } " ,
24
24
'owner' => 'root' ,
You can’t perform that action at this time.
0 commit comments