Skip to content

Commit

Permalink
rename selenium::server init.d from seleniumstandalone -> seleniumserver
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Oct 2, 2013
1 parent 8523e66 commit 558c335
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
include selenium

Class[ 'selenium' ] ->
selenium::config{ 'seleniumstandalone':
selenium::config{ 'server':
display => $display,
user => $selenium::user,
group => $selenium::group,
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/selenium_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
Expand Down
9 changes: 5 additions & 4 deletions spec/defines/selenium_config_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions templates/init.d/selenium.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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="<path to major config file>"
Expand Down

0 comments on commit 558c335

Please sign in to comment.