Skip to content

Commit c36cedd

Browse files
committed
Add support for Debian 13 and Ubuntu 26.04
- Set default OpenJDK to 21 for Debian 13 and Ubuntu 26.04 in params.pp - Add Debian 13 and Ubuntu 26.04 to supported OS releases in metadata.json - Add spec test with Debian Trixie (13) using openjdk-21 - 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 e7bd753 commit c36cedd

3 files changed

Lines changed: 69 additions & 8 deletions

File tree

manifests/params.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
default => $facts['os']['architecture']
5959
}
6060
case $facts['os']['release']['major'] {
61+
'13', '26.04': {
62+
$openjdk = 21
63+
}
6164
'12', '24.04': {
6265
$openjdk = 17
6366
}

metadata.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"operatingsystemrelease": [
4646
"10",
4747
"11",
48-
"12"
48+
"12",
49+
"13"
4950
]
5051
},
5152
{
@@ -54,7 +55,8 @@
5455
"18.04",
5556
"20.04",
5657
"22.04",
57-
"24.04"
58+
"24.04",
59+
"26.04"
5860
]
5961
},
6062
{

spec/classes/java_spec.rb

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,77 @@
4646
end
4747
end
4848

49-
context 'on Ubuntu Bionic (18.04)' do
50-
let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } }
49+
context 'on Debian Trixie (13)' do
50+
let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'trixie' }, release: { major: '13' }, architecture: 'amd64' } } }
5151

5252
context 'when selecting jdk' do
5353
let(:params) { { 'distribution' => 'jdk' } }
5454

55-
it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') }
56-
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
55+
it { is_expected.to contain_package('java').with_name('openjdk-21-jdk') }
56+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') }
5757
end
5858

5959
context 'when selecting jre' do
6060
let(:params) { { 'distribution' => 'jre' } }
6161

62-
it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') }
63-
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
62+
it { is_expected.to contain_package('java').with_name('openjdk-21-jre-headless') }
63+
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.21.0-openjdk-amd64/') }
64+
end
65+
end
66+
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' } } }
89+
90+
context 'when selecting jdk' do
91+
let(:params) { { 'distribution' => 'jdk' } }
92+
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/') }
95+
end
96+
97+
context 'when selecting jre' do
98+
let(:params) { { 'distribution' => 'jre' } }
99+
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/') }
64120
end
65121
end
66122

0 commit comments

Comments
 (0)