diff --git a/manifests/config.pp b/manifests/config.pp index 495590f..1793767 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -38,7 +38,7 @@ validate_string($jar_name) # prog is the 'name' of the init.d script. - $prog = $name + $prog = "selenium${name}" file { "/etc/init.d/${prog}": ensure => 'file', diff --git a/manifests/server.pp b/manifests/server.pp index 4356e39..5e0ee58 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -16,7 +16,7 @@ include selenium Class[ 'selenium' ] -> - selenium::config{ 'seleniumstandalone': + selenium::config{ 'server': display => $display, user => $selenium::user, group => $selenium::group, diff --git a/spec/classes/selenium_server_spec.rb b/spec/classes/selenium_server_spec.rb index 2eff1a8..ba30f9c 100644 --- a/spec/classes/selenium_server_spec.rb +++ b/spec/classes/selenium_server_spec.rb @@ -12,7 +12,7 @@ it do should include_class('selenium') - should contain_selenium__config('seleniumstandalone').with({ + should contain_selenium__config('server').with({ 'display' => p[:display], 'options' => p[:options], }) diff --git a/spec/defines/selenium_config_spec.rb b/spec/defines/selenium_config_spec.rb index 64beeba..4216a94 100644 --- a/spec/defines/selenium_config_spec.rb +++ b/spec/defines/selenium_config_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'selenium::config', :type => :define do - let(:title) { 'seleniumstandalone' } + let(:title) { 'server' } shared_examples 'config' do |params| let :pre_condition do @@ -20,20 +20,21 @@ p.merge!(params) if params it do - should contain_file("/etc/init.d/#{title}").with({ + should contain_file("/etc/init.d/selenium#{title}").with({ 'ensure' => 'file', 'owner' => 'root', 'group' => 'root', 'mode' => '0755', }). - with_content(/# #{title} Selenium server init script/). + with_content(/# selenium#{title} Selenium server init script/). with_content(/SLNM_DISPLAY='#{p[:display]}'/). with_content(/SLNM_USER='#{p[:user]}'/). with_content(/SLNM_INSTALL_ROOT='#{p[:install_root]}'/). with_content(/SLNM_JAR_NAME='#{p[:jar_name]}'/). with_content(/SLNM_OPTIONS='#{p[:options]}'/). with_content(/SLNM_JAVA='#{p[:java]}'/). - with_content(/prog='#{title}'/) + with_content(/SLNM_LOG_NAME='#{title}'/). + with_content(/prog='selenium#{title}'/) end end diff --git a/templates/init.d/selenium.erb b/templates/init.d/selenium.erb index ac12034..3558248 100644 --- a/templates/init.d/selenium.erb +++ b/templates/init.d/selenium.erb @@ -28,10 +28,11 @@ SLNM_INSTALL_ROOT='<%= @install_root %>' SLNM_JAR_NAME='<%= @jar_name %>' SLNM_OPTIONS='<%= @options %>' SLNM_JAVA='<%= @java %>' +SLNM_LOG_NAME='<%= @name %>' prog='<%= @prog %>' -SLNM_LOG="${SLNM_INSTALL_ROOT}/log/${prog}_stdout.log" -SLNM_ERROR_LOG="${SLNM_INSTALL_ROOT}/log/${prog)_stderr.log" +SLNM_LOG="${SLNM_INSTALL_ROOT}/log/${SLNM_LOG_NAME}_stdout.log" +SLNM_ERROR_LOG="${SLNM_INSTALL_ROOT}/log/${SLNM_LOG_NAME}_stderr.log" SLNM_JAR="${SLNM_INSTALL_ROOT}/jars/${SLNM_JAR_NAME}" #config=""