Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb34cb71cd | ||
|
|
e849b5029c | ||
|
|
db0f428a66 | ||
|
|
fb38145cd4 | ||
|
|
92d53c084e | ||
|
|
4cf0088f91 | ||
|
|
3648bd8b70 | ||
|
|
30a5311d73 | ||
|
|
c781b2fa63 | ||
|
|
9823d8eefd | ||
|
|
353e5ee694 | ||
|
|
6556d18c86 | ||
|
|
eae176c5b0 | ||
|
|
096196bd89 | ||
|
|
a231ce8891 | ||
|
|
f519b26dbc | ||
|
|
cdc30ce467 | ||
|
|
d0a7a72631 | ||
|
|
4bcc4e732a | ||
|
|
e4628a345c | ||
|
|
67486853f2 | ||
|
|
f09c5e9a17 | ||
|
|
ee402d8057 | ||
|
|
f99141b895 | ||
|
|
ce08df1647 | ||
|
|
46e6feee7c | ||
|
|
7e8d9587a9 | ||
|
|
8d1b89b43d | ||
|
|
dcdc96187d | ||
|
|
230ab22adf | ||
|
|
5683eaf74e | ||
|
|
66245138f4 | ||
|
|
502c94b8ed | ||
|
|
a089f326ca |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
pkg/
|
pkg/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
metadata.json
|
|
||||||
spec/fixtures
|
spec/fixtures
|
||||||
*.idea
|
*.idea
|
||||||
*.swp
|
*.swp
|
||||||
|
|||||||
10
CHANGELOG
10
CHANGELOG
@@ -1,3 +1,13 @@
|
|||||||
|
2014-08-25 - Supported Version 1.1.2
|
||||||
|
|
||||||
|
Summary: This release begins the support coverage of the puppetlabs-java
|
||||||
|
module.
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
- Update java alternative values from deprecated names
|
||||||
|
- Readme updated
|
||||||
|
- Testing updated
|
||||||
|
|
||||||
2014-05-02 - Version 1.1.1
|
2014-05-02 - Version 1.1.1
|
||||||
|
|
||||||
Summary:
|
Summary:
|
||||||
|
|||||||
36
Gemfile
36
Gemfile
@@ -1,15 +1,27 @@
|
|||||||
source "http://rubygems.org"
|
source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
||||||
|
|
||||||
if ENV.key?('PUPPET_VERSION')
|
group :development, :test do
|
||||||
puppetversion = "= #{ENV['PUPPET_VERSION']}"
|
gem 'rake', :require => false
|
||||||
elsif ENV.key?('PUPPET_GEM_VERSION')
|
gem 'rspec-puppet', :require => false
|
||||||
puppetversion = ENV['PUPPET_GEM_VERSION']
|
gem 'puppetlabs_spec_helper', :require => false
|
||||||
else
|
gem 'serverspec', :require => false
|
||||||
puppetversion = ['~> 2.7']
|
gem 'puppet-lint', :require => false
|
||||||
|
gem 'beaker', :require => false
|
||||||
|
gem 'beaker-rspec', :require => false
|
||||||
|
gem 'pry', :require => false
|
||||||
|
gem 'simplecov', :require => false
|
||||||
end
|
end
|
||||||
|
|
||||||
gem "rake"
|
if facterversion = ENV['FACTER_GEM_VERSION']
|
||||||
gem "puppet", puppetversion
|
gem 'facter', facterversion, :require => false
|
||||||
gem "puppet-lint"
|
else
|
||||||
gem "rspec-puppet"
|
gem 'facter', :require => false
|
||||||
gem "puppetlabs_spec_helper"
|
end
|
||||||
|
|
||||||
|
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||||
|
gem 'puppet', puppetversion, :require => false
|
||||||
|
else
|
||||||
|
gem 'puppet', :require => false
|
||||||
|
end
|
||||||
|
|
||||||
|
# vim:ft=ruby
|
||||||
|
|||||||
43
Gemfile.lock
43
Gemfile.lock
@@ -1,43 +0,0 @@
|
|||||||
GEM
|
|
||||||
remote: http://rubygems.org/
|
|
||||||
specs:
|
|
||||||
diff-lcs (1.2.2)
|
|
||||||
facter (1.7.2)
|
|
||||||
hiera (1.2.1)
|
|
||||||
json_pure
|
|
||||||
json_pure (1.8.0)
|
|
||||||
metaclass (0.0.1)
|
|
||||||
mocha (0.13.3)
|
|
||||||
metaclass (~> 0.0.1)
|
|
||||||
puppet (3.2.3)
|
|
||||||
facter (~> 1.6)
|
|
||||||
hiera (~> 1.0)
|
|
||||||
rgen (~> 0.6.5)
|
|
||||||
puppet-lint (0.3.2)
|
|
||||||
puppetlabs_spec_helper (0.4.1)
|
|
||||||
mocha (>= 0.10.5)
|
|
||||||
rake
|
|
||||||
rspec (>= 2.9.0)
|
|
||||||
rspec-puppet (>= 0.1.1)
|
|
||||||
rake (10.0.4)
|
|
||||||
rgen (0.6.5)
|
|
||||||
rspec (2.13.0)
|
|
||||||
rspec-core (~> 2.13.0)
|
|
||||||
rspec-expectations (~> 2.13.0)
|
|
||||||
rspec-mocks (~> 2.13.0)
|
|
||||||
rspec-core (2.13.1)
|
|
||||||
rspec-expectations (2.13.0)
|
|
||||||
diff-lcs (>= 1.1.3, < 2.0)
|
|
||||||
rspec-mocks (2.13.0)
|
|
||||||
rspec-puppet (0.1.6)
|
|
||||||
rspec
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
puppet (~> 3.2.0)
|
|
||||||
puppet-lint
|
|
||||||
puppetlabs_spec_helper
|
|
||||||
rake
|
|
||||||
rspec-puppet
|
|
||||||
10
Modulefile
10
Modulefile
@@ -1,10 +0,0 @@
|
|||||||
name 'puppetlabs-java'
|
|
||||||
version '1.1.1'
|
|
||||||
source 'git://github.com/puppetlabs/puppetlabs-java'
|
|
||||||
author 'puppetlabs'
|
|
||||||
license 'Apache'
|
|
||||||
summary 'Manage the official Java runtime'
|
|
||||||
description 'Manage the official Java runtime'
|
|
||||||
project_page 'https://github.com/puppetlabs/puppetlabs-java'
|
|
||||||
|
|
||||||
dependency 'puppetlabs/stdlib', '>= 0.1.6'
|
|
||||||
@@ -1,5 +1,96 @@
|
|||||||
#Java
|
#java
|
||||||
|
|
||||||
Manage the Java runtime for use with other application software.
|
####Table of Contents
|
||||||
|
|
||||||
Currently this deploys the correct Java package on a variety of platforms.
|
1. [Overview](#overview)
|
||||||
|
2. [Module Description - What the module does and why it is useful](#module-description)
|
||||||
|
3. [Setup - The basics of getting started with the java module](#setup)
|
||||||
|
* [Beginning with the java module](#beginning-with-the-java-module)
|
||||||
|
4. [Usage - Configuration options and additional functionality](#usage)
|
||||||
|
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
|
||||||
|
5. [Limitations - OS compatibility, etc.](#limitations)
|
||||||
|
6. [Development - Guide for contributing to the module](#development)
|
||||||
|
|
||||||
|
##Overview
|
||||||
|
|
||||||
|
Installs the correct Java package on various platforms.
|
||||||
|
|
||||||
|
##Module Description
|
||||||
|
|
||||||
|
The java module can automatically install Java jdk or jre on a wide variety of systems. Java is a base component for many software platforms, but Java system packages don't always follow packaging conventions. The java module simplifies the Java installation process.
|
||||||
|
|
||||||
|
##Setup
|
||||||
|
|
||||||
|
###Beginning with the java module
|
||||||
|
To install the correct Java package on your system, include the `java` class: `include java`.
|
||||||
|
|
||||||
|
##Usage
|
||||||
|
|
||||||
|
The java module installs the correct jdk or jre package on a wide variety of systems. By default, the module will install the jdk package, but you can set different installation parameters as needed. For example, to install jre instead of jdk, you would set the distribution parameter:
|
||||||
|
|
||||||
|
```
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'jre',
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##Reference
|
||||||
|
|
||||||
|
###Classes
|
||||||
|
|
||||||
|
####Public classes
|
||||||
|
|
||||||
|
* `java`: This is the module's main class, which installs and manages the Java package.
|
||||||
|
|
||||||
|
####Private classes
|
||||||
|
|
||||||
|
* `java::params`: Builds a hash of jdk/jre packages for all compatible operating systems.
|
||||||
|
|
||||||
|
* `java::config`: Configures the Java alternatives on Debian systems.
|
||||||
|
|
||||||
|
###Parameters:
|
||||||
|
|
||||||
|
The following parameters are available in the java module:
|
||||||
|
|
||||||
|
* `distribution`: The Java distribution to install. Can be 'jdk','jre', or, where the platform supports alternative packages, 'sun-jdk', 'sun-jre', 'oracle-jdk', 'oracle-jre'. Defaults to 'jdk'.
|
||||||
|
|
||||||
|
*`version`: The version of Java to install, if you want to ensure a particular version. By default, the module ensures that Java is present but does not require a specific version.
|
||||||
|
|
||||||
|
* `package`: The name of the Java package. This is configurable in case you want to install a non-standard Java package. If not set, the module will install the appropriate package for the `distribution` parameter and target platform. If you set `package`, the `distribution` parameter will do nothing.
|
||||||
|
|
||||||
|
* `java_alternative`: The name of the Java alternative to use on Debian systems. The command 'update-java-alternatives -l' will show which choices are available. If you specify a particular package, you will usually want to specify which Java alternative to use. If you set this parameter, you also need to set the `java_alternative_path`.
|
||||||
|
|
||||||
|
* `java_alternative_path`: The path to the 'java' command on Debian systems. Since the alternatives system makes it difficult to verify which alternative is actually enabled, this is required to ensure the correct JVM is enabled.
|
||||||
|
|
||||||
|
##Limitations
|
||||||
|
|
||||||
|
This module cannot guarantee installation of Java versions that are not available on platform repositories.
|
||||||
|
|
||||||
|
Oracle Java packages are not included in Debian 7 and Ubuntu 12.04/14.04 repositories. To install Java on those systems, you'll need to package Oracle JDK/JRE, and then the module will be able to install the package. For more information on how to package Oracle JDK/JRE, see the [Debian wiki](http://wiki.debian.org/JavaPackage).
|
||||||
|
|
||||||
|
This module is officially [supported](https://forge.puppetlabs.com/supported) for the following Java versions and platforms:
|
||||||
|
|
||||||
|
OpenJDK is supported on:
|
||||||
|
* Red Hat Enterprise Linux (RHEL) 5, 6, 7
|
||||||
|
* CentOS 5, 6, 7
|
||||||
|
* Oracle Linux 6, 7
|
||||||
|
* Scientific Linux 5, 6
|
||||||
|
* Debian 6, 7
|
||||||
|
* Ubuntu 10.04, 12.04, 14.04
|
||||||
|
* Solaris 11
|
||||||
|
* SLES 11 SP1
|
||||||
|
|
||||||
|
Sun Java is supported on:
|
||||||
|
* Debian 6
|
||||||
|
|
||||||
|
##Development
|
||||||
|
|
||||||
|
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
|
||||||
|
|
||||||
|
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
|
||||||
|
|
||||||
|
You can read the complete module contribution guide on the [Puppet Labs wiki](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing).
|
||||||
|
|
||||||
|
##Contributors
|
||||||
|
|
||||||
|
The list of contributors can be found at: [https://github.com/puppetlabs/puppetlabs-java/graphs/contributors](https://github.com/puppetlabs/puppetlabs-java/graphs/contributors).
|
||||||
|
|||||||
@@ -52,13 +52,13 @@ class java::params {
|
|||||||
$java = {
|
$java = {
|
||||||
'jdk' => {
|
'jdk' => {
|
||||||
'package' => 'openjdk-6-jdk',
|
'package' => 'openjdk-6-jdk',
|
||||||
'alternative' => 'java-6-openjdk',
|
'alternative' => "java-6-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',
|
'alternative' => "java-6-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/',
|
||||||
},
|
},
|
||||||
|
|||||||
85
metadata.json
Normal file
85
metadata.json
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"name": "puppetlabs-java",
|
||||||
|
"version": "1.1.2",
|
||||||
|
"author": "puppetlabs",
|
||||||
|
"summary": "Manage the official Java runtime",
|
||||||
|
"license": "Apache",
|
||||||
|
"source": "git://github.com/puppetlabs/puppetlabs-java",
|
||||||
|
"project_page": "https://github.com/puppetlabs/puppetlabs-java",
|
||||||
|
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
|
||||||
|
"operatingsystem_support": [
|
||||||
|
{
|
||||||
|
"operatingsystem": "RedHat",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"5",
|
||||||
|
"6",
|
||||||
|
"7"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "CentOS",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"5",
|
||||||
|
"6",
|
||||||
|
"7"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "OracleLinux",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"6",
|
||||||
|
"7"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "Scientific",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"5",
|
||||||
|
"6"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "Debian",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"6",
|
||||||
|
"7"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "Ubuntu",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"10.04",
|
||||||
|
"12.04",
|
||||||
|
"14.04"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "SLES",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"11 SP1"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"operatingsystem": "Solaris",
|
||||||
|
"operatingsystemrelease": [
|
||||||
|
"11"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requirements": [
|
||||||
|
{
|
||||||
|
"name": "pe",
|
||||||
|
"version_requirement": "3.x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "puppet",
|
||||||
|
"version_requirement": "3.x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
{
|
||||||
|
"name": "puppetlabs/stdlib",
|
||||||
|
"version_requirement": ">= 2.4.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
212
spec/acceptance/install_spec.rb
Normal file
212
spec/acceptance/install_spec.rb
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
|
#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 after 6.3 : OpenJDK Java JDK/JRE 1.7
|
||||||
|
#Debian 5/6 & Ubuntu 10.04/11.04 : OpenJDK Java JDK/JRE 1.6 or Sun Java JDK/JRE 1.6
|
||||||
|
#Debian 7/Jesse & Ubuntu 12.04 - 14.04 : OpenJDK Java JDK/JRE 1.7 or Oracle Java JDK/JRE 1.6
|
||||||
|
#Solaris (what versions?) : Java JDK/JRE 1.7
|
||||||
|
#OpenSuSE : OpenJDK Java JDK/JRE 1.7
|
||||||
|
#SLES : IBM Java JDK/JRE 1.6
|
||||||
|
|
||||||
|
# C14677
|
||||||
|
# C14678
|
||||||
|
# C14679
|
||||||
|
# C14680
|
||||||
|
# C14681
|
||||||
|
# C14682
|
||||||
|
# C14684
|
||||||
|
# C14687
|
||||||
|
# C14692
|
||||||
|
# C14696
|
||||||
|
# C14697
|
||||||
|
# C14700 check on solaris 11
|
||||||
|
# C14701 check on sles 11
|
||||||
|
# C14703
|
||||||
|
# C14723 Where is oracle linux 5?
|
||||||
|
# C14724 Where is oracle linux 5?
|
||||||
|
# C14771 Where is redhat 7? Centos 7?
|
||||||
|
describe "installing java", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
|
describe "jre" do
|
||||||
|
it 'should install jre' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'jre',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
apply_manifest(pp, :catch_changes => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
describe "jdk" do
|
||||||
|
it 'should install jdk' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java': }
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
apply_manifest(pp, :catch_changes => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# C14686
|
||||||
|
describe 'sun', :if => (fact('operatingsystem') == 'Debian' and fact('operatingsystemrelease').match(/(5|6)/)) do
|
||||||
|
before :all do
|
||||||
|
pp = <<-EOS
|
||||||
|
file_line { 'non-free source':
|
||||||
|
path => '/etc/apt/sources.list',
|
||||||
|
match => "deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main",
|
||||||
|
line => "deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free",
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
apply_manifest(pp)
|
||||||
|
shell('apt-get update')
|
||||||
|
shell('echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true" | debconf-set-selections')
|
||||||
|
shell('echo "sun-java6-jre shared/accepted-sun-dlj-v1-1 select true" | debconf-set-selections')
|
||||||
|
end
|
||||||
|
describe 'jre' do
|
||||||
|
it 'should install sun-jre' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'sun-jre',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
apply_manifest(pp, :catch_changes => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
describe 'jdk' do
|
||||||
|
it 'should install sun-jdk' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'sun-jdk',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
apply_manifest(pp, :catch_changes => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# C14704
|
||||||
|
# C14705
|
||||||
|
# C15006
|
||||||
|
describe 'oracle', :if => (
|
||||||
|
(fact('operatingsystem') == 'Debian') and (fact('operatingsystemrelease').match(/^7/)) or
|
||||||
|
(fact('operatingsystem') == 'Ubuntu') and (fact('operatingsystemrelease').match(/^12\.04/)) or
|
||||||
|
(fact('operatingsystem') == 'Ubuntu') and (fact('operatingsystemrelease').match(/^14\.04/))
|
||||||
|
) do
|
||||||
|
# not supported
|
||||||
|
# The package is not available from any sources, but if a customer
|
||||||
|
# custom-builds the package using java-package and adds it to a local
|
||||||
|
# repository, that is the intention of this version ability
|
||||||
|
describe 'jre' do
|
||||||
|
it 'should install oracle-jre' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'oracle-jre',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
describe 'jdk' do
|
||||||
|
it 'should install oracle-jdk' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'oracle-jdk',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'failure cases' do
|
||||||
|
# C14711
|
||||||
|
it 'should fail to install java with an incorrect version' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
version => '14.5',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
# C14712
|
||||||
|
it 'should fail to install java with a blank version' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
version => '',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
# C14713
|
||||||
|
it 'should fail to install java with an incorrect distribution' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => 'xyz',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
# C14714
|
||||||
|
it 'should fail to install java with a blank distribution' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
distribution => '',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
# C14715
|
||||||
|
it 'should fail to install java with an incorrect package' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
package => 'xyz',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
# C14715
|
||||||
|
it 'should fail to install java with an incorrect package' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
package => 'xyz',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
end
|
||||||
|
# C14717
|
||||||
|
# C14719
|
||||||
|
# C14725
|
||||||
|
it 'should fail on debian when passed fake java_alternative and path' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'java':
|
||||||
|
java_alternative => 'whatever',
|
||||||
|
java_alternative_path => '/whatever',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
|
||||||
|
if fact('osfamily') == 'Debian'
|
||||||
|
apply_manifest(pp, :expect_failures => true)
|
||||||
|
else
|
||||||
|
apply_manifest(pp, :catch_failures => true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
15
spec/acceptance/nodesets/centos-5-vcloud.yml
Normal file
15
spec/acceptance/nodesets/centos-5-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'centos-5-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-5-x86_64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: centos-5-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
12
spec/acceptance/nodesets/centos-59-x64-pe.yml
Normal file
12
spec/acceptance/nodesets/centos-59-x64-pe.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-59-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
- database
|
||||||
|
- console
|
||||||
|
platform: el-5-x86_64
|
||||||
|
box : centos-59-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: pe
|
||||||
10
spec/acceptance/nodesets/centos-59-x64.yml
Normal file
10
spec/acceptance/nodesets/centos-59-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-59-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-5-x86_64
|
||||||
|
box : centos-59-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: git
|
||||||
15
spec/acceptance/nodesets/centos-6-vcloud.yml
Normal file
15
spec/acceptance/nodesets/centos-6-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'centos-6-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: centos-6-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
10
spec/acceptance/nodesets/centos-64-x64-fusion.yml
Normal file
10
spec/acceptance/nodesets/centos-64-x64-fusion.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-fusion503-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-fusion503-nocm.box
|
||||||
|
hypervisor : fusion
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
12
spec/acceptance/nodesets/centos-64-x64-pe.yml
Normal file
12
spec/acceptance/nodesets/centos-64-x64-pe.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
- database
|
||||||
|
- dashboard
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: pe
|
||||||
10
spec/acceptance/nodesets/centos-64-x64.yml
Normal file
10
spec/acceptance/nodesets/centos-64-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
10
spec/acceptance/nodesets/centos-65-x64.yml
Normal file
10
spec/acceptance/nodesets/centos-65-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-65-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-65-x64-vbox436-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
15
spec/acceptance/nodesets/centos-7-vcloud.yml
Normal file
15
spec/acceptance/nodesets/centos-7-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'centos-7-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-7-x86_64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: centos-7-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
15
spec/acceptance/nodesets/debian-6-vcloud.yml
Normal file
15
spec/acceptance/nodesets/debian-6-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'debian-6-amd64':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: debian-6-amd64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: debian-6-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
10
spec/acceptance/nodesets/debian-607-x64.yml
Normal file
10
spec/acceptance/nodesets/debian-607-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
debian-607-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: debian-6-amd64
|
||||||
|
box : debian-607-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: git
|
||||||
15
spec/acceptance/nodesets/debian-7-vcloud.yml
Normal file
15
spec/acceptance/nodesets/debian-7-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'debian-7-amd64':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: debian-7-amd64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: debian-7-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
10
spec/acceptance/nodesets/debian-70rc1-x64.yml
Normal file
10
spec/acceptance/nodesets/debian-70rc1-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
debian-70rc1-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: debian-7-amd64
|
||||||
|
box : debian-70rc1-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: git
|
||||||
10
spec/acceptance/nodesets/default.yml
Normal file
10
spec/acceptance/nodesets/default.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
10
spec/acceptance/nodesets/fedora-18-x64.yml
Normal file
10
spec/acceptance/nodesets/fedora-18-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
fedora-18-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: fedora-18-x86_64
|
||||||
|
box : fedora-18-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: git
|
||||||
15
spec/acceptance/nodesets/redhat-7-vcloud.yml
Normal file
15
spec/acceptance/nodesets/redhat-7-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'redhat-7-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-7-x86_64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: redhat-7-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
16
spec/acceptance/nodesets/sles-11-vcloud.yml
Normal file
16
spec/acceptance/nodesets/sles-11-vcloud.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
HOSTS:
|
||||||
|
'sles-11-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: sles-11-x86_64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: sles-11-x86_64
|
||||||
|
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
10
spec/acceptance/nodesets/sles-11sp1-x64.yml
Normal file
10
spec/acceptance/nodesets/sles-11sp1-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
sles-11sp1-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: sles-11-x86_64
|
||||||
|
box : sles-11sp1-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: git
|
||||||
15
spec/acceptance/nodesets/solaris-11-vcloud.yml
Normal file
15
spec/acceptance/nodesets/solaris-11-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'solaris-11-vcloud':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: solaris-11-i386
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: solaris-11-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
15
spec/acceptance/nodesets/ubuntu-1004-vcloud.yml
Normal file
15
spec/acceptance/nodesets/ubuntu-1004-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'ubuntu-1004-amd64':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-10.04-amd64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: ubuntu-1004-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
15
spec/acceptance/nodesets/ubuntu-1404-vcloud.yml
Normal file
15
spec/acceptance/nodesets/ubuntu-1404-vcloud.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
HOSTS:
|
||||||
|
'ubuntu-1404-amd64':
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-14.04-amd64
|
||||||
|
hypervisor: vcloud
|
||||||
|
template: ubuntu-1404-x86_64
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
|
ssh:
|
||||||
|
keys: "~/.ssh/id_rsa-acceptance"
|
||||||
|
datastore: instance0
|
||||||
|
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
||||||
|
pooling_api: http://vcloud.delivery.puppetlabs.net/
|
||||||
10
spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
Normal file
10
spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-server-10044-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-10.04-amd64
|
||||||
|
box : ubuntu-server-10044-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
10
spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
Normal file
10
spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-server-12042-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-12.04-amd64
|
||||||
|
box : ubuntu-server-12042-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
||||||
11
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
Normal file
11
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
HOSTS:
|
||||||
|
ubuntu-server-1404-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-14.04-amd64
|
||||||
|
box : puppetlabs/ubuntu-14.04-64-nocm
|
||||||
|
box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
log_level : debug
|
||||||
|
type: git
|
||||||
@@ -55,9 +55,9 @@ describe 'java', :type => :class do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'select default for Debian Squeeze' do
|
context 'select default for Debian Squeeze' do
|
||||||
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5'} }
|
let(:facts) { {:osfamily => 'Debian', :operatingsystem => 'Debian', :lsbdistcodename => 'squeeze', :operatingsystemrelease => '6.0.5', :architecture => 'amd64',} }
|
||||||
it { should contain_package('java').with_name('openjdk-6-jdk') }
|
it { should contain_package('java').with_name('openjdk-6-jdk') }
|
||||||
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-openjdk --jre') }
|
it { should contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-6-openjdk-amd64 --jre') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'select Oracle JRE for Debian Squeeze' do
|
context 'select Oracle JRE for Debian Squeeze' do
|
||||||
@@ -112,4 +112,43 @@ describe 'java', :type => :class do
|
|||||||
it { should contain_package('java').with_name('java-1_7_0-openjdk-devel')}
|
it { should contain_package('java').with_name('java-1_7_0-openjdk-devel')}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'incompatible OSs' do
|
||||||
|
[
|
||||||
|
{
|
||||||
|
# C14706
|
||||||
|
:osfamily => 'windows',
|
||||||
|
:operatingsystem => 'windows',
|
||||||
|
:operatingsystemrelease => '8.1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
# C14707
|
||||||
|
:osfamily => 'Darwin',
|
||||||
|
:operatingsystem => 'Darwin',
|
||||||
|
:operatingsystemrelease => '13.3.0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
# C14708
|
||||||
|
:osfamily => 'AIX',
|
||||||
|
:operatingsystem => 'AIX',
|
||||||
|
:operatingsystemrelease => '7100-02-00-000',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
# C14708
|
||||||
|
:osfamily => 'AIX',
|
||||||
|
:operatingsystem => 'AIX',
|
||||||
|
:operatingsystemrelease => '6100-07-04-1216',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
# C14708
|
||||||
|
:osfamily => 'AIX',
|
||||||
|
:operatingsystem => 'AIX',
|
||||||
|
:operatingsystemrelease => '5300-12-01-1016',
|
||||||
|
},
|
||||||
|
].each do |facts|
|
||||||
|
let(:facts) { facts }
|
||||||
|
it "should fail on #{facts[:operatingsystem]} #{facts[:operatingsystemrelease]}" do
|
||||||
|
expect { subject }.to raise_error Puppet::Error, /unsupported platform/
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
39
spec/spec_helper_acceptance.rb
Normal file
39
spec/spec_helper_acceptance.rb
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
require 'beaker-rspec'
|
||||||
|
|
||||||
|
UNSUPPORTED_PLATFORMS = [ "Darwin", "windows" ]
|
||||||
|
|
||||||
|
unless ENV["RS_PROVISION"] == "no" or ENV["BEAKER_provision"] == "no"
|
||||||
|
# This will install the latest available package on el and deb based
|
||||||
|
# systems fail on windows and osx, and install via gem on other *nixes
|
||||||
|
foss_opts = { :default_action => 'gem_install' }
|
||||||
|
|
||||||
|
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
|
||||||
|
|
||||||
|
hosts.each do |host|
|
||||||
|
if host["platform"] =~ /solaris/
|
||||||
|
on host, "echo 'export PATH=/opt/puppet/bin:/var/ruby/1.8/gem_home/bin:${PATH}' >> ~/.bashrc"
|
||||||
|
end
|
||||||
|
unless host.is_pe?
|
||||||
|
on host, "/bin/mkdir -p #{host["puppetpath"]}"
|
||||||
|
on host, "/bin/echo '' > #{host["hieraconf"]}"
|
||||||
|
end
|
||||||
|
on host, "mkdir -p #{host["distmoduledir"]}"
|
||||||
|
on host, "puppet module install puppetlabs-stdlib", :acceptable_exit_codes => [0,1]
|
||||||
|
# For test support
|
||||||
|
on host, "puppet module install puppetlabs-apt", :acceptable_exit_codes => [0,1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
RSpec.configure do |c|
|
||||||
|
# Project root
|
||||||
|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
||||||
|
|
||||||
|
# Readable test descriptions
|
||||||
|
c.formatter = :documentation
|
||||||
|
|
||||||
|
# Configure all nodes in nodeset
|
||||||
|
c.before :suite do
|
||||||
|
# Install module
|
||||||
|
puppet_module_install(:source => proj_root, :module_name => "java")
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user