From 5071e9c08f813aeb74545df9d8bbe2954ffcdb50 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 1 Oct 2013 10:13:12 -0700 Subject: [PATCH] add class selenium::install --- manifests/install.pp | 12 ++++++++++++ spec/classes/selenium_install_spec.rb | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 47b9c63..d5ea47a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -47,11 +47,23 @@ } $jar_path = "${selenium::server::install_path}/jars" + $log_path = "${selenium::server::install_path}/log" file { $jar_path: ensure => directory, } + file { $log_path: + ensure => directory, + } + + file { '/var/log/selenium': + ensure => link, + owner => 'root', + group => 'root', + target => $log_path, + } + wget::fetch { 'selenium-server-standalone': source => $jar_url, destination => "${selenium::server::jar_path}/${jar_name}", diff --git a/spec/classes/selenium_install_spec.rb b/spec/classes/selenium_install_spec.rb index 5c1ccb4..09d9afd 100644 --- a/spec/classes/selenium_install_spec.rb +++ b/spec/classes/selenium_install_spec.rb @@ -7,7 +7,26 @@ it do should include_class('wget') should contain_class('selenium::install').with_version('2.35.0') - should contain_file('/opt/selenium').with_ensure('directory') + should contain_file('/opt/selenium').with({ + 'ensure' => 'directory', + 'owner' => 'selenium', + 'group' => 'selenium', + }) + should contain_file('/opt/selenium/jars').with({ + 'ensure' => 'directory', + 'owner' => 'selenium', + 'group' => 'selenium', + }) + should contain_file('/opt/selenium/log').with({ + 'ensure' => 'directory', + 'owner' => 'selenium', + 'group' => 'selenium', + }) + should contain_file('/var/log/selenium').with({ + 'ensure' => 'link', + 'owner' => 'root', + 'group' => 'root', + }) should contain_wget__fetch('selenium-server-standalone') end