|
46 | 46 | end |
47 | 47 | end |
48 | 48 |
|
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' } } } |
51 | 51 |
|
52 | 52 | context 'when selecting jdk' do |
53 | 53 | let(:params) { { 'distribution' => 'jdk' } } |
54 | 54 |
|
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/') } |
57 | 57 | end |
58 | 58 |
|
59 | 59 | context 'when selecting jre' do |
60 | 60 | let(:params) { { 'distribution' => 'jre' } } |
61 | 61 |
|
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/') } |
64 | 120 | end |
65 | 121 | end |
66 | 122 |
|
|
0 commit comments