Compare commits

...

55 Commits
3.0.0 ... 3.3.0

Author SHA1 Message Date
Paula Muir
1021c71139 Merge pull request #341 from david22swan/ReleasePrep
(MODULES-8478) - 3.3.0 Release Prep
2019-01-17 10:55:28 +00:00
David Swan
66a6e6c28e (MODULES-8478) - 3.3.0 Release Prep 2019-01-16 15:36:22 +00:00
Helen
197bd5fe7f Merge pull request #340 from puppetlabs/pdksync_pdksync_heads/master-0-g6814a87
pdksync - pdksync_heads/master-0-g6814a87
2019-01-14 15:44:25 +00:00
David Swan
ed5fd0d528 pdksync_heads/master-0-g6814a87 2019-01-10 15:29:50 +00:00
davidmalloncares
be8c53be64 Merge pull request #339 from puppetlabs/pdksync_pdksync_heads/master-0-g9c815ea
pdksync - pdksync_heads/master-0-g9c815ea
2019-01-03 15:58:14 +00:00
David Swan
cec95965d0 pdksync_heads/master-0-g9c815ea 2019-01-03 14:33:56 +00:00
Eimhin Laverty
32506eb127 Merge pull request #338 from puppetlabs/pdksync_FM-7655
pdksync - (FM-7655) Fix rubygems-update for ruby < 2.3
2018-12-20 10:46:41 +00:00
tphoney
4898fbdfaa (FM-7655) Fix rubygems-update for ruby < 2.3 2018-12-20 10:09:32 +00:00
Helen
dd2c5b08df Merge pull request #337 from puppetlabs/pdksync_pdksync_heads/master-0-gbf720df
pdksync - pdksync_heads/master-0-gbf720df
2018-12-17 14:08:03 +00:00
Eimhin Laverty
9526767b95 pdksync_heads/master-0-gbf720df 2018-12-17 11:31:10 +00:00
david22swan
35f5fa9e33 Merge pull request #336 from eimlav/modules-8234
(MODULES-8234) - Add SLES 15 support
2018-12-14 14:26:34 +00:00
Eimhin Laverty
1504bf8974 (MODULES-8234) - Add SLES 15 support 2018-12-13 12:57:47 +00:00
Eimhin Laverty
5112b4d59f Merge pull request #335 from pmcmaw/bugfix_FM-7520
(FM-7520) - Removing Solaris from the support matrix
2018-11-19 11:18:46 +00:00
Paula Muir
ed5cbf950e Merge branch 'master' into bugfix_FM-7520 2018-11-19 11:00:10 +00:00
Paula Muir
cd46267fad (maint) - Standardising and removing Service Packs (SP) 2018-11-19 10:58:55 +00:00
Paula Muir
7405a304d9 (FM-7520) - Removing Solaris from the support matrix
This is a bug fix as Solaris has never worked on this module. Updating
to resolve the issue with our documentation.
2018-11-19 10:58:54 +00:00
Paula Muir
b4bb7f0b89 Merge pull request #334 from eimlav/modules-8234
(MODULES-8234) - Upgrade Oracle Java version to 8u192
2018-11-09 15:25:41 +00:00
Eimhin Laverty
68fb4fa498 (MODULES-8234) - Upgrade Oracle Java version to 8u192 2018-11-09 11:05:24 +00:00
Paula Muir
7243839129 Merge pull request #333 from puppetlabs/pdksync_pdksync_heads/master-0-gabccfb1
pdksync - pdksync_heads/master-0-gabccfb1
2018-11-07 13:21:10 +00:00
David Swan
a5ea78aeb4 pdksync_heads/master-0-gabccfb1 2018-11-07 10:22:33 +00:00
david22swan
89a205bc48 Merge pull request #314 from ojongerius/oracle_java_181
MODULES-8044: upgrade Oracle Java 8 to 181, make it the default release
2018-11-05 10:14:28 +00:00
Otto Jongerius
0fd7c00fa9 upgrade Oracle Java 8 to 181, make it the default release 2018-11-05 16:06:43 +13:00
david22swan
de89b1f2da Merge pull request #315 from olevole/master
MODULES-7819 fix set JAVA_HOME environments on FreeBSD platform
2018-11-02 13:46:10 +00:00
Eimhin Laverty
ca4b22c7a0 Merge pull request #331 from pmcmaw/FM-7520
(FM-7520) - Removing service pack extensions
2018-10-24 16:10:51 +01:00
Paula Muir
0acc804564 (FM-7520) - Removing service pack extensions
We support SLES11 and SLES12. It is not necessary to state the SP
therefore removing the SPs.
2018-10-23 17:30:56 +01:00
Dennis Ploeger
b53a78fbe8 Support for installing JCE. Fixes MODULES-1681 (#326)
* Support for installing JCE. Fixes MODULES-1681

* Disabled oracle tests. Only to be enabled, if the other configuration options match the current java download URL provided by Oracle.
2018-10-18 10:07:37 +01:00
david22swan
390805475e Merge pull request #329 from mmoll/deb_openjdk_arm
Fix OpenJDK paths on Debian based OS with ARM
2018-10-12 16:46:41 +01:00
Michael Moll
911df2d7b7 Fix OpenJDK paths on Debian based OS with ARM 2018-10-12 16:55:50 +02:00
david22swan
61ffb4bf1d Merge pull request #330 from dodevops/MODULES-8085
Optimized code for making java::oracle atomic. Fixes MODULES-8085
2018-10-12 14:47:36 +01:00
Dennis Ploeger
bf26247f55 Fixed style violations 2018-10-12 14:27:59 +02:00
david22swan
c6acb9906c Merge pull request #322 from syseleven/MODULES-8025
(MODULES-8025) Switch default for Ubuntu 18.04 to 11
2018-10-12 11:50:36 +01:00
Dennis Ploeger
5f1b7ecea8 Optimized code for making java::oracle atomic. Fixes MODULES-8085 2018-10-12 07:43:57 +02:00
Paula Muir
615db5f7c6 Merge pull request #323 from eimlav/modules7050
(MODULES-7050) - Fix OracleJDK reinstalling on Puppet runs
2018-10-03 17:40:50 +01:00
Eimhin Laverty
89aa846909 (MODULES-7050) - Fix OracleJDK reinstalling on Puppet runs 2018-10-03 17:26:03 +01:00
Matthias Baur
60c93866b1 (MODULES-8025) Switch default for Ubuntu 18.04 to 11
This is needed to get the default Java version rollout with Ubuntu
18.04.
2018-10-01 18:08:30 +02:00
david22swan
72e042afad Merge pull request #320 from puppetlabs/release
Release merge back 3.2.0
2018-09-27 15:51:16 +01:00
Eimhin Laverty
8de3ea58a3 Merge pull request #319 from david22swan/PreRelease
(MODULES-7898) - 3.2.0 Release Prep
2018-09-27 12:09:50 +01:00
David Swan
1b56da5a27 (MODULES-7898) - 3.2.0 Release Prep 2018-09-27 12:03:18 +01:00
david22swan
380b8d749d Merge pull request #317 from puppetlabs/pdksync_MODULES-6805
pdksync - (MODULES-6805) metadata.json shows support for puppet 6
2018-09-27 11:12:15 +01:00
david22swan
7cb684c3c0 Merge pull request #318 from puppetlabs/pdksync_FM-7392_pdk_update
pdksync - (FM-7392) - Puppet 6 Testing Changes
2018-09-25 09:31:45 +01:00
Paula Muir
2926bbcfcb (FM-7392) - Puppet 6 Testing Changes 2018-09-24 17:02:26 +01:00
tphoney
a63f788394 (MODULES-6805) metadata.json shows support for puppet 6 2018-09-20 16:33:43 +01:00
olevole
728fc7e02d fix set JAVA_HOME environments on FreeBSD platform
FreeBSD do not use /etc/environment file for global variables. Instead we use two
places to set the variable:
  - /etc/profile for sh(1)
  - /etc/csh.login for csh(1) which is the default shell for FreeBSD

Fixes for MODULES-7819 issue
2018-09-20 14:22:37 +03:00
Eimhin Laverty
58669e653c Merge pull request #313 from puppetlabs/release
3.1.0 Mergeback
2018-09-10 10:01:49 +01:00
Eimhin Laverty
255406b30f Merge pull request #312 from david22swan/PreRelease
3.1.0 Pre Release
2018-09-06 16:30:26 +01:00
David Swan
a24f8f15ea 3.1.0 Pre Release 2018-09-06 16:21:26 +01:00
Eimhin Laverty
5d07f08126 Merge pull request #311 from puppetlabs/pdksync_pdksync-beaker4
pdksync - (MODULES-7658) use beaker4 in puppet-module-gems
2018-08-31 14:30:05 +01:00
tphoney
01b95d32c6 (MODULES-7658) use beaker4 in puppet-module-gems 2018-08-30 17:07:43 +01:00
Helen
3c9f98d75e Merge pull request #310 from puppetlabs/pdksync_bumping_puppet_version
pdksync - (MODULES-7705) - Bumping stdlib dependency from < 5.0.0 to < 6.0.0
2018-08-28 10:04:24 +01:00
Paula Muir
e0b0e1cd19 (MODULES-7705) - Bumping stdlib requirement to 6.0.0 2018-08-24 09:15:08 +01:00
Helen
7067aed306 Merge pull request #305 from puppetlabs/pdksync_1.7.0-0-g57412ed
pdksync - Update using 1.7.0
2018-08-22 14:56:33 +01:00
Paula Muir
cb637faf83 pdksync_1.7.0-0-g57412ed 2018-08-22 14:33:05 +01:00
Eimhin Laverty
66023e1a66 Merge pull request #304 from puppetlabs/pdksync_pdksync-beaker3
pdksync - (MODULES-7658) use beaker3 in puppet-module-gems
2018-08-21 16:22:10 +01:00
tphoney
743006a16e (MODULES-7658) use beaker3 in puppet-module-gems 2018-08-21 15:27:02 +01:00
Paula Muir
d5d69ee5ac Merge pull request #303 from puppetlabs/release
Release merge back 3.0.0
2018-08-14 10:57:03 +01:00
19 changed files with 529 additions and 169 deletions

2
.gitattributes vendored
View File

@@ -1,5 +1,5 @@
#This file is generated by ModuleSync, do not edit.
*.rb eol=lf *.rb eol=lf
*.erb eol=lf *.erb eol=lf
*.pp eol=lf *.pp eol=lf
*.sh eol=lf *.sh eol=lf
*.epp eol=lf

View File

@@ -22,3 +22,16 @@
/convert_report.txt /convert_report.txt
/update_report.txt /update_report.txt
.DS_Store .DS_Store
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/

0
.puppet-lint.rc Normal file
View File

View File

@@ -19,6 +19,10 @@ AllCops:
Metrics/LineLength: Metrics/LineLength:
Description: People have wide screens, use them. Description: People have wide screens, use them.
Max: 200 Max: 200
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
RSpec/BeforeAfterAll: RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests. Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing. A necessary evil in acceptance testing.

View File

@@ -25,17 +25,6 @@ Gemfile:
- mswin - mswin
- mingw - mingw
- x64_mingw - x64_mingw
- gem: beaker
version: '~> 3.13'
from_env: BEAKER_VERSION
- gem: beaker-abs
from_env: BEAKER_ABS_VERSION
version: '~> 0.1'
- gem: beaker-pe
- gem: beaker-hostgenerator
from_env: BEAKER_HOSTGENERATOR_VERSION
- gem: beaker-rspec
from_env: BEAKER_RSPEC_VERSION
appveyor.yml: appveyor.yml:
delete: true delete: true

View File

@@ -1,38 +1,37 @@
--- ---
sudo: false
dist: trusty dist: trusty
language: ruby language: ruby
cache: bundler cache: bundler
before_install: before_install:
- bundle -v - bundle -v
- rm -f Gemfile.lock - rm -f Gemfile.lock
- gem update --system - gem update --system $RUBYGEMS_VERSION
- gem --version - gem --version
- bundle -v - bundle -v
script: script:
- 'bundle exec rake $CHECK' - 'bundle exec rake $CHECK'
bundler_args: --without system_tests bundler_args: --without system_tests
rvm: rvm:
- 2.4.4 - 2.5.1
env: env:
global: global:
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0" - BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- -
bundler_args: bundler_args:
dist: trusty dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
rvm: 2.4.4 rvm: 2.5.1
script: bundle exec rake beaker script: bundle exec rake beaker
services: docker services: docker
sudo: required sudo: required
- -
bundler_args: bundler_args:
dist: trusty dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
rvm: 2.4.4 rvm: 2.5.1
script: bundle exec rake beaker script: bundle exec rake beaker
services: docker services: docker
sudo: required sudo: required
@@ -41,8 +40,8 @@ matrix:
- -
env: CHECK=parallel_spec env: CHECK=parallel_spec
- -
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.1.9 rvm: 2.4.4
branches: branches:
only: only:
- master - master

View File

@@ -2,6 +2,43 @@
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
## [3.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.3.0) (2019-01-16)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.2.0...3.3.0)
### Added
- \(MODULES-8234\) - Add SLES 15 support [\#336](https://github.com/puppetlabs/puppetlabs-java/pull/336) ([eimlav](https://github.com/eimlav))
- \(MODULES-8234\) - Upgrade Oracle Java version to 8u192 [\#334](https://github.com/puppetlabs/puppetlabs-java/pull/334) ([eimlav](https://github.com/eimlav))
- Support for installing JCE. Fixes MODULES-1681 [\#326](https://github.com/puppetlabs/puppetlabs-java/pull/326) ([dploeger](https://github.com/dploeger))
- MODULES-8044: upgrade Oracle Java 8 to 181, make it the default release [\#314](https://github.com/puppetlabs/puppetlabs-java/pull/314) ([ojongerius](https://github.com/ojongerius))
### Fixed
- pdksync - \(FM-7655\) Fix rubygems-update for ruby \< 2.3 [\#338](https://github.com/puppetlabs/puppetlabs-java/pull/338) ([tphoney](https://github.com/tphoney))
- \(FM-7520\) - Removing Solaris from the support matrix [\#335](https://github.com/puppetlabs/puppetlabs-java/pull/335) ([pmcmaw](https://github.com/pmcmaw))
- Optimized code for making java::oracle atomic. Fixes MODULES-8085 [\#330](https://github.com/puppetlabs/puppetlabs-java/pull/330) ([dploeger](https://github.com/dploeger))
- Fix OpenJDK paths on Debian based OS with ARM [\#329](https://github.com/puppetlabs/puppetlabs-java/pull/329) ([mmoll](https://github.com/mmoll))
- \(MODULES-7050\) - Fix OracleJDK reinstalling on Puppet runs [\#323](https://github.com/puppetlabs/puppetlabs-java/pull/323) ([eimlav](https://github.com/eimlav))
- \(MODULES-8025\) Switch default for Ubuntu 18.04 to 11 [\#322](https://github.com/puppetlabs/puppetlabs-java/pull/322) ([baurmatt](https://github.com/baurmatt))
- MODULES-7819 fix set JAVA\_HOME environments on FreeBSD platform [\#315](https://github.com/puppetlabs/puppetlabs-java/pull/315) ([olevole](https://github.com/olevole))
## [3.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.2.0) (2018-09-27)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.1.0...3.2.0)
### Added
- pdksync - \(MODULES-6805\) metadata.json shows support for puppet 6 [\#317](https://github.com/puppetlabs/puppetlabs-java/pull/317) ([tphoney](https://github.com/tphoney))
## [3.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.1.0) (2018-09-06)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.0.0...3.1.0)
### Added
- pdksync - \(MODULES-7705\) - Bumping stdlib dependency from \< 5.0.0 to \< 6.0.0 [\#310](https://github.com/puppetlabs/puppetlabs-java/pull/310) ([pmcmaw](https://github.com/pmcmaw))
## [3.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.0.0) (2018-08-13) ## [3.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.0.0) (2018-08-13)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0)

34
Gemfile
View File

@@ -1,25 +1,18 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org' source ENV['GEM_SOURCE'] || 'https://rubygems.org'
def location_for(place_or_version, fake_version = nil) def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)} git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact file_url_regex = %r{\Afile:\/\/(?<path>.*)}
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }] if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else else
[place_or_version, { require: false }] [place_or_version, { require: false }]
end end
end end
def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
else
:gem
end
end
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.') minor_version = ruby_version_segments[0..1].join('.')
@@ -28,7 +21,8 @@ group :development do
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4') gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
@@ -36,17 +30,11 @@ group :development do
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2') gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end end
group :system_tests do group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
end end
puppet_version = ENV['PUPPET_GEM_VERSION'] puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION'] facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION'] hiera_version = ENV['HIERA_GEM_VERSION']

View File

@@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
def changelog_user def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog" return unless Rake.application.top_level_tasks.include? "changelog"

View File

@@ -44,7 +44,7 @@ class java::config ( ) {
} }
} }
} }
'FreeBSD', 'Suse': { 'Suse': {
if $java::use_java_home != undef { if $java::use_java_home != undef {
file_line { 'java-home-environment': file_line { 'java-home-environment':
path => '/etc/environment', path => '/etc/environment',
@@ -53,6 +53,20 @@ class java::config ( ) {
} }
} }
} }
'FreeBSD': {
if $java::use_java_home != undef {
file_line { 'java-home-environment-profile':
path => '/etc/profile',
line => "JAVA_HOME=${$java::use_java_home}; export JAVA_HOME",
match => 'JAVA_HOME=',
}
file_line { 'java-home-environment-cshrc':
path => '/etc/csh.login',
line => "setenv JAVA_HOME ${$java::use_java_home}",
match => 'setenv JAVA_HOME',
}
}
}
'Solaris': { 'Solaris': {
if $java::use_java_home != undef { if $java::use_java_home != undef {
file_line { 'java-home-environment': file_line { 'java-home-environment':

View File

@@ -87,6 +87,9 @@
# Directory hash used by the download.oracle.com site. This value is a 32 character string # Directory hash used by the download.oracle.com site. This value is a 32 character string
# which is part of the file URL returned by the JDK download site. # which is part of the file URL returned by the JDK download site.
# #
# [*jce*]
# Install Oracles Java Cryptographic Extensions into the JRE or JDK
#
# ### Author # ### Author
# mike@marseglia.org # mike@marseglia.org
# #
@@ -101,6 +104,7 @@ define java::oracle (
$proxy_type = undef, $proxy_type = undef,
$url = undef, $url = undef,
$url_hash = undef, $url_hash = undef,
$jce = false,
) { ) {
# archive module is used to download the java package # archive module is used to download the java package
@@ -111,6 +115,15 @@ define java::oracle (
fail('Java SE must be either jre or jdk.') fail('Java SE must be either jre or jdk.')
} }
if $jce {
$jce_download = $version ? {
'8' => 'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip',
'7' => 'http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip',
'6' => 'http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip',
default => undef
}
}
# determine Oracle Java major and minor version, and installation path # determine Oracle Java major and minor version, and installation path
if $version_major and $version_minor { if $version_major and $version_minor {
@@ -119,7 +132,13 @@ define java::oracle (
$release_hash = $url_hash $release_hash = $url_hash
if $release_major =~ /(\d+)u(\d+)/ { if $release_major =~ /(\d+)u(\d+)/ {
$install_path = "${java_se}1.${1}.0_${2}" # Required for CentOS systems where Java8 update number is >= 171 to ensure
# the package is visible to Puppet
if $facts['os']['family'] == 'RedHat' and $2 >= '171' {
$install_path = "${java_se}1.${1}.0_${2}-amd64"
} else {
$install_path = "${java_se}1.${1}.0_${2}"
}
} else { } else {
$install_path = "${java_se}${release_major}${release_minor}" $install_path = "${java_se}${release_major}${release_minor}"
} }
@@ -139,16 +158,16 @@ define java::oracle (
$release_hash = undef $release_hash = undef
} }
'8' : { '8' : {
$release_major = '8u131' $release_major = '8u192'
$release_minor = 'b11' $release_minor = 'b12'
$install_path = "${java_se}1.8.0_131" $install_path = "${java_se}1.8.0_192"
$release_hash = 'd54c1d3a095b4ff2b6607d096fa80163' $release_hash = '750e1c8617c5452694857ad95c3ee230'
} }
default : { default : {
$release_major = '8u131' $release_major = '8u192'
$release_minor = 'b11' $release_minor = 'b12'
$install_path = "${java_se}1.8.0_131" $install_path = "${java_se}1.8.0_192"
$release_hash = 'd54c1d3a095b4ff2b6607d096fa80163' $release_hash = '750e1c8617c5452694857ad95c3ee230'
} }
} }
} }
@@ -181,6 +200,11 @@ define java::oracle (
fail ( "unsupported platform ${$facts['kernel']}" ) } fail ( "unsupported platform ${$facts['kernel']}" ) }
} }
# Install required unzip packages for jce
if $jce {
ensure_resource('package', 'unzip', { 'ensure' => 'present' })
}
# set java architecture nomenclature # set java architecture nomenclature
case $facts['os']['architecture'] { case $facts['os']['architecture'] {
'i386' : { $arch = 'i586' } 'i386' : { $arch = 'i586' }
@@ -263,20 +287,44 @@ define java::oracle (
} }
case $facts['kernel'] { case $facts['kernel'] {
'Linux' : { 'Linux' : {
exec { "Install Oracle java_se ${java_se} ${version}" : case $facts['os']['family'] {
'Debian' : {
ensure_resource('file', '/usr/lib/jvm', {
ensure => directory,
})
$install_requires = [Archive[$destination], File['/usr/lib/jvm']]
}
default : {
$install_requires = [Archive[$destination]]
}
}
exec { "Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}" :
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin',
command => $install_command, command => $install_command,
creates => $creates_path, creates => $creates_path,
require => Archive[$destination] require => $install_requires
} }
case $facts['os']['family'] {
'Debian' : { if ($jce and $jce_download != undef) {
file{'/usr/lib/jvm': $jce_path = $java_se ? {
ensure => directory, 'jre' => "${creates_path}/lib/security",
before => Exec["Install Oracle java_se ${java_se} ${version}"] 'jdk' => "${creates_path}/jre/lib/security"
} }
archive { "/tmp/jce-${version}.zip":
source => $jce_download,
cookie => 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie',
extract => true,
extract_path => $jce_path,
extract_flags => '-oj',
creates => "${jce_path}/US_export_policy.jar",
cleanup => false,
proxy_server => $proxy_server,
proxy_type => $proxy_type,
require => [
Package['unzip'],
Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"]
]
} }
default : { }
} }
} }
default : { default : {

View File

@@ -74,18 +74,23 @@ class java::params {
'amd64' => 'x64', 'amd64' => 'x64',
default => $::architecture default => $::architecture
} }
$openjdk_architecture = $::architecture ? {
'aarch64' => 'arm64',
'armv7l' => 'armhf',
default => $::architecture
}
case $::lsbdistcodename { case $::lsbdistcodename {
'lenny', 'squeeze', 'lucid', 'natty': { 'lenny', 'squeeze', 'lucid', 'natty': {
$java = { $java = {
'jdk' => { 'jdk' => {
'package' => 'openjdk-6-jdk', 'package' => 'openjdk-6-jdk',
'alternative' => "java-6-openjdk-${::architecture}", 'alternative' => "java-6-openjdk-${openjdk_architecture}",
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java', 'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/', 'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
}, },
'jre' => { 'jre' => {
'package' => 'openjdk-6-jre-headless', 'package' => 'openjdk-6-jre-headless',
'alternative' => "java-6-openjdk-${::architecture}", 'alternative' => "java-6-openjdk-${openjdk_architecture}",
'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java', 'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java',
'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/', 'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/',
}, },
@@ -107,15 +112,15 @@ class java::params {
$java = { $java = {
'jdk' => { 'jdk' => {
'package' => 'openjdk-7-jdk', 'package' => 'openjdk-7-jdk',
'alternative' => "java-1.7.0-openjdk-${::architecture}", 'alternative' => "java-1.7.0-openjdk-${openjdk_architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java", 'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/", 'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/",
}, },
'jre' => { 'jre' => {
'package' => 'openjdk-7-jre-headless', 'package' => 'openjdk-7-jre-headless',
'alternative' => "java-1.7.0-openjdk-${::architecture}", 'alternative' => "java-1.7.0-openjdk-${::architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/bin/java", 'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/", 'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/",
}, },
'oracle-jre' => { 'oracle-jre' => {
'package' => 'oracle-j2re1.7', 'package' => 'oracle-j2re1.7',
@@ -155,19 +160,35 @@ class java::params {
}, },
} }
} }
'stretch', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful', 'bionic': { 'stretch', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': {
$java = { $java = {
'jdk' => { 'jdk' => {
'package' => 'openjdk-8-jdk', 'package' => 'openjdk-8-jdk',
'alternative' => "java-1.8.0-openjdk-${::architecture}", 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/bin/java", 'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/", 'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/",
}, },
'jre' => { 'jre' => {
'package' => 'openjdk-8-jre-headless', 'package' => 'openjdk-8-jre-headless',
'alternative' => "java-1.8.0-openjdk-${::architecture}", 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/bin/java", 'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/", 'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/",
}
}
}
'bionic': {
$java = {
'jdk' => {
'package' => 'openjdk-11-jdk',
'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/",
},
'jre' => {
'package' => 'openjdk-11-jre-headless',
'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}",
'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java",
'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/",
} }
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "puppetlabs-java", "name": "puppetlabs-java",
"version": "3.0.0", "version": "3.3.0",
"author": "puppetlabs", "author": "puppetlabs",
"summary": "Installs the correct Java package on various platforms.", "summary": "Installs the correct Java package on various platforms.",
"license": "Apache-2.0", "license": "Apache-2.0",
@@ -10,7 +10,7 @@
"dependencies": [ "dependencies": [
{ {
"name": "puppetlabs/stdlib", "name": "puppetlabs/stdlib",
"version_requirement": ">= 4.13.1 < 5.0.0" "version_requirement": ">= 4.13.1 < 6.0.0"
}, },
{ {
"name": "puppet/archive", "name": "puppet/archive",
@@ -65,29 +65,19 @@
{ {
"operatingsystem": "SLES", "operatingsystem": "SLES",
"operatingsystemrelease": [ "operatingsystemrelease": [
"11 SP1", "11",
"11 SP2",
"11 SP3",
"11 SP4",
"12", "12",
"12 SP1", "15"
"12 SP2"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"11"
] ]
} }
], ],
"requirements": [ "requirements": [
{ {
"name": "puppet", "name": "puppet",
"version_requirement": ">= 4.7.0 < 6.0.0" "version_requirement": ">= 4.7.0 < 7.0.0"
} }
], ],
"template-url": "https://github.com/puppetlabs/pdk-templates", "template-url": "https://github.com/puppetlabs/pdk-templates/",
"template-ref": "1.6.1-0-g6b0d497", "template-ref": "heads/master-0-g6814a87",
"pdk-version": "1.6.1" "pdk-version": "1.7.1"
} }

View File

@@ -1,5 +1,7 @@
require 'spec_helper_acceptance' require 'spec_helper_acceptance'
include Unix::File
# RedHat, CentOS, Scientific, Oracle prior to 5.0 : Sun Java JDK/JRE 1.6 # RedHat, CentOS, Scientific, Oracle prior to 5.0 : Sun Java JDK/JRE 1.6
# RedHat, CentOS, Scientific, Oracle 5.0 < x < 6.3 : OpenJDK Java JDK/JRE 1.6 # RedHat, CentOS, Scientific, Oracle 5.0 < x < 6.3 : OpenJDK Java JDK/JRE 1.6
# RedHat, CentOS, Scientific, Oracle after 6.3 : OpenJDK Java JDK/JRE 1.7 # RedHat, CentOS, Scientific, Oracle after 6.3 : OpenJDK Java JDK/JRE 1.7
@@ -79,6 +81,62 @@ bogus_alternative = "class { 'java':\n"\
" java_alternative_path => '/whatever',\n"\ " java_alternative_path => '/whatever',\n"\
'}' '}'
# Oracle installs are disabled by default, because the links to valid oracle installations
# change often. Look the parameters up from the Oracle download URLs at https://java.oracle.com and
# enable the tests:
oracle_enabled = false
oracle_version_major = '8'
oracle_version_minor = '192'
oracle_version_build = '12'
oracle_hash = '750e1c8617c5452694857ad95c3ee230'
install_oracle_jre = <<EOL
java::oracle {
'test_oracle_jre':
version => '#{oracle_version_major}',
version_major => '#{oracle_version_major}u#{oracle_version_minor}',
version_minor => 'b#{oracle_version_build}',
url_hash => '#{oracle_hash}',
java_se => 'jre',
}
EOL
install_oracle_jdk = <<EOL
java::oracle {
'test_oracle_jdk':
version => '#{oracle_version_major}',
version_major => '#{oracle_version_major}u#{oracle_version_minor}',
version_minor => 'b#{oracle_version_build}',
url_hash => '#{oracle_hash}',
java_se => 'jdk',
}
EOL
install_oracle_jre_jce = <<EOL
java::oracle {
'test_oracle_jre':
version => '#{oracle_version_major}',
version_major => '#{oracle_version_major}u#{oracle_version_minor}',
version_minor => 'b#{oracle_version_build}',
url_hash => '#{oracle_hash}',
java_se => 'jre',
jce => true,
}
EOL
install_oracle_jdk_jce = <<EOL
java::oracle {
'test_oracle_jdk':
version => '#{oracle_version_major}',
version_major => '#{oracle_version_major}u#{oracle_version_minor}',
version_minor => 'b#{oracle_version_build}',
url_hash => '#{oracle_hash}',
java_se => 'jdk',
jce => true,
}
EOL
context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'installs jre' do it 'installs jre' do
apply_manifest(java_class_jre, catch_failures: true) apply_manifest(java_class_jre, catch_failures: true)
@@ -155,3 +213,37 @@ context 'with failure cases' do
end end
end end
end end
# Test oracle java installs
context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
install_path = '/usr/lib/jvm'
version_suffix = ''
if fact('osfamily') == 'RedHat' || fact('osfamily') == 'Amazon'
install_path = '/usr/java'
version_suffix = '-amd64'
end
it 'installs oracle jdk' do
apply_manifest(install_oracle_jdk, catch_failures: true)
apply_manifest(install_oracle_jdk, catch_changes: true)
result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar")
expect(result.exit_code).to eq(0)
end
it 'installs oracle jre' do
apply_manifest(install_oracle_jre, catch_failures: true)
apply_manifest(install_oracle_jre, catch_changes: true)
result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar")
expect(result.exit_code).to eq(0)
end
it 'installs oracle jdk with jce' do
apply_manifest(install_oracle_jdk_jce, catch_failures: true)
apply_manifest(install_oracle_jdk_jce, catch_changes: true)
result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar")
expect(result.exit_code).to eq(0)
end
it 'installs oracle jre with jce' do
apply_manifest(install_oracle_jre_jce, catch_failures: true)
apply_manifest(install_oracle_jre_jce, catch_changes: true)
result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar")
expect(result.exit_code).to eq(0)
end
end

View File

@@ -69,6 +69,22 @@ describe 'java', type: :class do
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/') }
end end
context 'when select jdk for Ubuntu xenial (16.04) on ARM' do
let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemrelease: '16.04', architecture: 'armv7l' } }
let(:params) { { 'distribution' => 'jdk' } }
it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') }
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-armhf/') }
end
context 'when select jdk for Ubuntu xenial (16.04) on ARM64' do
let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemrelease: '16.04', architecture: 'aarch64' } }
let(:params) { { 'distribution' => 'jdk' } }
it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') }
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-arm64/') }
end
context 'when select openjdk for Amazon Linux' do context 'when select openjdk for Amazon Linux' do
let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Amazon', operatingsystemrelease: '3.4.43-43.43.amzn1.x86_64', architecture: 'x86_64' } } let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Amazon', operatingsystemrelease: '3.4.43-43.43.amzn1.x86_64', architecture: 'x86_64' } }

View File

@@ -2,7 +2,6 @@
# #
# Facts specified here will override the values provided by rspec-puppet-facts. # Facts specified here will override the values provided by rspec-puppet-facts.
--- ---
concat_basedir: "/tmp"
ipaddress: "172.16.254.254" ipaddress: "172.16.254.254"
is_pe: false is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA" macaddress: "AA:AA:AA:AA:AA:AA"

View File

@@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz' oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.tar.gz'
describe 'java::oracle', type: :define do describe 'java::oracle', type: :define do
context 'with CentOS 64-bit' do context 'with CentOS 64-bit' do
@@ -11,8 +11,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk6' } let(:title) { 'jdk6' }
it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64-rpm.bin') } it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64-rpm.bin') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').with_command('sh /tmp/jdk-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('sh /tmp/jdk-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-x64-rpm.bin]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-x64-rpm.bin]') }
end end
context 'when Oracle Java SE 7 JDK' do context 'when Oracle Java SE 7 JDK' do
@@ -20,17 +20,17 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk7' } let(:title) { 'jdk7' }
it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.rpm') } it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').with_command('rpm --force -iv /tmp/jdk-7u80-linux-x64.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('rpm --force -iv /tmp/jdk-7u80-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-x64.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-x64.rpm]') }
end end
context 'when Oracle Java SE 8 JDK' do context 'when Oracle Java SE 8 JDK' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jdk-8u131-linux-x64.rpm') } it { is_expected.to contain_archive('/tmp/jdk-8u192-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').with_command('rpm --force -iv /tmp/jdk-8u131-linux-x64.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').with_command('rpm --force -iv /tmp/jdk-8u192-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-x64.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').that_requires('Archive[/tmp/jdk-8u192-linux-x64.rpm]') }
end end
context 'when Oracle Java SE 6 JRE' do context 'when Oracle Java SE 6 JRE' do
@@ -38,8 +38,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jre6' } let(:title) { 'jre6' }
it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64-rpm.bin') } it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64-rpm.bin') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').with_command('sh /tmp/jre-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('sh /tmp/jre-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-x64-rpm.bin]') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-x64-rpm.bin]') }
end end
context 'when Oracle Java SE 7 JRE' do context 'when Oracle Java SE 7 JRE' do
@@ -47,35 +47,35 @@ describe 'java::oracle', type: :define do
let(:title) { 'jre7' } let(:title) { 'jre7' }
it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.rpm') } it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').with_command('rpm --force -iv /tmp/jre-7u80-linux-x64.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('rpm --force -iv /tmp/jre-7u80-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-x64.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-x64.rpm]') }
end end
context 'when select Oracle Java SE 8 JRE' do context 'when select Oracle Java SE 8 JRE' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jre8' } let(:title) { 'jre8' }
it { is_expected.to contain_archive('/tmp/jre-8u131-linux-x64.rpm') } it { is_expected.to contain_archive('/tmp/jre-8u192-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').with_command('rpm --force -iv /tmp/jre-8u131-linux-x64.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').with_command('rpm --force -iv /tmp/jre-8u192-linux-x64.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').that_requires('Archive[/tmp/jre-8u131-linux-x64.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').that_requires('Archive[/tmp/jre-8u192-linux-x64.rpm]') }
end end
context 'when passing URL to url parameter' do context 'when passing URL to url parameter' do
let(:params) do let(:params) do
{ {
ensure: 'present', ensure: 'present',
version_major: '8u131', version_major: '8u192',
version_minor: 'b11', version_minor: 'b12',
java_se: 'jdk', java_se: 'jdk',
url: 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm', url: 'http://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.rpm',
url_hash: 'ignored', url_hash: 'ignored',
} }
end end
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { it {
is_expected.to contain_archive('/tmp/jdk-8u131-linux-x64.rpm') is_expected.to contain_archive('/tmp/jdk-8u192-linux-x64.rpm')
.with_source('http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm') .with_source('http://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.rpm')
} }
end end
@@ -83,15 +83,66 @@ describe 'java::oracle', type: :define do
let(:params) do let(:params) do
{ {
ensure: 'present', ensure: 'present',
version_major: '8u131', version_major: '8u192',
version_minor: 'b11', version_minor: 'b12',
java_se: 'jdk', java_se: 'jdk',
url_hash: 'abcdef01234567890', url_hash: '750e1c8617c5452694857ad95c3ee230',
} }
end end
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jdk-8u131-linux-x64.rpm').with_source('http://download.oracle.com/otn-pub/java/jdk//8u131-b11/abcdef01234567890/jdk-8u131-linux-x64.rpm') } it {
is_expected.to contain_archive('/tmp/jdk-8u192-linux-x64.rpm')
.with_source('http://download.oracle.com/otn-pub/java/jdk//8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.rpm')
}
end
context 'when installing multiple versions' do
let(:params) do
{
ensure: 'present',
version_major: '8u192',
version_minor: 'b12',
java_se: 'jdk',
url_hash: '750e1c8617c5452694857ad95c3ee230',
}
end
let(:title) { 'jdk8' }
let(:pre_condition) do
<<-EOL
java::oracle {
'jdk8121':
ensure => 'present',
version_major => '8u121',
version_minor => 'b13',
java_se => 'jdk',
url_hash => 'abcdef01234567890',
}
EOL
end
it { is_expected.to compile }
end
context 'when installing Oracle Java SE 6 JRE with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jre1.6.0_99-amd64/lib/security')
end
end
context 'when installing Oracle Java SE 6 JDK with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jdk1.6.0_99-amd64/jre/lib/security')
end
end end
end end
@@ -103,8 +154,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk6' } let(:title) { 'jdk6' }
it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-i586-rpm.bin') } it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-i586-rpm.bin') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').with_command('sh /tmp/jdk-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('sh /tmp/jdk-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-i586-rpm.bin]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-i586-rpm.bin]') }
end end
context 'when selecting Oracle Java SE 7 JDK on RedHat family, 32-bit' do context 'when selecting Oracle Java SE 7 JDK on RedHat family, 32-bit' do
@@ -112,17 +163,17 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk7' } let(:title) { 'jdk7' }
it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-i586.rpm') } it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').with_command('rpm --force -iv /tmp/jdk-7u80-linux-i586.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('rpm --force -iv /tmp/jdk-7u80-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-i586.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-i586.rpm]') }
end end
context 'when selecting Oracle Java SE 8 JDK on RedHat family, 32-bit' do context 'when selecting Oracle Java SE 8 JDK on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jdk-8u131-linux-i586.rpm') } it { is_expected.to contain_archive('/tmp/jdk-8u192-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').with_command('rpm --force -iv /tmp/jdk-8u131-linux-i586.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').with_command('rpm --force -iv /tmp/jdk-8u192-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-i586.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').that_requires('Archive[/tmp/jdk-8u192-linux-i586.rpm]') }
end end
context 'when selecting Oracle Java SE 6 JRE on RedHat family, 32-bit' do context 'when selecting Oracle Java SE 6 JRE on RedHat family, 32-bit' do
@@ -130,8 +181,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk6' } let(:title) { 'jdk6' }
it { is_expected.to contain_archive('/tmp/jre-6u45-linux-i586-rpm.bin') } it { is_expected.to contain_archive('/tmp/jre-6u45-linux-i586-rpm.bin') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').with_command('sh /tmp/jre-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('sh /tmp/jre-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-i586-rpm.bin]') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-i586-rpm.bin]') }
end end
context 'when select Oracle Java SE 7 JRE on RedHat family, 32-bit' do context 'when select Oracle Java SE 7 JRE on RedHat family, 32-bit' do
@@ -139,17 +190,65 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk7' } let(:title) { 'jdk7' }
it { is_expected.to contain_archive('/tmp/jre-7u80-linux-i586.rpm') } it { is_expected.to contain_archive('/tmp/jre-7u80-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').with_command('rpm --force -iv /tmp/jre-7u80-linux-i586.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('rpm --force -iv /tmp/jre-7u80-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-i586.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-i586.rpm]') }
end end
context 'when select Oracle Java SE 8 JRE on RedHat family, 32-bit' do context 'when select Oracle Java SE 8 JRE on RedHat family, 32-bit' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jre-8u131-linux-i586.rpm') } it { is_expected.to contain_archive('/tmp/jre-8u192-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').with_command('rpm --force -iv /tmp/jre-8u131-linux-i586.rpm') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').with_command('rpm --force -iv /tmp/jre-8u192-linux-i586.rpm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').that_requires('Archive[/tmp/jre-8u131-linux-i586.rpm]') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').that_requires('Archive[/tmp/jre-8u192-linux-i586.rpm]') }
end
context 'when installing multiple versions' do
let(:params) do
{
ensure: 'present',
version_major: '8u192',
version_minor: 'b12',
java_se: 'jdk',
url_hash: '750e1c8617c5452694857ad95c3ee230',
}
end
let(:title) { 'jdk8' }
let(:pre_condition) do
<<-EOL
java::oracle {
'jdk8121':
ensure => 'present',
version_major => '8u121',
version_minor => 'b13',
java_se => 'jdk',
url_hash => 'abcdef01234567890',
}
EOL
end
it { is_expected.to compile }
end
context 'when installing Oracle Java SE 6 JRE with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jre1.6.0_99-amd64/lib/security')
end
end
context 'when installing Oracle Java SE 6 JDK with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jdk1.6.0_99-amd64/jre/lib/security')
end
end end
end end
@@ -161,8 +260,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk6' } let(:title) { 'jdk6' }
it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').with_command('tar -zxf /tmp/jdk-6u45-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('tar -zxf /tmp/jdk-6u45-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 6').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') }
end end
context 'with Oracle Java SE 7 JDK' do context 'with Oracle Java SE 7 JDK' do
@@ -170,17 +269,17 @@ describe 'java::oracle', type: :define do
let(:title) { 'jdk7' } let(:title) { 'jdk7' }
it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').with_command('tar -zxf /tmp/jdk-7u80-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('tar -zxf /tmp/jdk-7u80-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 7').that_requires('Archive[/tmp/jdk-7u80-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-x64.tar.gz]') }
end end
context 'with Oracle Java SE 8 JDK' do context 'with Oracle Java SE 8 JDK' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } }
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jdk-8u131-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jdk-8u192-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').with_command('tar -zxf /tmp/jdk-8u131-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').with_command('tar -zxf /tmp/jdk-8u192-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jdk 8').that_requires('Archive[/tmp/jdk-8u131-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u192 b12').that_requires('Archive[/tmp/jdk-8u192-linux-x64.tar.gz]') }
end end
context 'with Oracle Java SE 6 JRE' do context 'with Oracle Java SE 6 JRE' do
@@ -188,8 +287,8 @@ describe 'java::oracle', type: :define do
let(:title) { 'jre6' } let(:title) { 'jre6' }
it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').with_command('tar -zxf /tmp/jre-6u45-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('tar -zxf /tmp/jre-6u45-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 6').that_requires('Archive[/tmp/jre-6u45-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-x64.tar.gz]') }
end end
context 'when Oracle Java SE 7 JRE' do context 'when Oracle Java SE 7 JRE' do
@@ -197,24 +296,72 @@ describe 'java::oracle', type: :define do
let(:title) { 'jre7' } let(:title) { 'jre7' }
it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').with_command('tar -zxf /tmp/jre-7u80-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('tar -zxf /tmp/jre-7u80-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 7').that_requires('Archive[/tmp/jre-7u80-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-x64.tar.gz]') }
end end
context 'when Oracle Java SE 8 JRE' do context 'when Oracle Java SE 8 JRE' do
let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } }
let(:title) { 'jre8' } let(:title) { 'jre8' }
it { is_expected.to contain_archive('/tmp/jre-8u131-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jre-8u192-linux-x64.tar.gz') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').with_command('tar -zxf /tmp/jre-8u131-linux-x64.tar.gz -C /usr/lib/jvm') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').with_command('tar -zxf /tmp/jre-8u192-linux-x64.tar.gz -C /usr/lib/jvm') }
it { is_expected.to contain_exec('Install Oracle java_se jre 8').that_requires('Archive[/tmp/jre-8u131-linux-x64.tar.gz]') } it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u192 b12').that_requires('Archive[/tmp/jre-8u192-linux-x64.tar.gz]') }
end end
context 'when passing URL to url parameter' do context 'when passing URL to url parameter' do
let(:params) { { ensure: 'present', version_major: '8u131', version_minor: 'b11', java_se: 'jdk', url: oracle_url.to_s } } let(:params) { { ensure: 'present', version_major: '8u192', version_minor: 'b12', java_se: 'jdk', url: oracle_url.to_s } }
let(:title) { 'jdk8' } let(:title) { 'jdk8' }
it { is_expected.to contain_archive('/tmp/jdk-8u131-linux-x64.tar.gz') } it { is_expected.to contain_archive('/tmp/jdk-8u192-linux-x64.tar.gz') }
end
context 'when installing multiple versions' do
let(:params) do
{
ensure: 'present',
version_major: '8u192',
version_minor: 'b12',
java_se: 'jdk',
url_hash: '750e1c8617c5452694857ad95c3ee230',
}
end
let(:title) { 'jdk8' }
let(:pre_condition) do
<<-EOL
java::oracle {
'jdk8121':
ensure => 'present',
version_major => '8u121',
version_minor => 'b13',
java_se => 'jdk',
url_hash => 'abcdef01234567890',
}
EOL
end
it { is_expected.to compile }
end
context 'when installing Oracle Java SE 6 JRE with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/lib/jvm/jre1.6.0_99/lib/security')
end
end
context 'when installing Oracle Java SE 6 JDK with JCE' do
let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } }
let(:title) { 'jre6jce' }
it do
is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip')
is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/lib/jvm/jdk1.6.0_99/jre/lib/security')
end
end end
end end
describe 'incompatible OSes' do describe 'incompatible OSes' do

View File

@@ -1,12 +1,7 @@
require 'puppetlabs_spec_helper/module_spec_helper' require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts' require 'rspec-puppet-facts'
begin require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
rescue LoadError => loaderror
warn "Could not require spec_helper_local: #{loaderror.message}"
end
include RspecPuppetFacts include RspecPuppetFacts
@@ -15,15 +10,19 @@ default_facts = {
facterversion: Facter.version, facterversion: Facter.version,
} }
default_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')) default_fact_files = [
default_module_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')) File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')),
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')),
]
if File.exist?(default_facts_path) && File.readable?(default_facts_path) default_fact_files.each do |f|
default_facts.merge!(YAML.safe_load(File.read(default_facts_path))) next unless File.exist?(f) && File.readable?(f) && File.size?(f)
end
if File.exist?(default_module_facts_path) && File.readable?(default_module_facts_path) begin
default_facts.merge!(YAML.safe_load(File.read(default_module_facts_path))) default_facts.merge!(YAML.safe_load(File.read(f)))
rescue => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end
end end
RSpec.configure do |c| RSpec.configure do |c|
@@ -37,8 +36,8 @@ end
def ensure_module_defined(module_name) def ensure_module_defined(module_name)
module_name.split('::').reduce(Object) do |last_module, next_module| module_name.split('::').reduce(Object) do |last_module, next_module|
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module) last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false)
last_module.const_get(next_module) last_module.const_get(next_module, false)
end end
end end

View File

@@ -1,8 +1,11 @@
require 'beaker-pe'
require 'beaker-puppet'
require 'beaker-rspec' require 'beaker-rspec'
require 'beaker/puppet_install_helper' require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper' require 'beaker/module_install_helper'
run_puppet_install_helper run_puppet_install_helper
configure_type_defaults_on(hosts)
install_module_on(hosts) install_module_on(hosts)
install_module_dependencies_on(hosts) install_module_dependencies_on(hosts)