beaker-puppet 1.29.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +28 -7
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +842 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +5 -20
- data/Rakefile +64 -169
- data/acceptance/config/acceptance-options.rb +3 -3
- data/acceptance/config/gem/acceptance-options.rb +8 -8
- data/acceptance/config/git/acceptance-options.rb +8 -8
- data/acceptance/config/pkg/acceptance-options.rb +7 -7
- data/acceptance/pre_suite/gem/install.rb +6 -6
- data/acceptance/pre_suite/git/install.rb +22 -22
- data/acceptance/pre_suite/pkg/install.rb +3 -3
- data/acceptance/tests/backwards_compatible.rb +6 -7
- data/acceptance/tests/clone_git_repo_on_test.rb +12 -13
- data/acceptance/tests/create_tmpdir_on_test.rb +13 -9
- data/acceptance/tests/install_smoke_test.rb +5 -4
- data/acceptance/tests/stub_host.rb +11 -10
- data/acceptance/tests/web_helpers_test.rb +11 -10
- data/beaker-puppet.gemspec +16 -23
- data/bin/beaker-puppet +2 -4
- data/lib/beaker-puppet/helpers/facter_helpers.rb +9 -7
- data/lib/beaker-puppet/helpers/host_helpers.rb +10 -7
- data/lib/beaker-puppet/helpers/puppet_helpers.rb +151 -160
- data/lib/beaker-puppet/helpers/rake_helpers.rb +1 -1
- data/lib/beaker-puppet/helpers/tk_helpers.rb +22 -28
- data/lib/beaker-puppet/install_utils/aio_defaults.rb +39 -43
- data/lib/beaker-puppet/install_utils/ezbake_utils.rb +34 -42
- data/lib/beaker-puppet/install_utils/foss_defaults.rb +134 -138
- data/lib/beaker-puppet/install_utils/foss_utils.rb +293 -320
- data/lib/beaker-puppet/install_utils/module_utils.rb +58 -70
- data/lib/beaker-puppet/install_utils/puppet5.rb +30 -35
- data/lib/beaker-puppet/install_utils/puppet_utils.rb +58 -68
- data/lib/beaker-puppet/install_utils/windows_utils.rb +34 -36
- data/lib/beaker-puppet/version.rb +1 -1
- data/lib/beaker-puppet/wrappers.rb +13 -14
- data/lib/beaker-puppet.rb +4 -5
- data/setup/aio/010_Install_Puppet_Agent.rb +5 -6
- data/setup/common/000-delete-puppet-when-none.rb +2 -4
- data/setup/common/003_solaris_cert_fix.rb +74 -70
- data/setup/common/005_redhat_subscription_fix.rb +3 -2
- data/setup/common/011_Install_Puppet_Server.rb +7 -9
- data/setup/common/012_Finalize_Installs.rb +5 -5
- data/setup/common/025_StopFirewall.rb +1 -1
- data/setup/common/030_StopSssd.rb +2 -2
- data/setup/common/040_ValidateSignCert.rb +10 -12
- data/setup/common/045_EnsureMasterStarted.rb +2 -2
- data/setup/gem/010_GemInstall.rb +5 -4
- data/setup/git/000_EnvSetup.rb +48 -48
- data/setup/git/010_TestSetup.rb +13 -12
- data/setup/git/020_PuppetUserAndGroup.rb +3 -2
- data/setup/git/060_InstallModules.rb +14 -14
- data/setup/git/070_InstallCACerts.rb +82 -82
- data/spec/beaker-puppet/helpers/facter_helpers_spec.rb +22 -24
- data/spec/beaker-puppet/helpers/host_helpers_spec.rb +10 -6
- data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +506 -517
- data/spec/beaker-puppet/helpers/tk_helpers_spec.rb +20 -24
- data/spec/beaker-puppet/install_utils/ezbake_utils_spec.rb +86 -90
- data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +636 -599
- data/spec/beaker-puppet/install_utils/module_utils_spec.rb +125 -116
- data/spec/beaker-puppet/install_utils/puppet5_spec.rb +159 -165
- data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +92 -77
- data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +101 -89
- data/spec/beaker-puppet/wrappers_spec.rb +10 -10
- data/spec/helpers.rb +85 -91
- data/tasks/ci.rake +171 -179
- metadata +33 -62
- data/setup/common/020_InstallCumulusModules.rb +0 -13
- data/setup/common/021_InstallAristaModuleMasters.rb +0 -12
- data/setup/common/022_InstallAristaModuleAgents.rb +0 -13
@@ -17,48 +17,61 @@ describe ClassMixedWithDSLInstallUtils do
|
|
17
17
|
let(:metadata) { @metadata ||= {} }
|
18
18
|
let(:presets) { Beaker::Options::Presets.new }
|
19
19
|
let(:opts) { presets.presets.merge(presets.env_vars) }
|
20
|
-
let(:basic_hosts)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
let(:
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
20
|
+
let(:basic_hosts) do
|
21
|
+
make_hosts({ pe_ver: '3.0',
|
22
|
+
platform: 'linux',
|
23
|
+
roles: ['agent'], }, 4)
|
24
|
+
end
|
25
|
+
let(:hosts) do
|
26
|
+
basic_hosts[0][:roles] = %w[master database dashboard]
|
27
|
+
basic_hosts[1][:platform] = 'windows'
|
28
|
+
basic_hosts[2][:platform] = 'osx-10.9-x86_64'
|
29
|
+
basic_hosts[3][:platform] = 'eos'
|
30
|
+
basic_hosts
|
31
|
+
end
|
32
|
+
let(:hosts_sorted) { [hosts[1], hosts[0], hosts[2], hosts[3]] }
|
33
|
+
let(:winhost) do
|
34
|
+
make_host('winhost', { platform: 'windows',
|
35
|
+
pe_ver: '3.0',
|
36
|
+
working_dir: '/tmp',
|
37
|
+
is_cygwin: true, })
|
38
|
+
end
|
39
|
+
let(:winhost_non_cygwin) do
|
40
|
+
make_host('winhost_non_cygwin', { platform: 'windows',
|
41
|
+
pe_ver: '3.0',
|
42
|
+
working_dir: '/tmp',
|
43
|
+
is_cygwin: 'false', })
|
44
|
+
end
|
45
|
+
let(:machost) do
|
46
|
+
make_host('machost', { platform: 'osx-10.9-x86_64',
|
47
|
+
pe_ver: '3.0',
|
48
|
+
working_dir: '/tmp', })
|
49
|
+
end
|
50
|
+
let(:unixhost) do
|
51
|
+
make_host('unixhost', { platform: 'linux',
|
52
|
+
pe_ver: '3.0',
|
53
|
+
working_dir: '/tmp',
|
54
|
+
dist: 'puppet-enterprise-3.1.0-rc0-230-g36c9e5c-debian-7-i386', })
|
55
|
+
end
|
56
|
+
let(:eoshost) do
|
57
|
+
make_host('eoshost', { platform: 'eos',
|
58
|
+
pe_ver: '3.0',
|
59
|
+
working_dir: '/tmp',
|
60
|
+
dist: 'puppet-enterprise-3.7.1-rc0-78-gffc958f-eos-4-i386', })
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '#configure_defaults_on' do
|
64
|
+
it 'can set foss defaults' do
|
52
65
|
expect(subject).to receive(:add_foss_defaults_on).exactly(hosts.length).times
|
53
66
|
subject.configure_defaults_on(hosts, 'foss')
|
54
67
|
end
|
55
68
|
|
56
|
-
it
|
69
|
+
it 'can set aio defaults' do
|
57
70
|
expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
|
58
71
|
subject.configure_defaults_on(hosts, 'aio')
|
59
72
|
end
|
60
73
|
|
61
|
-
it
|
74
|
+
it 'can set pe defaults' do
|
62
75
|
expect(subject).to receive(:add_pe_defaults_on).exactly(hosts.length).times
|
63
76
|
subject.configure_defaults_on(hosts, 'pe')
|
64
77
|
end
|
@@ -74,9 +87,8 @@ describe ClassMixedWithDSLInstallUtils do
|
|
74
87
|
end
|
75
88
|
end
|
76
89
|
|
77
|
-
describe
|
78
|
-
|
79
|
-
it "can set foss defaults for foss type" do
|
90
|
+
describe '#configure_type_defaults_on' do
|
91
|
+
it 'can set foss defaults for foss type' do
|
80
92
|
hosts.each do |host|
|
81
93
|
host['type'] = 'foss'
|
82
94
|
end
|
@@ -84,7 +96,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
84
96
|
subject.configure_type_defaults_on(hosts)
|
85
97
|
end
|
86
98
|
|
87
|
-
it
|
99
|
+
it 'adds aio defaults to foss hosts when they have an aio foss puppet version' do
|
88
100
|
hosts.each do |host|
|
89
101
|
host[:pe_ver] = nil
|
90
102
|
host[:version] = nil
|
@@ -96,7 +108,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
96
108
|
subject.configure_type_defaults_on(hosts)
|
97
109
|
end
|
98
110
|
|
99
|
-
it
|
111
|
+
it 'adds aio defaults to foss hosts when they have type foss-aio' do
|
100
112
|
hosts.each do |host|
|
101
113
|
host[:pe_ver] = nil
|
102
114
|
host[:version] = nil
|
@@ -107,7 +119,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
107
119
|
subject.configure_type_defaults_on(hosts)
|
108
120
|
end
|
109
121
|
|
110
|
-
it
|
122
|
+
it 'can set aio defaults for aio type (backwards compatability)' do
|
111
123
|
hosts.each do |host|
|
112
124
|
host[:pe_ver] = nil
|
113
125
|
host[:version] = nil
|
@@ -117,7 +129,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
117
129
|
subject.configure_type_defaults_on(hosts)
|
118
130
|
end
|
119
131
|
|
120
|
-
it
|
132
|
+
it 'can set pe defaults for pe type' do
|
121
133
|
hosts.each do |host|
|
122
134
|
host['type'] = 'pe'
|
123
135
|
end
|
@@ -125,7 +137,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
125
137
|
subject.configure_type_defaults_on(hosts)
|
126
138
|
end
|
127
139
|
|
128
|
-
it
|
140
|
+
it 'adds aio defaults to pe hosts when they an aio pe version' do
|
129
141
|
hosts.each do |host|
|
130
142
|
host['type'] = 'pe'
|
131
143
|
host['pe_ver'] = '4.0'
|
@@ -134,52 +146,55 @@ describe ClassMixedWithDSLInstallUtils do
|
|
134
146
|
expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
|
135
147
|
subject.configure_type_defaults_on(hosts)
|
136
148
|
end
|
137
|
-
|
138
149
|
end
|
139
150
|
|
140
151
|
describe '#puppetserver_version_on' do
|
141
152
|
it 'returns the tag on a released version' do
|
142
|
-
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), :
|
143
|
-
|
153
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), stdout: 'puppetserver version: 6.13.0',
|
154
|
+
exit_code: 0)
|
155
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version',
|
156
|
+
accept_all_exit_codes: true).and_return(result)
|
144
157
|
expect(subject.puppetserver_version_on(hosts.first)).to eq('6.13.0')
|
145
158
|
end
|
146
159
|
|
147
160
|
it 'returns the tag on a nightly version' do
|
148
|
-
result = object_double(Beaker::Result.new({}, 'puppetserver --version'),
|
149
|
-
|
161
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'),
|
162
|
+
stdout: 'puppetserver version: 7.0.0.SNAPSHOT.2020.10.14T0512', exit_code: 0)
|
163
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version',
|
164
|
+
accept_all_exit_codes: true).and_return(result)
|
150
165
|
expect(subject.puppetserver_version_on(hosts.first)).to eq('7.0.0')
|
151
166
|
end
|
152
167
|
end
|
153
168
|
|
154
169
|
describe '#puppet_collection_for' do
|
155
170
|
it 'raises an error when given an invalid package' do
|
156
|
-
expect
|
171
|
+
expect do
|
157
172
|
subject.puppet_collection_for(:foo, '5.5.4')
|
158
|
-
|
173
|
+
end.to raise_error(RuntimeError, /package must be one of puppet_agent, puppet, puppetserver/)
|
159
174
|
end
|
160
175
|
|
161
176
|
context 'when the :puppet_agent package is passed in' do
|
162
177
|
context 'given a valid version' do
|
163
178
|
{
|
164
|
-
'1.10.14'
|
165
|
-
'1.10.x'
|
166
|
-
'5.3.1'
|
167
|
-
'5.3.x'
|
168
|
-
'5.99.0'
|
169
|
-
'6.1.99-foo'
|
170
|
-
'6.99.99'
|
171
|
-
'7.0.0'
|
179
|
+
'1.10.14' => 'pc1',
|
180
|
+
'1.10.x' => 'pc1',
|
181
|
+
'5.3.1' => 'puppet5',
|
182
|
+
'5.3.x' => 'puppet5',
|
183
|
+
'5.99.0' => 'puppet6',
|
184
|
+
'6.1.99-foo' => 'puppet6',
|
185
|
+
'6.99.99' => 'puppet7',
|
186
|
+
'7.0.0' => 'puppet7',
|
172
187
|
}.each do |version, collection|
|
173
188
|
it "returns collection '#{collection}' for version '#{version}'" do
|
174
189
|
expect(subject.puppet_collection_for(:puppet_agent, version)).to eq(collection)
|
175
190
|
end
|
176
191
|
end
|
177
192
|
end
|
178
|
-
|
193
|
+
|
179
194
|
it "returns the default, latest puppet collection given the version 'latest'" do
|
180
195
|
expect(subject.puppet_collection_for(:puppet_agent, 'latest')).to eq('puppet')
|
181
196
|
end
|
182
|
-
|
197
|
+
|
183
198
|
context 'given an invalid version' do
|
184
199
|
[nil, '', '0.1.0', '3.8.1', '', 'not-semver', 'not.semver.either'].each do |version|
|
185
200
|
it "returns a nil collection value for version '#{version}'" do
|
@@ -192,14 +207,14 @@ describe ClassMixedWithDSLInstallUtils do
|
|
192
207
|
context 'when the :puppet package is passed-in' do
|
193
208
|
context 'given a valid version' do
|
194
209
|
{
|
195
|
-
'4.9.0'
|
196
|
-
'4.10.x'
|
197
|
-
'5.3.1'
|
198
|
-
'5.3.x'
|
199
|
-
'5.99.0'
|
200
|
-
'6.1.99-foo'
|
201
|
-
'6.99.99'
|
202
|
-
'7.0.0'
|
210
|
+
'4.9.0' => 'pc1',
|
211
|
+
'4.10.x' => 'pc1',
|
212
|
+
'5.3.1' => 'puppet5',
|
213
|
+
'5.3.x' => 'puppet5',
|
214
|
+
'5.99.0' => 'puppet6',
|
215
|
+
'6.1.99-foo' => 'puppet6',
|
216
|
+
'6.99.99' => 'puppet7',
|
217
|
+
'7.0.0' => 'puppet7',
|
203
218
|
}.each do |version, collection|
|
204
219
|
it "returns collection '#{collection}' for version '#{version}'" do
|
205
220
|
expect(subject.puppet_collection_for(:puppet, version)).to eq(collection)
|
@@ -223,25 +238,25 @@ describe ClassMixedWithDSLInstallUtils do
|
|
223
238
|
context 'when the :puppetserver package is passed in' do
|
224
239
|
context 'given a valid version' do
|
225
240
|
{
|
226
|
-
'2.0.0'
|
227
|
-
'2.0.x'
|
228
|
-
'5.3.1'
|
229
|
-
'5.3.x'
|
230
|
-
'5.99.0'
|
231
|
-
'6.1.99-foo'
|
232
|
-
'6.99.99'
|
233
|
-
'7.0.0'
|
241
|
+
'2.0.0' => 'pc1',
|
242
|
+
'2.0.x' => 'pc1',
|
243
|
+
'5.3.1' => 'puppet5',
|
244
|
+
'5.3.x' => 'puppet5',
|
245
|
+
'5.99.0' => 'puppet6',
|
246
|
+
'6.1.99-foo' => 'puppet6',
|
247
|
+
'6.99.99' => 'puppet7',
|
248
|
+
'7.0.0' => 'puppet7',
|
234
249
|
}.each do |version, collection|
|
235
250
|
it "returns collection '#{collection}' for version '#{version}'" do
|
236
251
|
expect(subject.puppet_collection_for(:puppetserver, version)).to eq(collection)
|
237
252
|
end
|
238
253
|
end
|
239
254
|
end
|
240
|
-
|
255
|
+
|
241
256
|
it "returns the default, latest puppet collection given the version 'latest'" do
|
242
257
|
expect(subject.puppet_collection_for(:puppetserver, 'latest')).to eq('puppet')
|
243
258
|
end
|
244
|
-
|
259
|
+
|
245
260
|
context 'given an invalid version' do
|
246
261
|
[nil, '', '0.1.0', '3.8.1', '', 'not-semver', 'not.semver.either'].each do |version|
|
247
262
|
it "returns a nil collection value for version '#{version}'" do
|