beaker-puppet 1.29.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +3 -3
- data/.github/workflows/test.yml +28 -7
- data/.github_changelog_generator +3 -0
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +887 -0
- data/CHANGELOG.md +50 -0
- data/CODEOWNERS +1 -0
- data/Gemfile +5 -20
- data/README.md +4 -13
- 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 +17 -24
- 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 +145 -229
- 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 +269 -480
- 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 +53 -80
- 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/release-prep.sh +11 -0
- data/setup/aio/010_Install_Puppet_Agent.rb +22 -9
- 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 +9 -18
- data/setup/common/045_EnsureMasterStarted.rb +2 -2
- data/setup/gem/010_GemInstall.rb +6 -5
- 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 +463 -724
- 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 +471 -863
- 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 +89 -97
- 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 +188 -188
- metadata +38 -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,52 +17,60 @@ 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 "can set pe defaults" do
|
62
|
-
expect(subject).to receive(:add_pe_defaults_on).exactly(hosts.length).times
|
63
|
-
subject.configure_defaults_on(hosts, 'pe')
|
64
|
-
end
|
65
|
-
|
66
74
|
it 'can remove old defaults ands replace with new' do
|
67
75
|
# fake the results of calling configure_pe_defaults_on
|
68
76
|
hosts.each do |host|
|
@@ -74,9 +82,8 @@ describe ClassMixedWithDSLInstallUtils do
|
|
74
82
|
end
|
75
83
|
end
|
76
84
|
|
77
|
-
describe
|
78
|
-
|
79
|
-
it "can set foss defaults for foss type" do
|
85
|
+
describe '#configure_type_defaults_on' do
|
86
|
+
it 'can set foss defaults for foss type' do
|
80
87
|
hosts.each do |host|
|
81
88
|
host['type'] = 'foss'
|
82
89
|
end
|
@@ -84,7 +91,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
84
91
|
subject.configure_type_defaults_on(hosts)
|
85
92
|
end
|
86
93
|
|
87
|
-
it
|
94
|
+
it 'adds aio defaults to foss hosts when they have an aio foss puppet version' do
|
88
95
|
hosts.each do |host|
|
89
96
|
host[:pe_ver] = nil
|
90
97
|
host[:version] = nil
|
@@ -96,7 +103,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
96
103
|
subject.configure_type_defaults_on(hosts)
|
97
104
|
end
|
98
105
|
|
99
|
-
it
|
106
|
+
it 'adds aio defaults to foss hosts when they have type foss-aio' do
|
100
107
|
hosts.each do |host|
|
101
108
|
host[:pe_ver] = nil
|
102
109
|
host[:version] = nil
|
@@ -107,7 +114,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
107
114
|
subject.configure_type_defaults_on(hosts)
|
108
115
|
end
|
109
116
|
|
110
|
-
it
|
117
|
+
it 'can set aio defaults for aio type (backwards compatability)' do
|
111
118
|
hosts.each do |host|
|
112
119
|
host[:pe_ver] = nil
|
113
120
|
host[:version] = nil
|
@@ -116,70 +123,55 @@ describe ClassMixedWithDSLInstallUtils do
|
|
116
123
|
expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
|
117
124
|
subject.configure_type_defaults_on(hosts)
|
118
125
|
end
|
119
|
-
|
120
|
-
it "can set pe defaults for pe type" do
|
121
|
-
hosts.each do |host|
|
122
|
-
host['type'] = 'pe'
|
123
|
-
end
|
124
|
-
expect(subject).to receive(:add_pe_defaults_on).exactly(hosts.length).times
|
125
|
-
subject.configure_type_defaults_on(hosts)
|
126
|
-
end
|
127
|
-
|
128
|
-
it "adds aio defaults to pe hosts when they an aio pe version" do
|
129
|
-
hosts.each do |host|
|
130
|
-
host['type'] = 'pe'
|
131
|
-
host['pe_ver'] = '4.0'
|
132
|
-
end
|
133
|
-
expect(subject).to receive(:add_pe_defaults_on).exactly(hosts.length).times
|
134
|
-
expect(subject).to receive(:add_aio_defaults_on).exactly(hosts.length).times
|
135
|
-
subject.configure_type_defaults_on(hosts)
|
136
|
-
end
|
137
|
-
|
138
126
|
end
|
139
127
|
|
140
128
|
describe '#puppetserver_version_on' do
|
141
129
|
it 'returns the tag on a released version' do
|
142
|
-
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), :
|
143
|
-
|
130
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'), stdout: 'puppetserver version: 6.13.0',
|
131
|
+
exit_code: 0)
|
132
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version',
|
133
|
+
accept_all_exit_codes: true).and_return(result)
|
144
134
|
expect(subject.puppetserver_version_on(hosts.first)).to eq('6.13.0')
|
145
135
|
end
|
146
136
|
|
147
137
|
it 'returns the tag on a nightly version' do
|
148
|
-
result = object_double(Beaker::Result.new({}, 'puppetserver --version'),
|
149
|
-
|
138
|
+
result = object_double(Beaker::Result.new({}, 'puppetserver --version'),
|
139
|
+
stdout: 'puppetserver version: 7.0.0.SNAPSHOT.2020.10.14T0512', exit_code: 0)
|
140
|
+
expect(subject).to receive(:on).with(hosts.first, 'puppetserver --version',
|
141
|
+
accept_all_exit_codes: true).and_return(result)
|
150
142
|
expect(subject.puppetserver_version_on(hosts.first)).to eq('7.0.0')
|
151
143
|
end
|
152
144
|
end
|
153
145
|
|
154
146
|
describe '#puppet_collection_for' do
|
155
147
|
it 'raises an error when given an invalid package' do
|
156
|
-
expect
|
148
|
+
expect do
|
157
149
|
subject.puppet_collection_for(:foo, '5.5.4')
|
158
|
-
|
150
|
+
end.to raise_error(RuntimeError, /package must be one of puppet_agent, puppet, puppetserver/)
|
159
151
|
end
|
160
152
|
|
161
153
|
context 'when the :puppet_agent package is passed in' do
|
162
154
|
context 'given a valid version' do
|
163
155
|
{
|
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'
|
156
|
+
'1.10.14' => 'pc1',
|
157
|
+
'1.10.x' => 'pc1',
|
158
|
+
'5.3.1' => 'puppet5',
|
159
|
+
'5.3.x' => 'puppet5',
|
160
|
+
'5.99.0' => 'puppet6',
|
161
|
+
'6.1.99-foo' => 'puppet6',
|
162
|
+
'6.99.99' => 'puppet7',
|
163
|
+
'7.0.0' => 'puppet7',
|
172
164
|
}.each do |version, collection|
|
173
165
|
it "returns collection '#{collection}' for version '#{version}'" do
|
174
166
|
expect(subject.puppet_collection_for(:puppet_agent, version)).to eq(collection)
|
175
167
|
end
|
176
168
|
end
|
177
169
|
end
|
178
|
-
|
170
|
+
|
179
171
|
it "returns the default, latest puppet collection given the version 'latest'" do
|
180
172
|
expect(subject.puppet_collection_for(:puppet_agent, 'latest')).to eq('puppet')
|
181
173
|
end
|
182
|
-
|
174
|
+
|
183
175
|
context 'given an invalid version' do
|
184
176
|
[nil, '', '0.1.0', '3.8.1', '', 'not-semver', 'not.semver.either'].each do |version|
|
185
177
|
it "returns a nil collection value for version '#{version}'" do
|
@@ -192,14 +184,14 @@ describe ClassMixedWithDSLInstallUtils do
|
|
192
184
|
context 'when the :puppet package is passed-in' do
|
193
185
|
context 'given a valid version' do
|
194
186
|
{
|
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'
|
187
|
+
'4.9.0' => 'pc1',
|
188
|
+
'4.10.x' => 'pc1',
|
189
|
+
'5.3.1' => 'puppet5',
|
190
|
+
'5.3.x' => 'puppet5',
|
191
|
+
'5.99.0' => 'puppet6',
|
192
|
+
'6.1.99-foo' => 'puppet6',
|
193
|
+
'6.99.99' => 'puppet7',
|
194
|
+
'7.0.0' => 'puppet7',
|
203
195
|
}.each do |version, collection|
|
204
196
|
it "returns collection '#{collection}' for version '#{version}'" do
|
205
197
|
expect(subject.puppet_collection_for(:puppet, version)).to eq(collection)
|
@@ -223,25 +215,25 @@ describe ClassMixedWithDSLInstallUtils do
|
|
223
215
|
context 'when the :puppetserver package is passed in' do
|
224
216
|
context 'given a valid version' do
|
225
217
|
{
|
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'
|
218
|
+
'2.0.0' => 'pc1',
|
219
|
+
'2.0.x' => 'pc1',
|
220
|
+
'5.3.1' => 'puppet5',
|
221
|
+
'5.3.x' => 'puppet5',
|
222
|
+
'5.99.0' => 'puppet6',
|
223
|
+
'6.1.99-foo' => 'puppet6',
|
224
|
+
'6.99.99' => 'puppet7',
|
225
|
+
'7.0.0' => 'puppet7',
|
234
226
|
}.each do |version, collection|
|
235
227
|
it "returns collection '#{collection}' for version '#{version}'" do
|
236
228
|
expect(subject.puppet_collection_for(:puppetserver, version)).to eq(collection)
|
237
229
|
end
|
238
230
|
end
|
239
231
|
end
|
240
|
-
|
232
|
+
|
241
233
|
it "returns the default, latest puppet collection given the version 'latest'" do
|
242
234
|
expect(subject.puppet_collection_for(:puppetserver, 'latest')).to eq('puppet')
|
243
235
|
end
|
244
|
-
|
236
|
+
|
245
237
|
context 'given an invalid version' do
|
246
238
|
[nil, '', '0.1.0', '3.8.1', '', 'not-semver', 'not.semver.either'].each do |version|
|
247
239
|
it "returns a nil collection value for version '#{version}'" do
|