From 50a23d1704bc4b5ff40fbe726dbb9b45a9bed57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Fri, 26 Jul 2013 13:53:25 +0200 Subject: [PATCH 1/2] Adding support for Oracle Enterprise Linux --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 422e240..22569d3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -17,7 +17,7 @@ class java::params { 'RedHat': { case $::operatingsystem { default: { fail("unsupported os ${::operatingsystem}") } - 'RedHat', 'CentOS': { + 'RedHat', 'CentOS', 'OracleLinux': { if (versioncmp($::operatingsystemrelease, '5.0') < 0) { $jdk_package = 'java-1.6.0-sun-devel' $jre_package = 'java-1.6.0-sun' From 2d70d838ba2dd5620f72e54c7310739c09efb138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Fri, 26 Jul 2013 14:21:32 +0200 Subject: [PATCH 2/2] Adding support for Oracle Enterprise Linux with spec tests --- spec/classes/java_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index b924d53..b78e317 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -74,6 +74,22 @@ describe 'java', :type => :class do it { should contain_package('java').with_name('java-1.7.0-openjdk') } end + context 'select openjdk for Oracle Linux' do + let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.4'} } + it { should contain_package('java').with_name('java-1.7.0-openjdk-devel') } + end + + context 'select openjdk for Oracle Linux 6.2' do + let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.2'} } + it { should contain_package('java').with_name('java-1.6.0-openjdk-devel') } + end + + context 'select passed value for Oracle Linux' do + let(:facts) { {:osfamily => 'RedHat', :operatingsystem => 'OracleLinux', :operatingsystemrelease => '6.3'} } + let(:params) { { 'distribution' => 'jre' } } + it { should contain_package('java').with_name('java-1.7.0-openjdk') } + end + context 'select default for OpenSUSE 12.3' do let(:facts) { {:osfamily => 'Suse', :operatingsystem => 'OpenSUSE', :operatingsystemrelease => '12.3'}} it { should contain_package('java').with_name('java-1_7_0-openjdk-devel')}