|
4 | 4 |
|
5 | 5 | describe 'defined type golang::installation' do
|
6 | 6 | context 'repeated root installs:' do
|
7 |
| - context "ensure => '1.10.4'" do |
| 7 | + context "ensure => '1.22.9'" do |
8 | 8 | it 'installs Go' do
|
9 | 9 | idempotent_apply(<<~'PUPPET')
|
10 | 10 | golang::installation { '/opt/go':
|
11 |
| - ensure => '1.10.4', |
| 11 | + ensure => '1.22.9', |
12 | 12 | }
|
13 | 13 | PUPPET
|
14 | 14 | end
|
15 | 15 |
|
16 | 16 | describe command('/opt/go/bin/go version') do
|
17 |
| - its(:stdout) { is_expected.to start_with('go version go1.10.4 ') } |
| 17 | + its(:stdout) { is_expected.to start_with('go version go1.22.9 ') } |
18 | 18 | its(:stderr) { is_expected.to eq '' }
|
19 | 19 | its(:exit_status) { is_expected.to eq 0 }
|
20 | 20 | end
|
|
30 | 30 | end
|
31 | 31 |
|
32 | 32 | describe command('/opt/go/bin/go version') do
|
33 |
| - its(:stdout) { is_expected.to start_with('go version go1.10.4 ') } |
| 33 | + its(:stdout) { is_expected.to start_with('go version go1.22.9 ') } |
34 | 34 | its(:stderr) { is_expected.to eq '' }
|
35 | 35 | its(:exit_status) { is_expected.to eq 0 }
|
36 | 36 | end
|
|
93 | 93 | context 'multiple root installs with linked_binaries' do
|
94 | 94 | it do
|
95 | 95 | idempotent_apply(<<~'PUPPET')
|
96 |
| - golang::installation { '/opt/go1.10.4': |
97 |
| - ensure => '1.10.4', |
| 96 | + golang::installation { '/opt/go1.22.9': |
| 97 | + ensure => '1.22.9', |
98 | 98 | }
|
99 | 99 | golang::installation { '/opt/go1.19.1':
|
100 | 100 | ensure => '1.19.1',
|
|
105 | 105 | PUPPET
|
106 | 106 | end
|
107 | 107 |
|
108 |
| - ['1.10.4', '1.19.1'].each do |version| |
| 108 | + ['1.22.9', '1.19.1'].each do |version| |
109 | 109 | describe file("/opt/go#{version}") do
|
110 | 110 | it { is_expected.to be_directory }
|
111 | 111 | its(:owner) { is_expected.to eq 'root' }
|
|
140 | 140 | context 'multiple root installs with mixed ensure and linked_binaries' do
|
141 | 141 | it do
|
142 | 142 | idempotent_apply(<<~'PUPPET')
|
143 |
| - golang::installation { '/opt/go1.10.4': |
144 |
| - ensure => '1.10.4', |
| 143 | + golang::installation { '/opt/go1.22.9': |
| 144 | + ensure => '1.22.9', |
145 | 145 | }
|
146 | 146 | golang::installation { '/opt/go1.19.1':
|
147 | 147 | ensure => absent,
|
148 | 148 | }
|
149 |
| - golang::linked_binaries { '/opt/go1.10.4': |
| 149 | + golang::linked_binaries { '/opt/go1.22.9': |
150 | 150 | into_bin => '/usr/local/bin',
|
151 | 151 | }
|
152 | 152 | PUPPET
|
153 | 153 | end
|
154 | 154 |
|
155 |
| - describe file('/opt/go1.10.4/bin/go') do |
| 155 | + describe file('/opt/go1.22.9/bin/go') do |
156 | 156 | it { is_expected.to be_file }
|
157 | 157 | it { is_expected.to be_executable }
|
158 | 158 | its(:owner) { is_expected.to eq 'root' }
|
|
164 | 164 |
|
165 | 165 | describe file('/usr/local/bin/go') do
|
166 | 166 | it { is_expected.to be_symlink }
|
167 |
| - it { is_expected.to be_linked_to '/opt/go1.10.4/bin/go' } |
| 167 | + it { is_expected.to be_linked_to '/opt/go1.22.9/bin/go' } |
168 | 168 | end
|
169 | 169 |
|
170 | 170 | describe command('/usr/local/bin/go version') do
|
171 |
| - its(:stdout) { is_expected.to start_with('go version go1.10.4 ') } |
| 171 | + its(:stdout) { is_expected.to start_with('go version go1.22.9 ') } |
172 | 172 | its(:stderr) { is_expected.to eq '' }
|
173 | 173 | its(:exit_status) { is_expected.to eq 0 }
|
174 | 174 | end
|
|
177 | 177 | context 'multiple root uninstalls with linked_binaries' do
|
178 | 178 | it do
|
179 | 179 | idempotent_apply(<<~'PUPPET')
|
180 |
| - golang::installation { '/opt/go1.10.4': |
| 180 | + golang::installation { '/opt/go1.22.9': |
181 | 181 | ensure => absent,
|
182 | 182 | }
|
183 | 183 | golang::installation { '/opt/go1.19.1':
|
184 | 184 | ensure => absent,
|
185 | 185 | }
|
186 |
| - golang::linked_binaries { '/opt/go1.10.4': |
| 186 | + golang::linked_binaries { '/opt/go1.22.9': |
187 | 187 | ensure => absent,
|
188 | 188 | into_bin => '/usr/local/bin',
|
189 | 189 | }
|
190 | 190 | PUPPET
|
191 | 191 | end
|
192 | 192 |
|
193 |
| - describe file('/opt/go1.10.4') do |
| 193 | + describe file('/opt/go1.22.9') do |
194 | 194 | it { is_expected.not_to exist }
|
195 | 195 | end
|
196 | 196 |
|
|
206 | 206 | context 'multiple user installs with linked_binaries' do
|
207 | 207 | it do
|
208 | 208 | idempotent_apply(<<~"PUPPET")
|
209 |
| - golang::installation { '#{home}/user/go1.10.4': |
210 |
| - ensure => '1.10.4', |
| 209 | + golang::installation { '#{home}/user/go1.22.9': |
| 210 | + ensure => '1.22.9', |
211 | 211 | owner => 'user',
|
212 | 212 | group => 'user',
|
213 | 213 | mode => '0700',
|
|
240 | 240 | PUPPET
|
241 | 241 | end
|
242 | 242 |
|
243 |
| - ['1.10.4', '1.19.1'].each do |version| |
| 243 | + ['1.22.9', '1.19.1'].each do |version| |
244 | 244 | describe file("#{home}/user/go#{version}") do
|
245 | 245 | it { is_expected.to be_directory }
|
246 | 246 | its(:owner) { is_expected.to eq 'user' }
|
|
279 | 279 | context 'multiple user installs with mixed ensure and linked_binaries' do
|
280 | 280 | it do
|
281 | 281 | idempotent_apply(<<~"PUPPET")
|
282 |
| - golang::installation { '#{home}/user/go1.10.4': |
283 |
| - ensure => '1.10.4', |
| 282 | + golang::installation { '#{home}/user/go1.22.9': |
| 283 | + ensure => '1.22.9', |
284 | 284 | owner => 'user',
|
285 | 285 | group => 'user',
|
286 | 286 | }
|
287 | 287 | golang::installation { '#{home}/user/go1.19.1':
|
288 | 288 | ensure => absent,
|
289 | 289 | }
|
290 |
| - golang::linked_binaries { '#{home}/user/go1.10.4': |
| 290 | + golang::linked_binaries { '#{home}/user/go1.22.9': |
291 | 291 | into_bin => '#{home}/user/bin',
|
292 | 292 | }
|
293 | 293 | PUPPET
|
294 | 294 | end
|
295 | 295 |
|
296 |
| - describe file("#{home}/user/go1.10.4") do |
| 296 | + describe file("#{home}/user/go1.22.9") do |
297 | 297 | it { is_expected.to be_directory }
|
298 | 298 | its(:owner) { is_expected.to eq 'user' }
|
299 | 299 | its(:group) { is_expected.to eq 'user' }
|
300 | 300 | it { is_expected.to be_mode 755 } # WTF converted to octal
|
301 | 301 | end
|
302 | 302 |
|
303 |
| - describe file("#{home}/user/go1.10.4/bin/go") do |
| 303 | + describe file("#{home}/user/go1.22.9/bin/go") do |
304 | 304 | it { is_expected.to be_file }
|
305 | 305 | its(:owner) { is_expected.to eq 'user' }
|
306 | 306 | its(:group) { is_expected.to eq 'user' }
|
|
313 | 313 |
|
314 | 314 | describe file("#{home}/user/bin/go") do
|
315 | 315 | it { is_expected.to be_symlink }
|
316 |
| - it { is_expected.to be_linked_to "#{home}/user/go1.10.4/bin/go" } |
| 316 | + it { is_expected.to be_linked_to "#{home}/user/go1.22.9/bin/go" } |
317 | 317 | end
|
318 | 318 |
|
319 | 319 | describe command("#{home}/user/bin/go version") do
|
320 |
| - its(:stdout) { is_expected.to start_with('go version go1.10.4 ') } |
| 320 | + its(:stdout) { is_expected.to start_with('go version go1.22.9 ') } |
321 | 321 | its(:stderr) { is_expected.to eq '' }
|
322 | 322 | its(:exit_status) { is_expected.to eq 0 }
|
323 | 323 | end
|
|
326 | 326 | context 'multiple user uninstalls with linked_binaries' do
|
327 | 327 | it do
|
328 | 328 | idempotent_apply(<<~"PUPPET")
|
329 |
| - golang::installation { '#{home}/user/go1.10.4': |
| 329 | + golang::installation { '#{home}/user/go1.22.9': |
330 | 330 | ensure => absent,
|
331 | 331 | owner => 'user',
|
332 | 332 | group => 'user',
|
|
336 | 336 | owner => 'user',
|
337 | 337 | group => 'user',
|
338 | 338 | }
|
339 |
| - golang::linked_binaries { '#{home}/user/go1.10.4': |
| 339 | + golang::linked_binaries { '#{home}/user/go1.22.9': |
340 | 340 | ensure => absent,
|
341 | 341 | into_bin => '#{home}/user/bin',
|
342 | 342 | }
|
343 | 343 | PUPPET
|
344 | 344 | end
|
345 | 345 |
|
346 |
| - describe file("#{home}/user/go1.10.4") do |
| 346 | + describe file("#{home}/user/go1.22.9") do |
347 | 347 | it { is_expected.not_to exist }
|
348 | 348 | end
|
349 | 349 |
|
|
0 commit comments