knife-windows 1.0.0.rc.1 → 1.0.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -5
- data/.travis.yml +20 -20
- data/CHANGELOG.md +75 -74
- data/DOC_CHANGES.md +323 -323
- data/Gemfile +12 -12
- data/LICENSE +201 -201
- data/README.md +393 -292
- data/RELEASE_NOTES.md +79 -74
- data/Rakefile +21 -16
- data/appveyor.yml +42 -42
- data/ci.gemfile +15 -15
- data/features/knife_help.feature +20 -20
- data/features/support/env.rb +5 -5
- data/knife-windows.gemspec +28 -28
- data/lib/chef/knife/bootstrap/windows-chef-client-msi.erb +247 -241
- data/lib/chef/knife/bootstrap_windows_base.rb +388 -368
- data/lib/chef/knife/bootstrap_windows_ssh.rb +110 -110
- data/lib/chef/knife/bootstrap_windows_winrm.rb +102 -113
- data/lib/chef/knife/core/windows_bootstrap_context.rb +361 -362
- data/lib/chef/knife/knife_windows_base.rb +33 -0
- data/lib/chef/knife/windows_cert_generate.rb +155 -155
- data/lib/chef/knife/windows_cert_install.rb +68 -68
- data/lib/chef/knife/windows_helper.rb +36 -36
- data/lib/chef/knife/windows_listener_create.rb +107 -107
- data/lib/chef/knife/winrm.rb +212 -191
- data/lib/chef/knife/winrm_base.rb +118 -125
- data/lib/chef/knife/winrm_knife_base.rb +218 -201
- data/lib/chef/knife/winrm_session.rb +80 -71
- data/lib/chef/knife/winrm_shared_options.rb +47 -47
- data/lib/chef/knife/wsman_endpoint.rb +44 -44
- data/lib/chef/knife/wsman_test.rb +96 -96
- data/lib/knife-windows/path_helper.rb +234 -234
- data/lib/knife-windows/version.rb +6 -6
- data/spec/assets/win_template_rendered_with_bootstrap_install_command.txt +217 -0
- data/spec/assets/win_template_rendered_without_bootstrap_install_command.txt +329 -0
- data/spec/assets/win_template_unrendered.txt +246 -0
- data/spec/functional/bootstrap_download_spec.rb +216 -140
- data/spec/spec_helper.rb +87 -72
- data/spec/unit/knife/bootstrap_options_spec.rb +146 -146
- data/spec/unit/knife/bootstrap_template_spec.rb +92 -92
- data/spec/unit/knife/bootstrap_windows_winrm_spec.rb +240 -161
- data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +151 -101
- data/spec/unit/knife/windows_cert_generate_spec.rb +90 -90
- data/spec/unit/knife/windows_cert_install_spec.rb +51 -51
- data/spec/unit/knife/windows_listener_create_spec.rb +76 -76
- data/spec/unit/knife/winrm_session_spec.rb +55 -46
- data/spec/unit/knife/winrm_spec.rb +504 -376
- data/spec/unit/knife/wsman_test_spec.rb +175 -175
- metadata +28 -8
@@ -1,176 +1,176 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Steven Murawski (<smurawski@chef.io>)
|
3
|
-
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
4
|
-
# License:: Apache License, Version 2.0
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
require 'spec_helper'
|
20
|
-
|
21
|
-
describe Chef::Knife::WsmanTest do
|
22
|
-
before(:all) do
|
23
|
-
Chef::Config.reset
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
context 'when testing the WSMAN endpoint' do
|
28
|
-
let(:wsman_tester) { Chef::Knife::WsmanTest.new(['-m', 'localhost']) }
|
29
|
-
let(:http_client_mock) {HTTPClient.new}
|
30
|
-
|
31
|
-
before(:each) do
|
32
|
-
wsman_tester.config[:verbosity] = 0
|
33
|
-
allow(HTTPClient).to receive(:new).and_return(http_client_mock)
|
34
|
-
end
|
35
|
-
|
36
|
-
context 'and the service does not respond' do
|
37
|
-
error_message = 'A connection attempt failed because the connected party did not properly respond after a period of time.'
|
38
|
-
|
39
|
-
before(:each) do
|
40
|
-
allow(HTTPClient).to receive(:new).and_return(http_client_mock)
|
41
|
-
allow(http_client_mock).to receive(:post).and_raise(Exception.new(error_message))
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'exits with a status code of 1' do
|
45
|
-
expect(wsman_tester).to receive(:exit).with(1)
|
46
|
-
wsman_tester.run
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'writes a warning message for each node it fails to connect to' do
|
50
|
-
expect(wsman_tester.ui).to receive(:warn)
|
51
|
-
expect(wsman_tester).to receive(:exit).with(1)
|
52
|
-
wsman_tester.run
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'writes an error message if it fails to connect to any nodes' do
|
56
|
-
expect(wsman_tester.ui).to receive(:error)
|
57
|
-
expect(wsman_tester).to receive(:exit).with(1)
|
58
|
-
wsman_tester.run
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
context 'and the service responds' do
|
63
|
-
context 'successfully' do
|
64
|
-
it 'writes a message about a successful connection' do
|
65
|
-
response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 2.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
66
|
-
http_response_mock = HTTP::Message.new_response(response_body)
|
67
|
-
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
68
|
-
expect(wsman_tester.ui).to receive(:msg)
|
69
|
-
wsman_tester.run
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
context 'with an invalid body' do
|
74
|
-
it 'warns for a failed connection and exit with a status of 1' do
|
75
|
-
response_body = 'I am invalid'
|
76
|
-
http_response_mock = HTTP::Message.new_response(response_body)
|
77
|
-
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
78
|
-
expect(wsman_tester.ui).to receive(:warn)
|
79
|
-
expect(wsman_tester.ui).to receive(:error)
|
80
|
-
expect(wsman_tester).to receive(:exit).with(1)
|
81
|
-
wsman_tester.run
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
context 'with a non-200 code' do
|
86
|
-
it 'warns for a failed connection and exits with a status of 1' do
|
87
|
-
http_response_mock = HTTP::Message.new_response('')
|
88
|
-
http_response_mock.status = 404
|
89
|
-
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
90
|
-
expect(wsman_tester.ui).to receive(:warn)
|
91
|
-
expect(wsman_tester.ui).to receive(:error)
|
92
|
-
expect(wsman_tester).to receive(:exit).with(1)
|
93
|
-
wsman_tester.run
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
context 'when testing the WSMAN endpoint with verbose output' do
|
100
|
-
let(:wsman_tester_verbose) { Chef::Knife::WsmanTest.new(['-m', 'localhost']) }
|
101
|
-
let(:http_client_mock_verbose) {HTTPClient.new}
|
102
|
-
|
103
|
-
before(:each) do
|
104
|
-
allow(HTTPClient).to receive(:new).and_return(http_client_mock_verbose)
|
105
|
-
wsman_tester_verbose.config[:verbosity] = 1
|
106
|
-
end
|
107
|
-
|
108
|
-
context 'and the service does not respond' do
|
109
|
-
it 'returns an object with an error message' do
|
110
|
-
error_message = 'A connection attempt failed because the connected party did not properly respond after a period of time.'
|
111
|
-
allow(http_client_mock_verbose).to receive(:post).and_raise(Exception.new(error_message))
|
112
|
-
expect(wsman_tester_verbose).to receive(:output).with(duck_type(:error_message))
|
113
|
-
expect(wsman_tester_verbose).to receive(:exit).with(1)
|
114
|
-
wsman_tester_verbose.run
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
context 'and the target node is Windows Server 2008 R2' do
|
119
|
-
before(:each) do
|
120
|
-
ws2008r2_response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 2.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
121
|
-
http_response_mock = HTTP::Message.new_response(ws2008r2_response_body)
|
122
|
-
allow(http_client_mock_verbose).to receive(:post).and_return(http_response_mock)
|
123
|
-
end
|
124
|
-
|
125
|
-
it 'identifies the stack of the product version as 2.0 ' do
|
126
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
127
|
-
expect(output.product_version).to eq 'OS: 0.0.0 SP: 0.0 Stack: 2.0'
|
128
|
-
end
|
129
|
-
wsman_tester_verbose.run
|
130
|
-
end
|
131
|
-
|
132
|
-
it 'identifies the protocol version as the current DMTF standard' do
|
133
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
134
|
-
expect(output.protocol_version).to eq 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'
|
135
|
-
end
|
136
|
-
wsman_tester_verbose.run
|
137
|
-
end
|
138
|
-
|
139
|
-
it 'identifies the vendor as the Microsoft Corporation' do
|
140
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
141
|
-
expect(output.product_vendor).to eq 'Microsoft Corporation'
|
142
|
-
end
|
143
|
-
wsman_tester_verbose.run
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
context 'and the target node is Windows Server 2012 R2' do
|
148
|
-
before(:each) do
|
149
|
-
ws2012_response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 3.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
150
|
-
http_response_mock = HTTP::Message.new_response(ws2012_response_body)
|
151
|
-
allow(http_client_mock_verbose).to receive(:post).and_return(http_response_mock)
|
152
|
-
end
|
153
|
-
|
154
|
-
it 'identifies the stack of the product version as 3.0 ' do
|
155
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
156
|
-
expect(output.product_version).to eq 'OS: 0.0.0 SP: 0.0 Stack: 3.0'
|
157
|
-
end
|
158
|
-
wsman_tester_verbose.run
|
159
|
-
end
|
160
|
-
|
161
|
-
it 'identifies the protocol version as the current DMTF standard' do
|
162
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
163
|
-
expect(output.protocol_version).to eq 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'
|
164
|
-
end
|
165
|
-
wsman_tester_verbose.run
|
166
|
-
end
|
167
|
-
|
168
|
-
it 'identifies the vendor as the Microsoft Corporation' do
|
169
|
-
expect(wsman_tester_verbose).to receive(:output) do |output|
|
170
|
-
expect(output.product_vendor).to eq 'Microsoft Corporation'
|
171
|
-
end
|
172
|
-
wsman_tester_verbose.run
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
1
|
+
#
|
2
|
+
# Author:: Steven Murawski (<smurawski@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'spec_helper'
|
20
|
+
|
21
|
+
describe Chef::Knife::WsmanTest do
|
22
|
+
before(:all) do
|
23
|
+
Chef::Config.reset
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
context 'when testing the WSMAN endpoint' do
|
28
|
+
let(:wsman_tester) { Chef::Knife::WsmanTest.new(['-m', 'localhost']) }
|
29
|
+
let(:http_client_mock) {HTTPClient.new}
|
30
|
+
|
31
|
+
before(:each) do
|
32
|
+
wsman_tester.config[:verbosity] = 0
|
33
|
+
allow(HTTPClient).to receive(:new).and_return(http_client_mock)
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'and the service does not respond' do
|
37
|
+
error_message = 'A connection attempt failed because the connected party did not properly respond after a period of time.'
|
38
|
+
|
39
|
+
before(:each) do
|
40
|
+
allow(HTTPClient).to receive(:new).and_return(http_client_mock)
|
41
|
+
allow(http_client_mock).to receive(:post).and_raise(Exception.new(error_message))
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'exits with a status code of 1' do
|
45
|
+
expect(wsman_tester).to receive(:exit).with(1)
|
46
|
+
wsman_tester.run
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'writes a warning message for each node it fails to connect to' do
|
50
|
+
expect(wsman_tester.ui).to receive(:warn)
|
51
|
+
expect(wsman_tester).to receive(:exit).with(1)
|
52
|
+
wsman_tester.run
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'writes an error message if it fails to connect to any nodes' do
|
56
|
+
expect(wsman_tester.ui).to receive(:error)
|
57
|
+
expect(wsman_tester).to receive(:exit).with(1)
|
58
|
+
wsman_tester.run
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'and the service responds' do
|
63
|
+
context 'successfully' do
|
64
|
+
it 'writes a message about a successful connection' do
|
65
|
+
response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 2.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
66
|
+
http_response_mock = HTTP::Message.new_response(response_body)
|
67
|
+
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
68
|
+
expect(wsman_tester.ui).to receive(:msg)
|
69
|
+
wsman_tester.run
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'with an invalid body' do
|
74
|
+
it 'warns for a failed connection and exit with a status of 1' do
|
75
|
+
response_body = 'I am invalid'
|
76
|
+
http_response_mock = HTTP::Message.new_response(response_body)
|
77
|
+
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
78
|
+
expect(wsman_tester.ui).to receive(:warn)
|
79
|
+
expect(wsman_tester.ui).to receive(:error)
|
80
|
+
expect(wsman_tester).to receive(:exit).with(1)
|
81
|
+
wsman_tester.run
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'with a non-200 code' do
|
86
|
+
it 'warns for a failed connection and exits with a status of 1' do
|
87
|
+
http_response_mock = HTTP::Message.new_response('')
|
88
|
+
http_response_mock.status = 404
|
89
|
+
allow(http_client_mock).to receive(:post).and_return(http_response_mock)
|
90
|
+
expect(wsman_tester.ui).to receive(:warn)
|
91
|
+
expect(wsman_tester.ui).to receive(:error)
|
92
|
+
expect(wsman_tester).to receive(:exit).with(1)
|
93
|
+
wsman_tester.run
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when testing the WSMAN endpoint with verbose output' do
|
100
|
+
let(:wsman_tester_verbose) { Chef::Knife::WsmanTest.new(['-m', 'localhost']) }
|
101
|
+
let(:http_client_mock_verbose) {HTTPClient.new}
|
102
|
+
|
103
|
+
before(:each) do
|
104
|
+
allow(HTTPClient).to receive(:new).and_return(http_client_mock_verbose)
|
105
|
+
wsman_tester_verbose.config[:verbosity] = 1
|
106
|
+
end
|
107
|
+
|
108
|
+
context 'and the service does not respond' do
|
109
|
+
it 'returns an object with an error message' do
|
110
|
+
error_message = 'A connection attempt failed because the connected party did not properly respond after a period of time.'
|
111
|
+
allow(http_client_mock_verbose).to receive(:post).and_raise(Exception.new(error_message))
|
112
|
+
expect(wsman_tester_verbose).to receive(:output).with(duck_type(:error_message))
|
113
|
+
expect(wsman_tester_verbose).to receive(:exit).with(1)
|
114
|
+
wsman_tester_verbose.run
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
context 'and the target node is Windows Server 2008 R2' do
|
119
|
+
before(:each) do
|
120
|
+
ws2008r2_response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 2.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
121
|
+
http_response_mock = HTTP::Message.new_response(ws2008r2_response_body)
|
122
|
+
allow(http_client_mock_verbose).to receive(:post).and_return(http_response_mock)
|
123
|
+
end
|
124
|
+
|
125
|
+
it 'identifies the stack of the product version as 2.0 ' do
|
126
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
127
|
+
expect(output.product_version).to eq 'OS: 0.0.0 SP: 0.0 Stack: 2.0'
|
128
|
+
end
|
129
|
+
wsman_tester_verbose.run
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'identifies the protocol version as the current DMTF standard' do
|
133
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
134
|
+
expect(output.protocol_version).to eq 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'
|
135
|
+
end
|
136
|
+
wsman_tester_verbose.run
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'identifies the vendor as the Microsoft Corporation' do
|
140
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
141
|
+
expect(output.product_vendor).to eq 'Microsoft Corporation'
|
142
|
+
end
|
143
|
+
wsman_tester_verbose.run
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
context 'and the target node is Windows Server 2012 R2' do
|
148
|
+
before(:each) do
|
149
|
+
ws2012_response_body = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header/><s:Body><wsmid:IdentifyResponse xmlns:wsmid="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"><wsmid:ProtocolVersion>http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd</wsmid:ProtocolVersion><wsmid:ProductVendor>Microsoft Corporation</wsmid:ProductVendor><wsmid:ProductVersion>OS: 0.0.0 SP: 0.0 Stack: 3.0</wsmid:ProductVersion></wsmid:IdentifyResponse></s:Body></s:Envelope>'
|
150
|
+
http_response_mock = HTTP::Message.new_response(ws2012_response_body)
|
151
|
+
allow(http_client_mock_verbose).to receive(:post).and_return(http_response_mock)
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'identifies the stack of the product version as 3.0 ' do
|
155
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
156
|
+
expect(output.product_version).to eq 'OS: 0.0.0 SP: 0.0 Stack: 3.0'
|
157
|
+
end
|
158
|
+
wsman_tester_verbose.run
|
159
|
+
end
|
160
|
+
|
161
|
+
it 'identifies the protocol version as the current DMTF standard' do
|
162
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
163
|
+
expect(output.protocol_version).to eq 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'
|
164
|
+
end
|
165
|
+
wsman_tester_verbose.run
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'identifies the vendor as the Microsoft Corporation' do
|
169
|
+
expect(wsman_tester_verbose).to receive(:output) do |output|
|
170
|
+
expect(output.product_vendor).to eq 'Microsoft Corporation'
|
171
|
+
end
|
172
|
+
wsman_tester_verbose.run
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
176
|
end
|
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.0.0.rc.
|
4
|
+
version: 1.0.0.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Chisamore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: winrm
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.0
|
33
|
+
version: 0.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3.0
|
40
|
+
version: 0.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
description: Plugin that adds functionality to Chef's Knife CLI for configuring/interacting
|
70
70
|
with nodes running Microsoft Windows
|
71
71
|
email:
|
72
|
-
- schisamo@
|
72
|
+
- schisamo@chef.io
|
73
73
|
executables: []
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/chef/knife/bootstrap_windows_ssh.rb
|
95
95
|
- lib/chef/knife/bootstrap_windows_winrm.rb
|
96
96
|
- lib/chef/knife/core/windows_bootstrap_context.rb
|
97
|
+
- lib/chef/knife/knife_windows_base.rb
|
97
98
|
- lib/chef/knife/windows_cert_generate.rb
|
98
99
|
- lib/chef/knife/windows_cert_install.rb
|
99
100
|
- lib/chef/knife/windows_helper.rb
|
@@ -107,6 +108,9 @@ files:
|
|
107
108
|
- lib/chef/knife/wsman_test.rb
|
108
109
|
- lib/knife-windows/path_helper.rb
|
109
110
|
- lib/knife-windows/version.rb
|
111
|
+
- spec/assets/win_template_rendered_with_bootstrap_install_command.txt
|
112
|
+
- spec/assets/win_template_rendered_without_bootstrap_install_command.txt
|
113
|
+
- spec/assets/win_template_unrendered.txt
|
110
114
|
- spec/functional/bootstrap_download_spec.rb
|
111
115
|
- spec/spec_helper.rb
|
112
116
|
- spec/unit/knife/bootstrap_options_spec.rb
|
@@ -119,7 +123,7 @@ files:
|
|
119
123
|
- spec/unit/knife/winrm_session_spec.rb
|
120
124
|
- spec/unit/knife/winrm_spec.rb
|
121
125
|
- spec/unit/knife/wsman_test_spec.rb
|
122
|
-
homepage: https://github.com/
|
126
|
+
homepage: https://github.com/chef/knife-windows
|
123
127
|
licenses:
|
124
128
|
- Apache-2.0
|
125
129
|
metadata: {}
|
@@ -144,5 +148,21 @@ signing_key:
|
|
144
148
|
specification_version: 4
|
145
149
|
summary: Plugin that adds functionality to Chef's Knife CLI for configuring/interacting
|
146
150
|
with nodes running Microsoft Windows
|
147
|
-
test_files:
|
148
|
-
|
151
|
+
test_files:
|
152
|
+
- features/knife_help.feature
|
153
|
+
- features/support/env.rb
|
154
|
+
- spec/assets/win_template_rendered_with_bootstrap_install_command.txt
|
155
|
+
- spec/assets/win_template_rendered_without_bootstrap_install_command.txt
|
156
|
+
- spec/assets/win_template_unrendered.txt
|
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
|