train 1.5.11 → 1.6.3

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/train/transports/winrm.rb +16 -4
  3. data/lib/train/version.rb +1 -1
  4. metadata +3 -165
  5. data/.rubocop.yml +0 -77
  6. data/CHANGELOG.md +0 -900
  7. data/Gemfile +0 -41
  8. data/README.md +0 -212
  9. data/Rakefile +0 -73
  10. data/test/fixtures/plugins/train-test-fixture/LICENSE +0 -201
  11. data/test/fixtures/plugins/train-test-fixture/README.md +0 -5
  12. data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/connection.rb +0 -35
  13. data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/platform.rb +0 -18
  14. data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/transport.rb +0 -14
  15. data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/version.rb +0 -5
  16. data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture.rb +0 -4
  17. data/test/fixtures/plugins/train-test-fixture/pkg/train-test-fixture-0.1.0.gem +0 -0
  18. data/test/fixtures/plugins/train-test-fixture/train-test-fixture.gemspec +0 -35
  19. data/test/integration/.kitchen.yml +0 -43
  20. data/test/integration/Berksfile +0 -3
  21. data/test/integration/bootstrap.sh +0 -22
  22. data/test/integration/chefignore +0 -1
  23. data/test/integration/cookbooks/test/metadata.rb +0 -1
  24. data/test/integration/cookbooks/test/recipes/default.rb +0 -100
  25. data/test/integration/cookbooks/test/recipes/prep_files.rb +0 -56
  26. data/test/integration/docker_run.rb +0 -153
  27. data/test/integration/docker_test.rb +0 -24
  28. data/test/integration/docker_test_container.rb +0 -24
  29. data/test/integration/helper.rb +0 -61
  30. data/test/integration/sudo/customcommand.rb +0 -15
  31. data/test/integration/sudo/nopasswd.rb +0 -16
  32. data/test/integration/sudo/passwd.rb +0 -21
  33. data/test/integration/sudo/reqtty.rb +0 -17
  34. data/test/integration/sudo/run_as.rb +0 -12
  35. data/test/integration/test-travis-centos.yml +0 -6
  36. data/test/integration/test-travis-debian.yml +0 -6
  37. data/test/integration/test-travis-fedora.yml +0 -8
  38. data/test/integration/test-travis-oel.yml +0 -6
  39. data/test/integration/test-travis-ubuntu.yml +0 -8
  40. data/test/integration/test_local.rb +0 -19
  41. data/test/integration/test_ssh.rb +0 -39
  42. data/test/integration/tests/path_block_device_test.rb +0 -74
  43. data/test/integration/tests/path_character_device_test.rb +0 -74
  44. data/test/integration/tests/path_file_test.rb +0 -99
  45. data/test/integration/tests/path_folder_test.rb +0 -90
  46. data/test/integration/tests/path_missing_test.rb +0 -76
  47. data/test/integration/tests/path_pipe_test.rb +0 -62
  48. data/test/integration/tests/path_symlink_test.rb +0 -95
  49. data/test/integration/tests/run_command_test.rb +0 -35
  50. data/test/unit/extras/command_wrapper_test.rb +0 -110
  51. data/test/unit/extras/stat_test.rb +0 -210
  52. data/test/unit/file/local/unix_test.rb +0 -224
  53. data/test/unit/file/local/windows_test.rb +0 -101
  54. data/test/unit/file/local_test.rb +0 -121
  55. data/test/unit/file/remote/aix_test.rb +0 -81
  56. data/test/unit/file/remote/linux_test.rb +0 -221
  57. data/test/unit/file/remote/qnx_test.rb +0 -80
  58. data/test/unit/file/remote/unix_test.rb +0 -119
  59. data/test/unit/file/remote/windows_test.rb +0 -72
  60. data/test/unit/file/remote_test.rb +0 -62
  61. data/test/unit/file_test.rb +0 -129
  62. data/test/unit/helper.rb +0 -7
  63. data/test/unit/platforms/detect/os_common_test.rb +0 -85
  64. data/test/unit/platforms/detect/os_linux_test.rb +0 -132
  65. data/test/unit/platforms/detect/os_windows_test.rb +0 -107
  66. data/test/unit/platforms/detect/scanner_test.rb +0 -61
  67. data/test/unit/platforms/detect/uuid_test.rb +0 -133
  68. data/test/unit/platforms/family_test.rb +0 -32
  69. data/test/unit/platforms/os_detect_test.rb +0 -249
  70. data/test/unit/platforms/platform_test.rb +0 -405
  71. data/test/unit/platforms/platforms_test.rb +0 -52
  72. data/test/unit/plugins/connection_test.rb +0 -219
  73. data/test/unit/plugins/transport_test.rb +0 -111
  74. data/test/unit/plugins_test.rb +0 -22
  75. data/test/unit/train_test.rb +0 -247
  76. data/test/unit/transports/aws_test.rb +0 -120
  77. data/test/unit/transports/azure_test.rb +0 -145
  78. data/test/unit/transports/cisco_ios_connection.rb +0 -92
  79. data/test/unit/transports/gcp_test.rb +0 -266
  80. data/test/unit/transports/helpers/azure/file_credentials_test.rb +0 -129
  81. data/test/unit/transports/local_test.rb +0 -183
  82. data/test/unit/transports/mock_test.rb +0 -150
  83. data/test/unit/transports/ssh_test.rb +0 -330
  84. data/test/unit/transports/vmware_test.rb +0 -159
  85. data/test/unit/version_test.rb +0 -8
  86. data/test/windows/local_test.rb +0 -243
  87. data/test/windows/winrm_test.rb +0 -187
  88. data/train.gemspec +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4053a5448990953c02982f884a3af8d00166920843713ffea3e126848db9f04e
4
- data.tar.gz: 468e054659adf76575bc32bb56b3b31e615ba3eae84601573689bcfd1881abd6
3
+ metadata.gz: 8769ecc9e3ecf63139d0dcbdd4464161e3e9dc246c4dcd31017e0aa6f3749076
4
+ data.tar.gz: 161ef818dddabbb473733ac38308332f9ce400a5679648d937fe259a5f2ad60d
5
5
  SHA512:
6
- metadata.gz: 0c6921286cd8ae8779452e28cc9f0d0ad2e97223e2b39cad4593a2774e92c2580eae78f24f664136948c9746e76076a72f51ed55e11fdeacbc569f8c49335ca2
7
- data.tar.gz: '06485051796b00ec02e7325f211f61de842008e386a8b855eef52166fe7160975a9745a68305dd669aa8341bcfdafafbae2e3cb6a47ca6803371621cfc5554d5'
6
+ metadata.gz: 49dcf05e5532d235723c0b66029ea82183c9baec663f1c8421d6c2134374aa02154eb9677551d593a5adef2e952aa6ba0ac8d7da6b6702e54db867d911d6ab4b
7
+ data.tar.gz: a83fdb31f658510168815b534851e01e34929c77c68ef6a11560c67a7c62b985828cafee2533e5ca1c96e54754eb3629d6c3d2d43713ca04c06ebc736c107886
@@ -35,16 +35,24 @@ module Train::Transports
35
35
  # @author Matt Wrock <matt@mattwrock.com>
36
36
  # @author Salim Afiune <salim@afiunemaya.com.mx>
37
37
  # @author Fletcher Nichol <fnichol@nichol.ca>
38
- class WinRM < Train.plugin(1)
38
+ class WinRM < Train.plugin(1) # rubocop:disable ClassLength
39
39
  name 'winrm'
40
40
 
41
41
  require 'train/transports/winrm_connection'
42
42
 
43
+ # ref: https://github.com/WinRb/Winrm#transports
44
+ # kerberos is skipped here as the options are not exposed in train
45
+ # basic ssl options is only supported
46
+ SUPPORTED_WINRM_TRANSPORTS = %i(negotiate ssl plaintext).freeze
47
+
43
48
  # common target configuration
44
49
  option :host, required: true
45
50
  option :port
46
51
  option :user, default: 'administrator', required: true
47
52
  option :password, nil
53
+ option :winrm_transport, default: :negotiate
54
+ option :winrm_disable_sspi, default: false
55
+ option :winrm_basic_auth_only, default: false
48
56
  option :path, default: '/wsman'
49
57
  option :ssl, default: false
50
58
  option :self_signed, default: false
@@ -82,6 +90,10 @@ module Train::Transports
82
90
  scheme = opts[:ssl] ? 'https' : 'http'
83
91
  port = opts[:port]
84
92
  port = (opts[:ssl] ? 5986 : 5985) if port.nil?
93
+ winrm_transport = opts[:winrm_transport].to_sym
94
+ unless SUPPORTED_WINRM_TRANSPORTS.any? { |t| winrm_transport == t }
95
+ fail Train::ClientError, "Unsupported transport type: #{winrm_transport.inspect}"
96
+ end
85
97
 
86
98
  # remove leading '/'
87
99
  path = (opts[:path] || '').sub(%r{^/+}, '')
@@ -100,9 +112,9 @@ module Train::Transports
100
112
  def connection_options(opts)
101
113
  {
102
114
  logger: logger,
103
- transport: :negotiate,
104
- disable_sspi: false,
105
- basic_auth_only: false,
115
+ transport: opts[:winrm_transport].to_sym,
116
+ disable_sspi: opts[:winrm_disable_sspi],
117
+ basic_auth_only: opts[:winrm_basic_auth_only],
106
118
  hostname: opts[:host],
107
119
  endpoint: opts[:endpoint],
108
120
  user: opts[:user],
data/lib/train/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '1.5.11'.freeze
6
+ VERSION = '1.6.3'.freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.11
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-10 00:00:00.000000000 Z
11
+ date: 2018-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -239,12 +239,7 @@ executables: []
239
239
  extensions: []
240
240
  extra_rdoc_files: []
241
241
  files:
242
- - ".rubocop.yml"
243
- - CHANGELOG.md
244
- - Gemfile
245
242
  - LICENSE
246
- - README.md
247
- - Rakefile
248
243
  - lib/train.rb
249
244
  - lib/train/errors.rb
250
245
  - lib/train/extras.rb
@@ -297,85 +292,6 @@ files:
297
292
  - lib/train/transports/winrm.rb
298
293
  - lib/train/transports/winrm_connection.rb
299
294
  - lib/train/version.rb
300
- - test/fixtures/plugins/train-test-fixture/LICENSE
301
- - test/fixtures/plugins/train-test-fixture/README.md
302
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture.rb
303
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/connection.rb
304
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/platform.rb
305
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/transport.rb
306
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/version.rb
307
- - test/fixtures/plugins/train-test-fixture/pkg/train-test-fixture-0.1.0.gem
308
- - test/fixtures/plugins/train-test-fixture/train-test-fixture.gemspec
309
- - test/integration/.kitchen.yml
310
- - test/integration/Berksfile
311
- - test/integration/bootstrap.sh
312
- - test/integration/chefignore
313
- - test/integration/cookbooks/test/metadata.rb
314
- - test/integration/cookbooks/test/recipes/default.rb
315
- - test/integration/cookbooks/test/recipes/prep_files.rb
316
- - test/integration/docker_run.rb
317
- - test/integration/docker_test.rb
318
- - test/integration/docker_test_container.rb
319
- - test/integration/helper.rb
320
- - test/integration/sudo/customcommand.rb
321
- - test/integration/sudo/nopasswd.rb
322
- - test/integration/sudo/passwd.rb
323
- - test/integration/sudo/reqtty.rb
324
- - test/integration/sudo/run_as.rb
325
- - test/integration/test-travis-centos.yml
326
- - test/integration/test-travis-debian.yml
327
- - test/integration/test-travis-fedora.yml
328
- - test/integration/test-travis-oel.yml
329
- - test/integration/test-travis-ubuntu.yml
330
- - test/integration/test_local.rb
331
- - test/integration/test_ssh.rb
332
- - test/integration/tests/path_block_device_test.rb
333
- - test/integration/tests/path_character_device_test.rb
334
- - test/integration/tests/path_file_test.rb
335
- - test/integration/tests/path_folder_test.rb
336
- - test/integration/tests/path_missing_test.rb
337
- - test/integration/tests/path_pipe_test.rb
338
- - test/integration/tests/path_symlink_test.rb
339
- - test/integration/tests/run_command_test.rb
340
- - test/unit/extras/command_wrapper_test.rb
341
- - test/unit/extras/stat_test.rb
342
- - test/unit/file/local/unix_test.rb
343
- - test/unit/file/local/windows_test.rb
344
- - test/unit/file/local_test.rb
345
- - test/unit/file/remote/aix_test.rb
346
- - test/unit/file/remote/linux_test.rb
347
- - test/unit/file/remote/qnx_test.rb
348
- - test/unit/file/remote/unix_test.rb
349
- - test/unit/file/remote/windows_test.rb
350
- - test/unit/file/remote_test.rb
351
- - test/unit/file_test.rb
352
- - test/unit/helper.rb
353
- - test/unit/platforms/detect/os_common_test.rb
354
- - test/unit/platforms/detect/os_linux_test.rb
355
- - test/unit/platforms/detect/os_windows_test.rb
356
- - test/unit/platforms/detect/scanner_test.rb
357
- - test/unit/platforms/detect/uuid_test.rb
358
- - test/unit/platforms/family_test.rb
359
- - test/unit/platforms/os_detect_test.rb
360
- - test/unit/platforms/platform_test.rb
361
- - test/unit/platforms/platforms_test.rb
362
- - test/unit/plugins/connection_test.rb
363
- - test/unit/plugins/transport_test.rb
364
- - test/unit/plugins_test.rb
365
- - test/unit/train_test.rb
366
- - test/unit/transports/aws_test.rb
367
- - test/unit/transports/azure_test.rb
368
- - test/unit/transports/cisco_ios_connection.rb
369
- - test/unit/transports/gcp_test.rb
370
- - test/unit/transports/helpers/azure/file_credentials_test.rb
371
- - test/unit/transports/local_test.rb
372
- - test/unit/transports/mock_test.rb
373
- - test/unit/transports/ssh_test.rb
374
- - test/unit/transports/vmware_test.rb
375
- - test/unit/version_test.rb
376
- - test/windows/local_test.rb
377
- - test/windows/winrm_test.rb
378
- - train.gemspec
379
295
  homepage: https://github.com/inspec/train/
380
296
  licenses:
381
297
  - Apache-2.0
@@ -400,82 +316,4 @@ rubygems_version: 2.7.6
400
316
  signing_key:
401
317
  specification_version: 4
402
318
  summary: Transport interface to talk to different backends.
403
- test_files:
404
- - test/fixtures/plugins/train-test-fixture/LICENSE
405
- - test/fixtures/plugins/train-test-fixture/README.md
406
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture.rb
407
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/connection.rb
408
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/platform.rb
409
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/transport.rb
410
- - test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/version.rb
411
- - test/fixtures/plugins/train-test-fixture/pkg/train-test-fixture-0.1.0.gem
412
- - test/fixtures/plugins/train-test-fixture/train-test-fixture.gemspec
413
- - test/integration/.kitchen.yml
414
- - test/integration/Berksfile
415
- - test/integration/bootstrap.sh
416
- - test/integration/chefignore
417
- - test/integration/cookbooks/test/metadata.rb
418
- - test/integration/cookbooks/test/recipes/default.rb
419
- - test/integration/cookbooks/test/recipes/prep_files.rb
420
- - test/integration/docker_run.rb
421
- - test/integration/docker_test.rb
422
- - test/integration/docker_test_container.rb
423
- - test/integration/helper.rb
424
- - test/integration/sudo/customcommand.rb
425
- - test/integration/sudo/nopasswd.rb
426
- - test/integration/sudo/passwd.rb
427
- - test/integration/sudo/reqtty.rb
428
- - test/integration/sudo/run_as.rb
429
- - test/integration/test-travis-centos.yml
430
- - test/integration/test-travis-debian.yml
431
- - test/integration/test-travis-fedora.yml
432
- - test/integration/test-travis-oel.yml
433
- - test/integration/test-travis-ubuntu.yml
434
- - test/integration/test_local.rb
435
- - test/integration/test_ssh.rb
436
- - test/integration/tests/path_block_device_test.rb
437
- - test/integration/tests/path_character_device_test.rb
438
- - test/integration/tests/path_file_test.rb
439
- - test/integration/tests/path_folder_test.rb
440
- - test/integration/tests/path_missing_test.rb
441
- - test/integration/tests/path_pipe_test.rb
442
- - test/integration/tests/path_symlink_test.rb
443
- - test/integration/tests/run_command_test.rb
444
- - test/unit/extras/command_wrapper_test.rb
445
- - test/unit/extras/stat_test.rb
446
- - test/unit/file/local/unix_test.rb
447
- - test/unit/file/local/windows_test.rb
448
- - test/unit/file/local_test.rb
449
- - test/unit/file/remote/aix_test.rb
450
- - test/unit/file/remote/linux_test.rb
451
- - test/unit/file/remote/qnx_test.rb
452
- - test/unit/file/remote/unix_test.rb
453
- - test/unit/file/remote/windows_test.rb
454
- - test/unit/file/remote_test.rb
455
- - test/unit/file_test.rb
456
- - test/unit/helper.rb
457
- - test/unit/platforms/detect/os_common_test.rb
458
- - test/unit/platforms/detect/os_linux_test.rb
459
- - test/unit/platforms/detect/os_windows_test.rb
460
- - test/unit/platforms/detect/scanner_test.rb
461
- - test/unit/platforms/detect/uuid_test.rb
462
- - test/unit/platforms/family_test.rb
463
- - test/unit/platforms/os_detect_test.rb
464
- - test/unit/platforms/platform_test.rb
465
- - test/unit/platforms/platforms_test.rb
466
- - test/unit/plugins/connection_test.rb
467
- - test/unit/plugins/transport_test.rb
468
- - test/unit/plugins_test.rb
469
- - test/unit/train_test.rb
470
- - test/unit/transports/aws_test.rb
471
- - test/unit/transports/azure_test.rb
472
- - test/unit/transports/cisco_ios_connection.rb
473
- - test/unit/transports/gcp_test.rb
474
- - test/unit/transports/helpers/azure/file_credentials_test.rb
475
- - test/unit/transports/local_test.rb
476
- - test/unit/transports/mock_test.rb
477
- - test/unit/transports/ssh_test.rb
478
- - test/unit/transports/vmware_test.rb
479
- - test/unit/version_test.rb
480
- - test/windows/local_test.rb
481
- - test/windows/winrm_test.rb
319
+ test_files: []
data/.rubocop.yml DELETED
@@ -1,77 +0,0 @@
1
- ---
2
- AllCops:
3
- Exclude:
4
- - Gemfile
5
- - Rakefile
6
- - 'test/**/*'
7
- - 'examples/plugins/train-*/test/**/*'
8
- - 'vendor/**/*'
9
- Documentation:
10
- Enabled: false
11
- AlignParameters:
12
- Enabled: true
13
- Encoding:
14
- Enabled: false
15
- HashSyntax:
16
- Enabled: true
17
- LineLength:
18
- Enabled: false
19
- EmptyLinesAroundBlockBody:
20
- Enabled: false
21
- MethodLength:
22
- Max: 40
23
- NumericLiterals:
24
- MinDigits: 10
25
- Metrics/CyclomaticComplexity:
26
- Max: 10
27
- Metrics/PerceivedComplexity:
28
- Max: 10
29
- Metrics/AbcSize:
30
- Max: 33
31
- Metrics/ModuleLength:
32
- Enabled: false
33
- Style/PercentLiteralDelimiters:
34
- PreferredDelimiters:
35
- '%': '{}'
36
- '%i': ()
37
- '%q': '{}'
38
- '%Q': ()
39
- '%r': '{}'
40
- '%s': ()
41
- '%w': '{}'
42
- '%W': ()
43
- '%x': ()
44
- Style/AlignHash:
45
- Enabled: false
46
- Style/PredicateName:
47
- Enabled: false
48
- Style/ClassAndModuleChildren:
49
- Enabled: false
50
- Style/ConditionalAssignment:
51
- Enabled: false
52
- Style/BracesAroundHashParameters:
53
- Enabled: false
54
- Style/AndOr:
55
- Enabled: false
56
- Style/Not:
57
- Enabled: false
58
- Style/FileName:
59
- Enabled: false
60
- Style/TrailingCommaInLiteral:
61
- EnforcedStyleForMultiline: comma
62
- Style/TrailingCommaInArguments:
63
- EnforcedStyleForMultiline: comma
64
- Style/NegatedIf:
65
- Enabled: false
66
- Style/UnlessElse:
67
- Enabled: false
68
- BlockDelimiters:
69
- Enabled: false
70
- Style/SpaceAroundOperators:
71
- Enabled: false
72
- Style/IfUnlessModifier:
73
- Enabled: false
74
- Style/FrozenStringLiteralComment:
75
- Enabled: false
76
- SignalException:
77
- Enabled: false