puppet_litmus 0.34.3 → 0.34.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec60ae7ab88bc74fccfa22c04a83a89fbabaeab56885811babafcc33ec7aa122
4
- data.tar.gz: b60bab49299dec0ec5e6652c4535baf63196cb896680aa637eba98204ea4ac73
3
+ metadata.gz: ff985b189104c3cbf55d310c602ea525c4ea40a7ad066ed2b0fe078488012416
4
+ data.tar.gz: 1bbb7872b1850112936d8222bdeaa71f966da7fa29865950b7a334231e49285b
5
5
  SHA512:
6
- metadata.gz: 79d7c7fd85e94e2e040ca489bae950a2385fc30b7986a3800fc25b4bc29c0d3fb0f1b46b5bb9d02b5d86234dd52ae5cf0a9d79ea60e734d854848a29fa485be9
7
- data.tar.gz: 2b67b3847d438a69c6a6518684365ad135b3c59a74ff3227de30dd6d9544a5e124a43855d52e4b88974d09652ae11bae8884e871431eec605e76decf257e50d0
6
+ metadata.gz: 984af2490dbd1e17592b2856bd530ddb68e4ee133653157646d110161f4400963d8bb12da097f597981ee191834416544a6b27d5b4bff6586264b31d9b4a6326
7
+ data.tar.gz: a7d440fd1b7678efecaec60147fa1672850c93d376fc808f7a25ca58a1f074c3106433acaa68a2015af201beee81f860b3e7dc96c7d02f50119f51f81cb0c9e6
@@ -11,9 +11,8 @@ IMAGE_TABLE = {
11
11
  'RedHat-9' => 'rhel-9',
12
12
  'SLES-12' => 'sles-12',
13
13
  'SLES-15' => 'sles-15',
14
- 'Windows-2012 R2' => 'windows-2012-r2-core',
15
14
  'Windows-2016' => 'windows-2016',
16
- 'Windows-2019' => 'windows-2019-core',
15
+ 'Windows-2019' => 'windows-2019',
17
16
  'Windows-2022' => 'windows-2022',
18
17
  }.freeze
19
18
 
@@ -231,11 +231,11 @@ module PuppetLitmus::RakeHelper
231
231
  def configure_path(inventory_hash)
232
232
  results = []
233
233
  # fix the path on ssh_nodes
234
- unless inventory_hash['groups'].select { |group| group['name'] == 'ssh_nodes' && !group['targets'].empty? }.size.zero?
234
+ unless inventory_hash['groups'].select { |group| group['name'] == 'ssh_nodes' && !group['targets'].empty? }.empty?
235
235
  results << run_command('echo PATH="$PATH:/opt/puppetlabs/puppet/bin" > /etc/environment',
236
236
  'ssh_nodes', config: nil, inventory: inventory_hash)
237
237
  end
238
- unless inventory_hash['groups'].select { |group| group['name'] == 'winrm_nodes' && !group['targets'].empty? }.size.zero?
238
+ unless inventory_hash['groups'].select { |group| group['name'] == 'winrm_nodes' && !group['targets'].empty? }.empty?
239
239
  results << run_command('[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Puppet Labs\Puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\bin", "Machine")',
240
240
  'winrm_nodes', config: nil, inventory: inventory_hash)
241
241
  end
@@ -377,7 +377,7 @@ module PuppetLitmus::RakeHelper
377
377
  end
378
378
  span.add_field('litmus.connectivity_success', results.select { |r| r['status'] == 'success' })
379
379
  span.add_field('litmus.connectivity_failure', results.reject { |r| r['status'] == 'success' })
380
- raise "Connectivity has failed on: #{failed}" unless failed.length.zero?
380
+ raise "Connectivity has failed on: #{failed}" unless failed.empty?
381
381
 
382
382
  puts 'Connectivity check PASSED.'
383
383
  true
@@ -328,7 +328,7 @@ namespace :litmus do
328
328
  end
329
329
  puts ''
330
330
  # output the things that went wrong, after the successes
331
- puts 'something went wrong:' unless bad_results.size.zero?
331
+ puts 'something went wrong:' unless bad_results.empty?
332
332
  bad_results.each do |result|
333
333
  puts result
334
334
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.34.3'
5
+ VERSION ||= '0.34.5'
6
6
  end
@@ -7,8 +7,8 @@ RSpec.describe PuppetLitmus::InventoryManipulation do
7
7
  let(:inventory_full_path) { 'spec/data/inventory.yaml' }
8
8
 
9
9
  context 'with config_from_node' do
10
- it 'no matching node, raises' do
11
- expect { config_from_node(config_hash, 'not.here') }.to raise_error('No config was found for not.here')
10
+ it 'no matching node, returns nil' do
11
+ expect(config_from_node(config_hash, 'not.here')).to eq(nil)
12
12
  end
13
13
 
14
14
  it 'no config section, returns nil' do
@@ -16,8 +16,7 @@ RSpec.describe PuppetLitmus::InventoryManipulation do
16
16
  end
17
17
 
18
18
  it 'config exists, and returns' do
19
- expect(config_from_node(config_hash, 'test.delivery.puppetlabs.net')).to eq('transport' => 'ssh', 'ssh' =>
20
- { 'user' => 'root', 'password' => 'Qu@lity!', 'host-key-check' => false })
19
+ expect(config_from_node(config_hash, 'test.delivery.puppetlabs.net')).to eq('transport' => 'ssh', 'ssh' => { 'user' => 'root', 'password' => 'Qu@lity!', 'host-key-check' => false })
21
20
  end
22
21
 
23
22
  it 'facts exists, and returns' do
@@ -41,6 +41,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
41
41
  it 'passes the --hiera_config flag if the :hiera_config opt is specified' do
42
42
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
43
43
  expect(self).to receive(:target_in_inventory?).and_return(true)
44
+ expect(self).to receive(:target_in_inventory?).and_return(true)
44
45
  expect(self).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
45
46
  expect(self).to receive(:run_command).with(command, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
46
47
  apply_manifest(manifest, hiera_config: '/hiera.yaml')
@@ -60,6 +61,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
60
61
  it 'uses detailed-exitcodes with expect_failures' do
61
62
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
62
63
  expect(self).to receive(:target_in_inventory?).and_return(true)
64
+ expect(self).to receive(:target_in_inventory?).and_return(true)
63
65
  expect(self).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
64
66
  expect(self).to receive(:run_command).with(command, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
65
67
  expect { apply_manifest(manifest, expect_failures: true) }.to raise_error(RuntimeError)
@@ -68,6 +70,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
68
70
  it 'uses detailed-exitcodes with catch_failures' do
69
71
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
70
72
  expect(self).to receive(:target_in_inventory?).and_return(true)
73
+ expect(self).to receive(:target_in_inventory?).and_return(true)
71
74
  expect(self).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
72
75
  expect(self).to receive(:run_command).with(command, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
73
76
  apply_manifest(manifest, catch_failures: true)
@@ -76,6 +79,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
76
79
  it 'uses detailed-exitcodes with expect_changes' do
77
80
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
78
81
  expect(self).to receive(:target_in_inventory?).and_return(true)
82
+ expect(self).to receive(:target_in_inventory?).and_return(true)
79
83
  expect(self).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
80
84
  expect(self).to receive(:run_command).with(command, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
81
85
  expect { apply_manifest(manifest, expect_changes: true) }.to raise_error(RuntimeError)
@@ -84,6 +88,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
84
88
  it 'uses detailed-exitcodes with catch_changes' do
85
89
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
86
90
  expect(self).to receive(:target_in_inventory?).and_return(true)
91
+ expect(self).to receive(:target_in_inventory?).and_return(true)
87
92
  expect(self).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
88
93
  expect(self).to receive(:run_command).with(command, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
89
94
  apply_manifest(manifest, catch_changes: true)
@@ -109,6 +114,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
109
114
  stub_const('ENV', ENV.to_hash.merge('TARGET_HOST' => 'localhost'))
110
115
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
111
116
  expect(self).to receive(:target_in_inventory?).and_return(true)
117
+ expect(self).to receive(:target_in_inventory?).and_return(true)
112
118
  expect(self).to receive(:run_command).with(command_to_run, 'litmus_localhost', config: nil, inventory: localhost_inventory_hash).and_return(result)
113
119
  expect { run_shell(command_to_run) }.not_to raise_error
114
120
  end
@@ -120,6 +126,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
120
126
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
121
127
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
122
128
  expect(self).to receive(:target_in_inventory?).and_return(true)
129
+ expect(self).to receive(:target_in_inventory?).and_return(true)
123
130
  expect(self).to receive(:run_command).with(command_to_run, 'some.host', config: nil, inventory: inventory_hash).and_return(result)
124
131
  expect { run_shell(command_to_run) }.not_to raise_error
125
132
  end
@@ -145,6 +152,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
145
152
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
146
153
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
147
154
  expect(self).to receive(:target_in_inventory?).and_return(true)
155
+ expect(self).to receive(:target_in_inventory?).and_return(true)
148
156
  expect(self).to receive(:upload_file).with(local, remote, 'some.host', options: {}, config: nil, inventory: inventory_hash).and_return(result_success)
149
157
  expect { bolt_upload_file(local, remote) }.not_to raise_error
150
158
  end
@@ -154,6 +162,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
154
162
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
155
163
  expect(self).not_to receive(:inventory_hash_from_inventory_file)
156
164
  expect(self).to receive(:target_in_inventory?).and_return(true)
165
+ expect(self).to receive(:target_in_inventory?).and_return(true)
157
166
  expect(self).to receive(:upload_file).with(local, remote, 'litmus_localhost', options: {}, config: nil, inventory: localhost_inventory_hash).and_return(result_success)
158
167
  expect { bolt_upload_file(local, remote) }.not_to raise_error
159
168
  end
@@ -165,6 +174,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
165
174
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
166
175
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
167
176
  expect(self).to receive(:target_in_inventory?).and_return(true)
177
+ expect(self).to receive(:target_in_inventory?).and_return(true)
168
178
  expect(self).to receive(:upload_file).with(local, remote, 'some.host', options: {}, config: nil, inventory: inventory_hash).and_return(result_failure)
169
179
  expect { bolt_upload_file(local, remote) }.to raise_error(RuntimeError, %r{upload file failed})
170
180
  end
@@ -174,6 +184,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
174
184
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
175
185
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
176
186
  expect(self).to receive(:target_in_inventory?).and_return(true)
187
+ expect(self).to receive(:target_in_inventory?).and_return(true)
177
188
  expect(self).to receive(:upload_file).with(local, remote, 'some.host', options: {}, config: nil, inventory: inventory_hash).and_return(result_failure)
178
189
  method_result = bolt_upload_file(local, remote, expect_failures: true)
179
190
  expect(method_result.exit_code).to be(255)
@@ -196,6 +207,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
196
207
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
197
208
  expect(self).not_to receive(:inventory_hash_from_inventory_file)
198
209
  expect(self).to receive(:target_in_inventory?).and_return(true)
210
+ expect(self).to receive(:target_in_inventory?).and_return(true)
199
211
  expect(self).to receive(:run_script).with(script, 'litmus_localhost', [], options: {}, config: nil, inventory: localhost_inventory_hash).and_return(result)
200
212
  expect { bolt_run_script(script) }.not_to raise_error
201
213
  end
@@ -207,6 +219,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
207
219
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
208
220
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
209
221
  expect(self).to receive(:target_in_inventory?).and_return(true)
222
+ expect(self).to receive(:target_in_inventory?).and_return(true)
210
223
  expect(self).to receive(:run_script).with(script, 'some.host', [], options: {}, config: nil, inventory: inventory_hash).and_return(result)
211
224
  expect { bolt_run_script(script) }.not_to raise_error
212
225
  end
@@ -218,6 +231,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
218
231
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(false)
219
232
  expect(self).not_to receive(:inventory_hash_from_inventory_file)
220
233
  expect(self).to receive(:target_in_inventory?).and_return(true)
234
+ expect(self).to receive(:target_in_inventory?).and_return(true)
221
235
  expect(self).to receive(:run_script).with(script, 'litmus_localhost', ['doot'], options: {}, config: nil, inventory: localhost_inventory_hash).and_return(result)
222
236
  expect { bolt_run_script(script, arguments: ['doot']) }.not_to raise_error
223
237
  end
@@ -245,6 +259,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
245
259
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
246
260
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
247
261
  expect(self).to receive(:target_in_inventory?).and_return(true)
262
+ expect(self).to receive(:target_in_inventory?).and_return(true)
248
263
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_unstructured_task_success)
249
264
  expect { run_bolt_task(task_name, params, opts: {}) }.not_to raise_error
250
265
  end
@@ -254,6 +269,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
254
269
  expect(File).to receive(:exist?).with('jim.yaml').and_return(true)
255
270
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
256
271
  expect(self).to receive(:target_in_inventory?).and_return(true)
272
+ expect(self).to receive(:target_in_inventory?).and_return(true)
257
273
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_unstructured_task_success)
258
274
  expect { run_bolt_task(task_name, params, inventory_file: 'jim.yaml') }.not_to raise_error
259
275
  end
@@ -263,6 +279,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
263
279
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
264
280
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
265
281
  expect(self).to receive(:target_in_inventory?).and_return(true)
282
+ expect(self).to receive(:target_in_inventory?).and_return(true)
266
283
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_unstructured_task_success)
267
284
  method_result = run_bolt_task(task_name, params, opts: {})
268
285
  expect(method_result.stdout).to eq('SUCCESS!')
@@ -273,6 +290,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
273
290
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
274
291
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
275
292
  expect(self).to receive(:target_in_inventory?).and_return(true)
293
+ expect(self).to receive(:target_in_inventory?).and_return(true)
276
294
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_structured_task_success)
277
295
  method_result = run_bolt_task(task_name, params, opts: {})
278
296
  expect(method_result.stdout).to eq('{"key1"=>"foo", "key2"=>"bar"}')
@@ -287,6 +305,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
287
305
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
288
306
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
289
307
  expect(self).to receive(:target_in_inventory?).and_return(true)
308
+ expect(self).to receive(:target_in_inventory?).and_return(true)
290
309
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_failure)
291
310
  expect { run_bolt_task(task_name, params, opts: {}) }.to raise_error(RuntimeError, %r{task failed})
292
311
  end
@@ -296,6 +315,7 @@ RSpec.describe PuppetLitmus::PuppetHelpers do
296
315
  expect(File).to receive(:exist?).with('spec/fixtures/litmus_inventory.yaml').and_return(true)
297
316
  expect(self).to receive(:inventory_hash_from_inventory_file).and_return(inventory_hash)
298
317
  expect(self).to receive(:target_in_inventory?).and_return(true)
318
+ expect(self).to receive(:target_in_inventory?).and_return(true)
299
319
  expect(self).to receive(:run_task).with(task_name, 'some.host', params, config: config_data, inventory: inventory_hash).and_return(result_failure)
300
320
  method_result = run_bolt_task(task_name, params, expect_failures: true)
301
321
  expect(method_result.exit_code).to be(123)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_litmus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.3
4
+ version: 0.34.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-12 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt
@@ -209,23 +209,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.0.3
212
+ rubygems_version: 3.1.6
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Providing a simple command line tool for puppet content creators, to enable
216
216
  simple and complex test deployments.
217
217
  test_files:
218
- - spec/spec_helper.rb
219
- - spec/support/inventory.rb
220
- - spec/support/inventorytesting.yaml
221
- - spec/lib/puppet_litmus/rake_tasks_spec.rb
222
- - spec/lib/puppet_litmus/puppet_litmus_version_spec.rb
223
- - spec/lib/puppet_litmus/util_spec.rb
224
- - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
225
- - spec/lib/puppet_litmus/rake_helper_spec.rb
226
- - spec/lib/puppet_litmus/puppet_helpers_spec.rb
227
218
  - spec/exe/fake_metadata.json
228
219
  - spec/exe/matrix_from_metadata_v2_spec.rb
229
220
  - spec/data/doot.tar.gz
230
221
  - spec/data/jim.yaml
231
222
  - spec/data/inventory.yaml
223
+ - spec/lib/puppet_litmus/puppet_litmus_version_spec.rb
224
+ - spec/lib/puppet_litmus/rake_helper_spec.rb
225
+ - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
226
+ - spec/lib/puppet_litmus/util_spec.rb
227
+ - spec/lib/puppet_litmus/puppet_helpers_spec.rb
228
+ - spec/lib/puppet_litmus/rake_tasks_spec.rb
229
+ - spec/spec_helper.rb
230
+ - spec/support/inventory.rb
231
+ - spec/support/inventorytesting.yaml