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
@@ -11,27 +11,32 @@ class ClassMixedWithDSLInstallUtils
|
|
11
11
|
end
|
12
12
|
|
13
13
|
describe ClassMixedWithDSLInstallUtils do
|
14
|
-
let(:windows_temp)
|
15
|
-
let(:batch_path
|
14
|
+
let(:windows_temp) { 'C:\\Windows\\Temp' }
|
15
|
+
let(:batch_path) { '/fake/batch/path' }
|
16
16
|
let(:msi_path) { 'c:\\foo\\puppet.msi' }
|
17
|
-
let(:winhost)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
let(:winhost) do
|
18
|
+
make_host('winhost',
|
19
|
+
{ platform: Beaker::Platform.new('windows-2008r2-64'),
|
20
|
+
pe_ver: '3.0',
|
21
|
+
working_dir: '/tmp',
|
22
|
+
is_cygwin: true, })
|
23
|
+
end
|
24
|
+
let(:winhost_non_cygwin) do
|
25
|
+
make_host('winhost_non_cygwin',
|
26
|
+
{ platform: 'windows',
|
27
|
+
pe_ver: '3.0',
|
28
|
+
working_dir: '/tmp',
|
29
|
+
is_cygwin: 'false', })
|
30
|
+
end
|
31
|
+
let(:hosts) { [winhost, winhost_non_cygwin] }
|
28
32
|
|
29
33
|
def expect_install_called
|
30
34
|
result = Beaker::Result.new(nil, 'temp')
|
31
35
|
result.exit_code = 0
|
32
36
|
|
33
37
|
hosts.each do |host|
|
34
|
-
expectation = expect(subject).to receive(:on).with(host, having_attributes(command: "\"#{batch_path}\""),
|
38
|
+
expectation = expect(subject).to receive(:on).with(host, having_attributes(command: "\"#{batch_path}\""),
|
39
|
+
anything).and_return(result)
|
35
40
|
if block_given?
|
36
41
|
should_break = yield expectation
|
37
42
|
break if should_break
|
@@ -44,15 +49,16 @@ describe ClassMixedWithDSLInstallUtils do
|
|
44
49
|
result.exit_code = 0
|
45
50
|
result.stdout = case start_type
|
46
51
|
when 'DISABLED'
|
47
|
-
|
52
|
+
' START_TYPE : 4 DISABLED'
|
48
53
|
when 'AUTOMATIC'
|
49
|
-
|
54
|
+
' START_TYPE : 2 AUTO_START'
|
50
55
|
else # 'DEMAND_START'
|
51
|
-
|
56
|
+
' START_TYPE : 3 DEMAND_START'
|
52
57
|
end
|
53
58
|
|
54
59
|
hosts.each do |host|
|
55
|
-
expect(subject).to receive(:on).with(host,
|
60
|
+
expect(subject).to receive(:on).with(host,
|
61
|
+
having_attributes(command: 'sc qc puppet || sc qc pe-puppet')).and_yield(result)
|
56
62
|
end
|
57
63
|
end
|
58
64
|
|
@@ -69,11 +75,11 @@ describe ClassMixedWithDSLInstallUtils do
|
|
69
75
|
|
70
76
|
def expect_script_matches(hosts, contents)
|
71
77
|
hosts.each do |host|
|
72
|
-
expect(
|
73
|
-
.to receive(
|
78
|
+
expect(host)
|
79
|
+
.to receive(:do_scp_to) do |local_path, remote_path|
|
74
80
|
expect(File.read(local_path)).to match(contents)
|
75
81
|
end
|
76
|
-
.and_return(
|
82
|
+
.and_return(true)
|
77
83
|
end
|
78
84
|
end
|
79
85
|
|
@@ -84,7 +90,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
84
90
|
|
85
91
|
hosts.each do |host|
|
86
92
|
expect(subject).to receive(:on)
|
87
|
-
.with(host, having_attributes(command:
|
93
|
+
.with(host, having_attributes(command: /reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller/))
|
88
94
|
end
|
89
95
|
end
|
90
96
|
|
@@ -101,8 +107,8 @@ describe ClassMixedWithDSLInstallUtils do
|
|
101
107
|
end
|
102
108
|
end
|
103
109
|
|
104
|
-
describe
|
105
|
-
let(
|
110
|
+
describe '#install_msi_on' do
|
111
|
+
let(:log_file) { '/fake/log/file.log' }
|
106
112
|
|
107
113
|
before :each do
|
108
114
|
result = Beaker::Result.new(nil, 'temp')
|
@@ -114,83 +120,86 @@ describe ClassMixedWithDSLInstallUtils do
|
|
114
120
|
.and_return(result)
|
115
121
|
end
|
116
122
|
|
117
|
-
allow(
|
118
|
-
allow(
|
123
|
+
allow(subject).to receive(:file_exists_on).and_return(true)
|
124
|
+
allow(subject).to receive(:create_install_msi_batch_on).and_return([batch_path, log_file])
|
119
125
|
end
|
120
126
|
|
121
|
-
it
|
127
|
+
it 'will specify a PUPPET_AGENT_STARTUP_MODE of Manual by default' do
|
122
128
|
expect_install_called
|
123
129
|
expect_puppet_path_called
|
124
130
|
expect_status_called
|
125
131
|
expect_reg_query_called
|
126
132
|
expect_version_log_called
|
127
|
-
expect(
|
128
|
-
|
129
|
-
|
133
|
+
expect(subject).to receive(:create_install_msi_batch_on).with(
|
134
|
+
anything, anything,
|
135
|
+
{ 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' }
|
136
|
+
)
|
130
137
|
subject.install_msi_on(hosts, msi_path, {})
|
131
138
|
end
|
132
139
|
|
133
|
-
it
|
140
|
+
it 'allows configuration of PUPPET_AGENT_STARTUP_MODE to Automatic' do
|
134
141
|
expect_install_called
|
135
142
|
expect_puppet_path_called
|
136
143
|
expect_status_called('AUTOMATIC')
|
137
144
|
expect_reg_query_called
|
138
145
|
expect_version_log_called
|
139
146
|
value = 'Automatic'
|
140
|
-
expect(
|
141
|
-
|
142
|
-
|
143
|
-
|
147
|
+
expect(subject).to receive(:create_install_msi_batch_on).with(
|
148
|
+
anything, anything,
|
149
|
+
{ 'PUPPET_AGENT_STARTUP_MODE' => value }
|
150
|
+
)
|
151
|
+
subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => value })
|
144
152
|
end
|
145
153
|
|
146
|
-
it
|
154
|
+
it 'allows configuration of PUPPET_AGENT_STARTUP_MODE to Disabled' do
|
147
155
|
expect_install_called
|
148
156
|
expect_puppet_path_called
|
149
157
|
expect_status_called('DISABLED')
|
150
158
|
expect_reg_query_called
|
151
159
|
expect_version_log_called
|
152
160
|
value = 'Disabled'
|
153
|
-
expect(
|
161
|
+
expect(subject).to receive(:create_install_msi_batch_on).with(
|
154
162
|
anything, anything,
|
155
|
-
{'PUPPET_AGENT_STARTUP_MODE' => value}
|
156
|
-
|
163
|
+
{ 'PUPPET_AGENT_STARTUP_MODE' => value }
|
164
|
+
)
|
165
|
+
subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => value })
|
157
166
|
end
|
158
167
|
|
159
|
-
it
|
168
|
+
it 'will not generate a command to emit a log file without the :debug option set' do
|
160
169
|
expect_install_called
|
161
170
|
expect_puppet_path_called
|
162
171
|
expect_status_called
|
163
172
|
expect_reg_query_called
|
164
173
|
expect_version_log_called
|
165
174
|
|
166
|
-
expect(
|
175
|
+
expect(subject).to receive(:file_contents_on).with(anything, log_file).never
|
167
176
|
|
168
177
|
subject.install_msi_on(hosts, msi_path)
|
169
178
|
end
|
170
179
|
|
171
|
-
it
|
172
|
-
#
|
180
|
+
it 'will generate a command to emit a log file when the install script fails' do
|
181
|
+
# NOTE: a single failure aborts executing against remaining hosts
|
173
182
|
expect_install_called do |e|
|
174
183
|
e.and_raise
|
175
184
|
true # break
|
176
185
|
end
|
177
186
|
|
178
|
-
expect(
|
179
|
-
expect
|
187
|
+
expect(subject).to receive(:file_contents_on).with(anything, log_file)
|
188
|
+
expect do
|
180
189
|
subject.install_msi_on(hosts, msi_path)
|
181
|
-
|
190
|
+
end.to raise_error(RuntimeError)
|
182
191
|
end
|
183
192
|
|
184
|
-
it
|
193
|
+
it 'will generate a command to emit a log file with the :debug option set' do
|
185
194
|
expect_install_called
|
186
195
|
expect_reg_query_called
|
187
196
|
expect_puppet_path_called
|
188
197
|
expect_status_called
|
189
198
|
expect_version_log_called
|
190
199
|
|
191
|
-
expect(
|
200
|
+
expect(subject).to receive(:file_contents_on).with(anything, log_file).exactly(hosts.length).times
|
192
201
|
|
193
|
-
subject.install_msi_on(hosts, msi_path, {}, { :
|
202
|
+
subject.install_msi_on(hosts, msi_path, {}, { debug: true })
|
194
203
|
end
|
195
204
|
|
196
205
|
it 'will pass msi_path to #create_install_msi_batch_on as-is' do
|
@@ -200,8 +209,9 @@ describe ClassMixedWithDSLInstallUtils do
|
|
200
209
|
expect_status_called
|
201
210
|
expect_version_log_called
|
202
211
|
test_path = 'test/path'
|
203
|
-
expect(
|
204
|
-
|
212
|
+
expect(subject).to receive(:create_install_msi_batch_on).with(
|
213
|
+
anything, test_path, anything
|
214
|
+
)
|
205
215
|
subject.install_msi_on(hosts, test_path)
|
206
216
|
end
|
207
217
|
|
@@ -215,10 +225,10 @@ describe ClassMixedWithDSLInstallUtils do
|
|
215
225
|
expect(host).to receive(:is_x86_64?).and_return(true)
|
216
226
|
|
217
227
|
expect(subject).to receive(:on)
|
218
|
-
|
228
|
+
.with(host, having_attributes(command: 'reg query "HKLM\\SOFTWARE\\Wow6432Node\\Puppet Labs\\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual'))
|
219
229
|
end
|
220
230
|
|
221
|
-
subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' =>
|
231
|
+
subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' })
|
222
232
|
end
|
223
233
|
|
224
234
|
it 'will omit Wow6432Node in the registry search for remembered startup setting on 32-bit hosts' do
|
@@ -234,94 +244,96 @@ describe ClassMixedWithDSLInstallUtils do
|
|
234
244
|
.with(host, having_attributes(command: 'reg query "HKLM\\SOFTWARE\\Puppet Labs\\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual'))
|
235
245
|
end
|
236
246
|
|
237
|
-
subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' =>
|
247
|
+
subject.install_msi_on(hosts, msi_path, { 'PUPPET_AGENT_STARTUP_MODE' => 'Manual' })
|
238
248
|
end
|
239
249
|
end
|
240
250
|
|
241
251
|
describe '#create_install_msi_batch_on' do
|
242
|
-
let(
|
243
|
-
let(
|
252
|
+
let(:tmp) { '/tmp/create_install_msi_batch_on' }
|
253
|
+
let(:tmp_slashes) { tmp.gsub('/', '\\') }
|
244
254
|
|
245
255
|
before :each do
|
246
|
-
FakeFS::FileSystem.add(File.expand_path
|
256
|
+
FakeFS::FileSystem.add(File.expand_path(tmp))
|
247
257
|
hosts.each do |host|
|
248
|
-
allow(
|
258
|
+
allow(host).to receive(:system_temp_path).and_return(tmp)
|
249
259
|
end
|
250
260
|
end
|
251
261
|
|
252
262
|
it 'passes msi_path & msi_opts down to #msi_install_script' do
|
253
|
-
allow(
|
263
|
+
allow(winhost).to receive(:do_scp_to)
|
254
264
|
test_path = '/path/to/test/with/13540'
|
255
265
|
test_opts = { 'key1' => 'val1', 'key2' => 'val2' }
|
256
|
-
expect(
|
257
|
-
test_path, test_opts, anything
|
266
|
+
expect(subject).to receive(:msi_install_script).with(
|
267
|
+
test_path, test_opts, anything
|
268
|
+
)
|
258
269
|
subject.create_install_msi_batch_on(winhost, test_path, test_opts)
|
259
270
|
end
|
260
271
|
|
261
272
|
it 'SCPs to & returns the same batch file path, corrected for slashes' do
|
262
273
|
test_time = Time.now
|
263
|
-
allow(
|
274
|
+
allow(Time).to receive(:new).and_return(test_time)
|
264
275
|
timestamp = test_time.strftime('%Y-%m-%d_%H.%M.%S')
|
265
276
|
|
266
277
|
correct_path = "#{tmp_slashes}\\install-puppet-msi-#{timestamp}.bat"
|
267
|
-
expect(
|
268
|
-
test_path,
|
269
|
-
expect(
|
278
|
+
expect(winhost).to receive(:do_scp_to).with(anything, correct_path, {})
|
279
|
+
test_path, = subject.create_install_msi_batch_on(winhost, msi_path, {})
|
280
|
+
expect(test_path).to be === correct_path
|
270
281
|
end
|
271
282
|
|
272
283
|
it 'returns & sends log_path to #msi_install_scripts, corrected for slashes' do
|
273
|
-
allow(
|
284
|
+
allow(winhost).to receive(:do_scp_to)
|
274
285
|
test_time = Time.now
|
275
|
-
allow(
|
286
|
+
allow(Time).to receive(:new).and_return(test_time)
|
276
287
|
timestamp = test_time.strftime('%Y-%m-%d_%H.%M.%S')
|
277
288
|
|
278
289
|
correct_path = "#{tmp_slashes}\\install-puppet-#{timestamp}.log"
|
279
|
-
expect(
|
280
|
-
|
281
|
-
|
282
|
-
|
290
|
+
expect(subject).to receive(:msi_install_script).with(
|
291
|
+
anything, anything, correct_path
|
292
|
+
)
|
293
|
+
_, log_path = subject.create_install_msi_batch_on(winhost, msi_path, {})
|
294
|
+
expect(log_path).to be === correct_path
|
283
295
|
end
|
284
296
|
end
|
285
297
|
|
286
298
|
describe '#msi_install_script' do
|
287
|
-
let(
|
299
|
+
let(:log_path) { '/log/msi_install_script' }
|
288
300
|
|
289
301
|
context 'msi_params parameter' do
|
290
302
|
it 'can take an empty hash' do
|
291
|
-
expected_cmd =
|
292
|
-
expect(
|
303
|
+
expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ .exit}m
|
304
|
+
expect(subject.msi_install_script(msi_path, {}, log_path)).to match(expected_cmd)
|
293
305
|
end
|
294
306
|
|
295
307
|
it 'uses a key-value pair correctly' do
|
296
308
|
params = { 'tk1' => 'tv1' }
|
297
|
-
expected_cmd =
|
298
|
-
expect(
|
309
|
+
expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ tk1=tv1}
|
310
|
+
expect(subject.msi_install_script(msi_path, params, log_path)).to match(expected_cmd)
|
299
311
|
end
|
300
312
|
|
301
313
|
it 'uses multiple key-value pairs correctly' do
|
302
314
|
params = { 'tk1' => 'tv1', 'tk2' => 'tv2' }
|
303
|
-
expected_cmd =
|
304
|
-
expect(
|
315
|
+
expected_cmd = %r{^start /w msiexec\.exe /i ".*" /qn /L\*V #{log_path}\ tk1=tv1\ tk2=tv2}
|
316
|
+
expect(subject.msi_install_script(msi_path, params, log_path)).to match(expected_cmd)
|
305
317
|
end
|
306
318
|
end
|
307
319
|
|
308
320
|
context 'msi_path parameter' do
|
309
|
-
it
|
321
|
+
it 'will generate an appropriate command with a MSI file path using non-Windows slashes' do
|
310
322
|
msi_path = 'c:/foo/puppet.msi'
|
311
|
-
expected_cmd =
|
312
|
-
expect(
|
323
|
+
expected_cmd = %r{^start /w msiexec\.exe /i "c:\\foo\\puppet.msi" /qn /L\*V #{log_path}}
|
324
|
+
expect(subject.msi_install_script(msi_path, {}, log_path)).to match(expected_cmd)
|
313
325
|
end
|
314
326
|
|
315
|
-
it
|
316
|
-
msi_url =
|
317
|
-
expected_cmd =
|
318
|
-
expect(
|
327
|
+
it 'will generate an appropriate command with a MSI http(s) url' do
|
328
|
+
msi_url = 'https://downloads.puppetlabs.com/puppet.msi'
|
329
|
+
expected_cmd = %r{^start /w msiexec\.exe /i "https://downloads\.puppetlabs\.com/puppet\.msi" /qn /L\*V #{log_path}}
|
330
|
+
expect(subject.msi_install_script(msi_url, {}, log_path)).to match(expected_cmd)
|
319
331
|
end
|
320
332
|
|
321
|
-
it
|
322
|
-
msi_url =
|
323
|
-
expected_cmd =
|
324
|
-
expect(
|
333
|
+
it 'will generate an appropriate command with a MSI file url' do
|
334
|
+
msi_url = 'file://c:\\foo\\puppet.msi'
|
335
|
+
expected_cmd = %r{^start /w msiexec\.exe /i "file://c:\\foo\\puppet\.msi" /qn /L\*V #{log_path}}
|
336
|
+
expect(subject.msi_install_script(msi_url, {}, log_path)).to match(expected_cmd)
|
325
337
|
end
|
326
338
|
end
|
327
339
|
end
|
@@ -5,29 +5,29 @@ class ClassMixedWithDSLWrappers
|
|
5
5
|
end
|
6
6
|
|
7
7
|
describe ClassMixedWithDSLWrappers do
|
8
|
-
let(:empty_opts) { {'ENV' => {}, :cmdexe => true } }
|
8
|
+
let(:empty_opts) { { 'ENV' => {}, :cmdexe => true } }
|
9
9
|
|
10
10
|
describe '#facter' do
|
11
11
|
it 'should split out the options and pass "facter" as first arg to Command' do
|
12
|
-
expect(
|
13
|
-
with('facter', [
|
14
|
-
subject.facter(
|
12
|
+
expect(Beaker::Command).to receive(:new)
|
13
|
+
.with('facter', ['-p'], empty_opts)
|
14
|
+
subject.facter('-p')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#cfacter' do
|
19
19
|
it 'should split out the options and pass "cfacter" as first arg to Command' do
|
20
|
-
expect(
|
21
|
-
with('cfacter', [
|
22
|
-
subject.cfacter(
|
20
|
+
expect(Beaker::Command).to receive(:new)
|
21
|
+
.with('cfacter', ['-p'], empty_opts)
|
22
|
+
subject.cfacter('-p')
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe 'deprecated puppet wrappers' do
|
27
|
-
%w
|
27
|
+
%w[resource doc kick cert apply master agent filebucket].each do |sub|
|
28
28
|
it "#{sub} delegates the proper info to #puppet" do
|
29
|
-
expect(
|
30
|
-
subject.send(
|
29
|
+
expect(subject).to receive(:puppet).with(sub, 'blah')
|
30
|
+
subject.send("puppet_#{sub}", 'blah')
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|