Skip to content

Commit ecb8f05

Browse files
committed
Acceptance tests: fix 404 error downloading tarball
Go 1.10.4 is not available for Darwin/ARM, so this switches to a more recent version when installing a specific version. This does not change installing from a specific source tarball.
1 parent b5ef331 commit ecb8f05

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

spec/acceptance/golang_installation_spec.rb

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
describe 'defined type golang::installation' do
66
context 'repeated root installs:' do
7-
context "ensure => '1.10.4'" do
7+
context "ensure => '1.22.9'" do
88
it 'installs Go' do
99
idempotent_apply(<<~'PUPPET')
1010
golang::installation { '/opt/go':
11-
ensure => '1.10.4',
11+
ensure => '1.22.9',
1212
}
1313
PUPPET
1414
end
1515

1616
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 ') }
1818
its(:stderr) { is_expected.to eq '' }
1919
its(:exit_status) { is_expected.to eq 0 }
2020
end
@@ -30,7 +30,7 @@
3030
end
3131

3232
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 ') }
3434
its(:stderr) { is_expected.to eq '' }
3535
its(:exit_status) { is_expected.to eq 0 }
3636
end
@@ -93,8 +93,8 @@
9393
context 'multiple root installs with linked_binaries' do
9494
it do
9595
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',
9898
}
9999
golang::installation { '/opt/go1.19.1':
100100
ensure => '1.19.1',
@@ -105,7 +105,7 @@
105105
PUPPET
106106
end
107107

108-
['1.10.4', '1.19.1'].each do |version|
108+
['1.22.9', '1.19.1'].each do |version|
109109
describe file("/opt/go#{version}") do
110110
it { is_expected.to be_directory }
111111
its(:owner) { is_expected.to eq 'root' }
@@ -140,19 +140,19 @@
140140
context 'multiple root installs with mixed ensure and linked_binaries' do
141141
it do
142142
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',
145145
}
146146
golang::installation { '/opt/go1.19.1':
147147
ensure => absent,
148148
}
149-
golang::linked_binaries { '/opt/go1.10.4':
149+
golang::linked_binaries { '/opt/go1.22.9':
150150
into_bin => '/usr/local/bin',
151151
}
152152
PUPPET
153153
end
154154

155-
describe file('/opt/go1.10.4/bin/go') do
155+
describe file('/opt/go1.22.9/bin/go') do
156156
it { is_expected.to be_file }
157157
it { is_expected.to be_executable }
158158
its(:owner) { is_expected.to eq 'root' }
@@ -164,11 +164,11 @@
164164

165165
describe file('/usr/local/bin/go') do
166166
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' }
168168
end
169169

170170
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 ') }
172172
its(:stderr) { is_expected.to eq '' }
173173
its(:exit_status) { is_expected.to eq 0 }
174174
end
@@ -177,20 +177,20 @@
177177
context 'multiple root uninstalls with linked_binaries' do
178178
it do
179179
idempotent_apply(<<~'PUPPET')
180-
golang::installation { '/opt/go1.10.4':
180+
golang::installation { '/opt/go1.22.9':
181181
ensure => absent,
182182
}
183183
golang::installation { '/opt/go1.19.1':
184184
ensure => absent,
185185
}
186-
golang::linked_binaries { '/opt/go1.10.4':
186+
golang::linked_binaries { '/opt/go1.22.9':
187187
ensure => absent,
188188
into_bin => '/usr/local/bin',
189189
}
190190
PUPPET
191191
end
192192

193-
describe file('/opt/go1.10.4') do
193+
describe file('/opt/go1.22.9') do
194194
it { is_expected.not_to exist }
195195
end
196196

@@ -206,8 +206,8 @@
206206
context 'multiple user installs with linked_binaries' do
207207
it do
208208
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',
211211
owner => 'user',
212212
group => 'user',
213213
mode => '0700',
@@ -240,7 +240,7 @@
240240
PUPPET
241241
end
242242

243-
['1.10.4', '1.19.1'].each do |version|
243+
['1.22.9', '1.19.1'].each do |version|
244244
describe file("#{home}/user/go#{version}") do
245245
it { is_expected.to be_directory }
246246
its(:owner) { is_expected.to eq 'user' }
@@ -279,28 +279,28 @@
279279
context 'multiple user installs with mixed ensure and linked_binaries' do
280280
it do
281281
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',
284284
owner => 'user',
285285
group => 'user',
286286
}
287287
golang::installation { '#{home}/user/go1.19.1':
288288
ensure => absent,
289289
}
290-
golang::linked_binaries { '#{home}/user/go1.10.4':
290+
golang::linked_binaries { '#{home}/user/go1.22.9':
291291
into_bin => '#{home}/user/bin',
292292
}
293293
PUPPET
294294
end
295295

296-
describe file("#{home}/user/go1.10.4") do
296+
describe file("#{home}/user/go1.22.9") do
297297
it { is_expected.to be_directory }
298298
its(:owner) { is_expected.to eq 'user' }
299299
its(:group) { is_expected.to eq 'user' }
300300
it { is_expected.to be_mode 755 } # WTF converted to octal
301301
end
302302

303-
describe file("#{home}/user/go1.10.4/bin/go") do
303+
describe file("#{home}/user/go1.22.9/bin/go") do
304304
it { is_expected.to be_file }
305305
its(:owner) { is_expected.to eq 'user' }
306306
its(:group) { is_expected.to eq 'user' }
@@ -313,11 +313,11 @@
313313

314314
describe file("#{home}/user/bin/go") do
315315
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" }
317317
end
318318

319319
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 ') }
321321
its(:stderr) { is_expected.to eq '' }
322322
its(:exit_status) { is_expected.to eq 0 }
323323
end
@@ -326,7 +326,7 @@
326326
context 'multiple user uninstalls with linked_binaries' do
327327
it do
328328
idempotent_apply(<<~"PUPPET")
329-
golang::installation { '#{home}/user/go1.10.4':
329+
golang::installation { '#{home}/user/go1.22.9':
330330
ensure => absent,
331331
owner => 'user',
332332
group => 'user',
@@ -336,14 +336,14 @@
336336
owner => 'user',
337337
group => 'user',
338338
}
339-
golang::linked_binaries { '#{home}/user/go1.10.4':
339+
golang::linked_binaries { '#{home}/user/go1.22.9':
340340
ensure => absent,
341341
into_bin => '#{home}/user/bin',
342342
}
343343
PUPPET
344344
end
345345

346-
describe file("#{home}/user/go1.10.4") do
346+
describe file("#{home}/user/go1.22.9") do
347347
it { is_expected.not_to exist }
348348
end
349349

spec/acceptance/golang_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
it do
4141
idempotent_apply(<<~'END')
4242
class { 'golang':
43-
ensure => '1.10.4',
43+
ensure => '1.22.9',
4444
}
4545
END
4646
end
@@ -69,7 +69,7 @@ class { 'golang':
6969
end
7070

7171
describe command('/usr/local/bin/go version') do
72-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
72+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
7373
its(:stderr) { is_expected.to eq '' }
7474
its(:exit_status) { is_expected.to eq 0 }
7575
end

0 commit comments

Comments
 (0)