Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F11012766
java_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Subscribers
None
java_spec.rb
View Options
require
'spec_helper'
describe
'java'
,
:type
=>
:class
do
context
'select openjdk for Centos 5.8'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Centos'
,
:operatingsystemrelease
=>
'5.8'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.6.0-openjdk-devel'
)
}
end
context
'select openjdk for Centos 6.3'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Centos'
,
:operatingsystemrelease
=>
'6.3'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.7.0-openjdk-devel'
)
}
end
context
'select openjdk for Centos 6.2'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Centos'
,
:operatingsystemrelease
=>
'6.2'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.6.0-openjdk-devel'
)
}
end
context
'select passed value for Centos 5.3'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Centos'
,
:operatingsystemrelease
=>
'5.3'
}
}
let
(
:params
)
{
{
'package'
=>
'jdk'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'jdk'
)
}
it
{
should_not
contain_exec
(
'update-java-alternatives'
)
}
end
context
'select default for Centos 5.3'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Centos'
,
:operatingsystemrelease
=>
'5.3'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.6.0-openjdk-devel'
)
}
it
{
should_not
contain_exec
(
'update-java-alternatives'
)
}
end
context
'select default for Debian Wheezy'
do
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistcodename
=>
'wheezy'
,
:operatingsystemrelease
=>
'7.1'
,
:architecture
=>
'amd64'
,}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'openjdk-7-jdk'
)
}
it
{
should
contain_exec
(
'update-java-alternatives'
)
.
with_command
(
'update-java-alternatives --set java-1.7.0-openjdk-amd64 --jre'
)
}
end
context
'select Oracle JRE for Debian Wheezy'
do
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistcodename
=>
'wheezy'
,
:operatingsystemrelease
=>
'7.1'
,
}
}
let
(
:params
)
{
{
'distribution'
=>
'oracle-jre'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'oracle-j2re1.7'
)
}
it
{
should
contain_exec
(
'update-java-alternatives'
)
.
with_command
(
'update-java-alternatives --set j2re1.7-oracle --jre'
)
}
end
context
'select default for Debian Squeeze'
do
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistcodename
=>
'squeeze'
,
:operatingsystemrelease
=>
'6.0.5'
}
}
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'
)
}
end
context
'select Oracle JRE for Debian Squeeze'
do
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistcodename
=>
'squeeze'
,
:operatingsystemrelease
=>
'6.0.5'
}
}
let
(
:params
)
{
{
'distribution'
=>
'sun-jre'
,
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'sun-java6-jre'
)
}
it
{
should
contain_exec
(
'update-java-alternatives'
)
.
with_command
(
'update-java-alternatives --set java-6-sun --jre'
)
}
end
context
'select random alternative for Debian Wheezy'
do
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistcodename
=>
'wheezy'
,
:operatingsystemrelease
=>
'7.1'
}
}
let
(
:params
)
{
{
'java_alternative'
=>
'bananafish'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'openjdk-7-jdk'
)
}
it
{
should
contain_exec
(
'update-java-alternatives'
)
.
with_command
(
'update-java-alternatives --set bananafish --jre'
)
}
end
context
'select openjdk for Amazon Linux'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Amazon'
,
:operatingsystemrelease
=>
'3.4.43-43.43.amzn1.x86_64'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.7.0-openjdk-devel'
)
}
end
context
'select passed value for Amazon Linux'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'Amazon'
,
:operatingsystemrelease
=>
'5.3.4.43-43.43.amzn1.x86_64'
}
}
let
(
:params
)
{
{
'distribution'
=>
'jre'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.7.0-openjdk'
)
}
end
context
'select openjdk for Oracle Linux'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'OracleLinux'
,
:operatingsystemrelease
=>
'6.4'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.7.0-openjdk-devel'
)
}
end
context
'select openjdk for Oracle Linux 6.2'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'OracleLinux'
,
:operatingsystemrelease
=>
'6.2'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.6.0-openjdk-devel'
)
}
end
context
'select passed value for Oracle Linux'
do
let
(
:facts
)
{
{
:osfamily
=>
'RedHat'
,
:operatingsystem
=>
'OracleLinux'
,
:operatingsystemrelease
=>
'6.3'
}
}
let
(
:params
)
{
{
'distribution'
=>
'jre'
}
}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1.7.0-openjdk'
)
}
end
context
'select default for OpenSUSE 12.3'
do
let
(
:facts
)
{
{
:osfamily
=>
'Suse'
,
:operatingsystem
=>
'OpenSUSE'
,
:operatingsystemrelease
=>
'12.3'
}}
it
{
should
contain_package
(
'java'
)
.
with_name
(
'java-1_7_0-openjdk-devel'
)}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Thu, Sep 18, 4:32 AM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3279992
Attached To
R145 puppet-puppetlabs-java
Event Timeline
Log In to Comment