Skip to content

Commit 798a8c3

Browse files
committed
Add support for Debian 13 and Ubuntu 26.04
Set default OpenJDK to 21 for Ubuntu 26.04 in params.pp Add Ubuntu 26.04 to supported OS releases in metadata.json Extend parameterized tests for Ubuntu 18.04 to include 20.04 and 22.04 (openjdk-11) Add separate tests for Ubuntu 24.04 (openjdk-17) and 26.04 (openjdk-21)
1 parent 5343a33 commit 798a8c3

3 files changed

Lines changed: 47 additions & 8 deletions

File tree

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
default => $facts['os']['architecture']
5959
}
6060
case $facts['os']['release']['major'] {
61-
'13': {
61+
'13', '26.04': {
6262
$openjdk = 21
6363
}
6464
'12', '24.04': {

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"18.04",
5656
"20.04",
5757
"22.04",
58-
"24.04"
58+
"24.04",
59+
"26.04"
5960
]
6061
},
6162
{

spec/classes/java_spec.rb

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,59 @@
6464
end
6565
end
6666

67-
context 'on Ubuntu Bionic (18.04)' do
68-
let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } }
67+
['18.04', '20.04', '22.04'].each do |release|
68+
context "on Ubuntu #{release}" do
69+
let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', release: { major: release }, architecture: 'amd64' } } }
70+
71+
context 'when selecting jdk' do
72+
let(:params) { { 'distribution' => 'jdk' } }
73+
74+
it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') }
75+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
76+
end
77+
78+
context 'when selecting jre' do
79+
let(:params) { { 'distribution' => 'jre' } }
80+
81+
it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') }
82+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
83+
end
84+
end
85+
end
86+
87+
context 'on Ubuntu 24.04' do
88+
let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', release: { major: '24.04' }, architecture: 'amd64' } } }
6989

7090
context 'when selecting jdk' do
7191
let(:params) { { 'distribution' => 'jdk' } }
7292

73-
it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') }
74-
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
93+
it { is_expected.to contain_package('java').with_name('openjdk-17-jdk') }
94+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') }
7595
end
7696

7797
context 'when selecting jre' do
7898
let(:params) { { 'distribution' => 'jre' } }
7999

80-
it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') }
81-
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
100+
it { is_expected.to contain_package('java').with_name('openjdk-17-jre-headless') }
101+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') }
102+
end
103+
end
104+
105+
context 'on Ubuntu 26.04' do
106+
let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', release: { major: '26.04' }, architecture: 'amd64' } } }
107+
108+
context 'when selecting jdk' do
109+
let(:params) { { 'distribution' => 'jdk' } }
110+
111+
it { is_expected.to contain_package('java').with_name('openjdk-21-jdk') }
112+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') }
113+
end
114+
115+
context 'when selecting jre' do
116+
let(:params) { { 'distribution' => 'jre' } }
117+
118+
it { is_expected.to contain_package('java').with_name('openjdk-21-jre-headless') }
119+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') }
82120
end
83121
end
84122

0 commit comments

Comments
 (0)