knife-windows 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,6 +68,12 @@ describe Chef::Knife::WinrmSession do
68
68
  subject.relay_command("cmd.exe echo 'hi'")
69
69
  end
70
70
 
71
+ it "exits with 401 if command execution raises a 401" do
72
+ expect(winrm_connection).to receive(:shell).and_raise(WinRM::WinRMHTTPTransportError.new('', '401'))
73
+ expect { subject.relay_command("cmd.exe echo 'hi'") }.to raise_error(WinRM::WinRMHTTPTransportError)
74
+ expect(subject.exit_code).to eql(401)
75
+ end
76
+
71
77
  context "cmd shell" do
72
78
  before do
73
79
  options[:shell] = :cmd
@@ -422,12 +422,6 @@ describe Chef::Knife::Winrm do
422
422
  expect { @winrm.run_with_pretty_exceptions }.to raise_error(SystemExit) { |e| expect(e.status).to eq(100) }
423
423
  end
424
424
 
425
- it "exits with 401 if command execution raises a 401 and suppress_auth_failure is set to true" do
426
- @winrm.config[:suppress_auth_failure] = true
427
- allow(session).to receive(:relay_command).and_raise(WinRM::WinRMHTTPTransportError.new('', '401'))
428
- expect { @winrm.run_with_pretty_exceptions }.to raise_error(SystemExit) { |e| expect(e.status).to eq(401) }
429
- end
430
-
431
425
  it "prints a hint on failure for negotiate authentication" do
432
426
  @winrm.config[:winrm_authentication_protocol] = "negotiate"
433
427
  @winrm.config[:winrm_transport] = "plaintext"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Chisamore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-23 00:00:00.000000000 Z
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: winrm
@@ -136,9 +136,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.7
139
+ rubygems_version: 2.6.8
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Plugin that adds functionality to Chef's Knife CLI for configuring/interacting
143
143
  with nodes running Microsoft Windows
144
- test_files: []
144
+ test_files:
145
+ - features/knife_help.feature
146
+ - features/support/env.rb
147
+ - spec/assets/fake_trusted_certs/excluded.txt
148
+ - spec/assets/fake_trusted_certs/github.pem
149
+ - spec/assets/fake_trusted_certs/google.crt
150
+ - spec/assets/win_fake_trusted_cert_script.txt
151
+ - spec/assets/win_template_rendered_with_bootstrap_install_command.txt
152
+ - spec/assets/win_template_rendered_with_bootstrap_install_command_on_12_5_client.txt
153
+ - spec/assets/win_template_rendered_without_bootstrap_install_command.txt
154
+ - spec/assets/win_template_rendered_without_bootstrap_install_command_on_12_5_client.txt
155
+ - spec/assets/win_template_unrendered.txt
156
+ - spec/dummy_winrm_connection.rb
157
+ - spec/functional/bootstrap_download_spec.rb
158
+ - spec/spec_helper.rb
159
+ - spec/unit/knife/bootstrap_options_spec.rb
160
+ - spec/unit/knife/bootstrap_template_spec.rb
161
+ - spec/unit/knife/bootstrap_windows_winrm_spec.rb
162
+ - spec/unit/knife/core/windows_bootstrap_context_spec.rb
163
+ - spec/unit/knife/windows_cert_generate_spec.rb
164
+ - spec/unit/knife/windows_cert_install_spec.rb
165
+ - spec/unit/knife/windows_listener_create_spec.rb
166
+ - spec/unit/knife/winrm_session_spec.rb
167
+ - spec/unit/knife/winrm_spec.rb
168
+ - spec/unit/knife/wsman_test_spec.rb