winrm 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -10
- data/.rspec +3 -3
- data/.rubocop.yml +9 -9
- data/.travis.yml +4 -4
- data/Gemfile +9 -9
- data/LICENSE +202 -202
- data/README.md +148 -148
- data/Rakefile +28 -28
- data/VERSION +1 -1
- data/Vagrantfile +9 -9
- data/bin/rwinrm +97 -97
- data/changelog.md +49 -46
- data/lib/winrm.rb +41 -41
- data/lib/winrm/exceptions/exceptions.rb +57 -57
- data/lib/winrm/helpers/iso8601_duration.rb +58 -58
- data/lib/winrm/helpers/powershell_script.rb +37 -37
- data/lib/winrm/http/response_handler.rb +82 -82
- data/lib/winrm/http/transport.rb +294 -294
- data/lib/winrm/output.rb +43 -43
- data/lib/winrm/soap_provider.rb +40 -40
- data/lib/winrm/winrm_service.rb +490 -488
- data/preamble +17 -17
- data/spec/auth_timeout_spec.rb +16 -16
- data/spec/cmd_spec.rb +102 -102
- data/spec/config-example.yml +19 -19
- data/spec/exception_spec.rb +50 -50
- data/spec/issue_59_spec.rb +15 -15
- data/spec/matchers.rb +74 -74
- data/spec/output_spec.rb +110 -110
- data/spec/powershell_spec.rb +103 -103
- data/spec/response_handler_spec.rb +59 -59
- data/spec/spec_helper.rb +48 -48
- data/spec/stubs/responses/open_shell_v1.xml +19 -19
- data/spec/stubs/responses/open_shell_v2.xml +20 -20
- data/spec/stubs/responses/soap_fault_v1.xml +36 -36
- data/spec/stubs/responses/soap_fault_v2.xml +42 -42
- data/spec/stubs/responses/wmi_error_v2.xml +41 -41
- data/spec/winrm_options_spec.rb +76 -76
- data/spec/winrm_primitives_spec.rb +51 -51
- data/spec/wql_spec.rb +14 -14
- data/winrm.gemspec +41 -41
- metadata +2 -2
data/spec/spec_helper.rb
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'rubygems'
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'winrm'
|
5
|
-
require 'json'
|
6
|
-
require_relative 'matchers'
|
7
|
-
|
8
|
-
# Creates a WinRM connection for integration tests
|
9
|
-
module ConnectionHelper
|
10
|
-
def winrm_connection
|
11
|
-
config = symbolize_keys(YAML.load(File.read(winrm_config_path)))
|
12
|
-
config[:options].merge!(basic_auth_only: true) unless config[:auth_type].eql? :kerberos
|
13
|
-
winrm = WinRM::WinRMWebService.new(
|
14
|
-
config[:endpoint], config[:auth_type].to_sym, config[:options])
|
15
|
-
winrm
|
16
|
-
end
|
17
|
-
|
18
|
-
def winrm_config_path
|
19
|
-
# Copy config-example.yml to config.yml and edit for your local configuration
|
20
|
-
path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
|
21
|
-
unless File.exist?(path)
|
22
|
-
# user hasn't done this, so use sane defaults for unit tests
|
23
|
-
path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
|
24
|
-
end
|
25
|
-
path
|
26
|
-
end
|
27
|
-
|
28
|
-
# rubocop:disable Metrics/MethodLength
|
29
|
-
def symbolize_keys(hash)
|
30
|
-
hash.each_with_object({}) do |(key, value), result|
|
31
|
-
new_key = case key
|
32
|
-
when String then key.to_sym
|
33
|
-
else key
|
34
|
-
end
|
35
|
-
new_value = case value
|
36
|
-
when Hash then symbolize_keys(value)
|
37
|
-
else value
|
38
|
-
end
|
39
|
-
result[new_key] = new_value
|
40
|
-
result
|
41
|
-
end
|
42
|
-
end
|
43
|
-
# rubocop:enable Metrics/MethodLength
|
44
|
-
end
|
45
|
-
|
46
|
-
RSpec.configure do |config|
|
47
|
-
config.include(ConnectionHelper)
|
48
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'winrm'
|
5
|
+
require 'json'
|
6
|
+
require_relative 'matchers'
|
7
|
+
|
8
|
+
# Creates a WinRM connection for integration tests
|
9
|
+
module ConnectionHelper
|
10
|
+
def winrm_connection
|
11
|
+
config = symbolize_keys(YAML.load(File.read(winrm_config_path)))
|
12
|
+
config[:options].merge!(basic_auth_only: true) unless config[:auth_type].eql? :kerberos
|
13
|
+
winrm = WinRM::WinRMWebService.new(
|
14
|
+
config[:endpoint], config[:auth_type].to_sym, config[:options])
|
15
|
+
winrm
|
16
|
+
end
|
17
|
+
|
18
|
+
def winrm_config_path
|
19
|
+
# Copy config-example.yml to config.yml and edit for your local configuration
|
20
|
+
path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
|
21
|
+
unless File.exist?(path)
|
22
|
+
# user hasn't done this, so use sane defaults for unit tests
|
23
|
+
path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
|
24
|
+
end
|
25
|
+
path
|
26
|
+
end
|
27
|
+
|
28
|
+
# rubocop:disable Metrics/MethodLength
|
29
|
+
def symbolize_keys(hash)
|
30
|
+
hash.each_with_object({}) do |(key, value), result|
|
31
|
+
new_key = case key
|
32
|
+
when String then key.to_sym
|
33
|
+
else key
|
34
|
+
end
|
35
|
+
new_value = case value
|
36
|
+
when Hash then symbolize_keys(value)
|
37
|
+
else value
|
38
|
+
end
|
39
|
+
result[new_key] = new_value
|
40
|
+
result
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Metrics/MethodLength
|
44
|
+
end
|
45
|
+
|
46
|
+
RSpec.configure do |config|
|
47
|
+
config.include(ConnectionHelper)
|
48
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
<s:Envelope xml:lang='en-US' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'>
|
2
|
-
<s:Header>
|
3
|
-
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>
|
4
|
-
<a:MessageID>uuid:94D35B73-3DD8-428D-9495-7AF3F0559428</a:MessageID>
|
5
|
-
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
-
<a:RelatesTo>uuid:EEF803CE-B9A6-48C1-BF00-90C6F077EC2A</a:RelatesTo>
|
7
|
-
</s:Header>
|
8
|
-
<s:Body>
|
9
|
-
<x:ResourceCreated xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer' xmlns:rsp='http://schemas.microsoft.com/wbem/wsman/1/windows/shell'>
|
10
|
-
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
|
11
|
-
<a:ReferenceParameters>
|
12
|
-
<w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>
|
13
|
-
<w:SelectorSet>
|
14
|
-
<w:Selector Name='ShellId'>uuid:739990FF-1492-4CDD-80BB-6E07ADB06D85</w:Selector>
|
15
|
-
</w:SelectorSet>
|
16
|
-
</a:ReferenceParameters>
|
17
|
-
</x:ResourceCreated>
|
18
|
-
</s:Body>
|
19
|
-
</s:Envelope>
|
1
|
+
<s:Envelope xml:lang='en-US' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'>
|
2
|
+
<s:Header>
|
3
|
+
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>
|
4
|
+
<a:MessageID>uuid:94D35B73-3DD8-428D-9495-7AF3F0559428</a:MessageID>
|
5
|
+
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
+
<a:RelatesTo>uuid:EEF803CE-B9A6-48C1-BF00-90C6F077EC2A</a:RelatesTo>
|
7
|
+
</s:Header>
|
8
|
+
<s:Body>
|
9
|
+
<x:ResourceCreated xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer' xmlns:rsp='http://schemas.microsoft.com/wbem/wsman/1/windows/shell'>
|
10
|
+
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
|
11
|
+
<a:ReferenceParameters>
|
12
|
+
<w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>
|
13
|
+
<w:SelectorSet>
|
14
|
+
<w:Selector Name='ShellId'>uuid:739990FF-1492-4CDD-80BB-6E07ADB06D85</w:Selector>
|
15
|
+
</w:SelectorSet>
|
16
|
+
</a:ReferenceParameters>
|
17
|
+
</x:ResourceCreated>
|
18
|
+
</s:Body>
|
19
|
+
</s:Envelope>
|
@@ -1,20 +1,20 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xml:lang="en-US">
|
3
|
-
<s:Header>
|
4
|
-
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>
|
5
|
-
<a:MessageID>uuid:9FF5B7FE-CC97-4FA4-B51F-E4220C016AE7</a:MessageID>
|
6
|
-
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
7
|
-
<a:RelatesTo>uuid:EA2A7785-D8E6-4E28-8AD8-FC27156537B3</a:RelatesTo>
|
8
|
-
</s:Header>
|
9
|
-
<s:Body>
|
10
|
-
<x:ResourceCreated>
|
11
|
-
<a:Address>http://localhost:5985/wsman</a:Address>
|
12
|
-
<a:ReferenceParameters>
|
13
|
-
<w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>
|
14
|
-
<w:SelectorSet>
|
15
|
-
<w:Selector Name="ShellId">62DE33F0-8674-43D9-B6A5-3298012CC4CD</w:Selector>
|
16
|
-
</w:SelectorSet>
|
17
|
-
</a:ReferenceParameters>
|
18
|
-
</x:ResourceCreated>
|
19
|
-
</s:Body>
|
20
|
-
</s:Envelope>
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xml:lang="en-US">
|
3
|
+
<s:Header>
|
4
|
+
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action>
|
5
|
+
<a:MessageID>uuid:9FF5B7FE-CC97-4FA4-B51F-E4220C016AE7</a:MessageID>
|
6
|
+
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
7
|
+
<a:RelatesTo>uuid:EA2A7785-D8E6-4E28-8AD8-FC27156537B3</a:RelatesTo>
|
8
|
+
</s:Header>
|
9
|
+
<s:Body>
|
10
|
+
<x:ResourceCreated>
|
11
|
+
<a:Address>http://localhost:5985/wsman</a:Address>
|
12
|
+
<a:ReferenceParameters>
|
13
|
+
<w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>
|
14
|
+
<w:SelectorSet>
|
15
|
+
<w:Selector Name="ShellId">62DE33F0-8674-43D9-B6A5-3298012CC4CD</w:Selector>
|
16
|
+
</w:SelectorSet>
|
17
|
+
</a:ReferenceParameters>
|
18
|
+
</x:ResourceCreated>
|
19
|
+
</s:Body>
|
20
|
+
</s:Envelope>
|
@@ -1,36 +1,36 @@
|
|
1
|
-
<s:Envelope xml:lang='en-US' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer' xmlns:e='http://schemas.xmlsoap.org/ws/2004/08/eventing' xmlns:n='http://schemas.xmlsoap.org/ws/2004/09/enumeration' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'>
|
2
|
-
<s:Header>
|
3
|
-
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault</a:Action>
|
4
|
-
<a:MessageID>uuid:AF8907B2-F47E-4DE5-A4AA-E1EC36EA0E49</a:MessageID>
|
5
|
-
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
-
<a:RelatesTo>uuid:B90EC4BB-4484-4ADA-920B-019517747915</a:RelatesTo>
|
7
|
-
</s:Header>
|
8
|
-
<s:Body>
|
9
|
-
<s:Fault>
|
10
|
-
<s:Code>
|
11
|
-
<s:Value>s:Sender</s:Value>
|
12
|
-
<s:Subcode>
|
13
|
-
<s:Value>n:CannotProcessFilter</s:Value>
|
14
|
-
</s:Subcode>
|
15
|
-
</s:Code>
|
16
|
-
<s:Reason>
|
17
|
-
<s:Text xml:lang='en-US'>
|
18
|
-
The data source could not process the filter. The filter might be
|
19
|
-
missing or it might be invalid. Change the filter and try the request
|
20
|
-
again.
|
21
|
-
</s:Text>
|
22
|
-
</s:Reason>
|
23
|
-
<s:Detail>
|
24
|
-
<f:WSManFault xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault' Code='2150858778' Machine=''>
|
25
|
-
<f:Message>
|
26
|
-
<f:ProviderFault provider='WMIv1 plugin for Windows Remote Management ' path='%systemroot%\system32\WsmWmiPl.dll'>
|
27
|
-
<f:WSManFault xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault' Code='2150858778' Machine='' xml:lang='en-US'>
|
28
|
-
<f:Message>The specified class does not exist in the given namespace. </f:Message>
|
29
|
-
</f:WSManFault>
|
30
|
-
</f:ProviderFault>
|
31
|
-
</f:Message>
|
32
|
-
</f:WSManFault>
|
33
|
-
</s:Detail>
|
34
|
-
</s:Fault>
|
35
|
-
</s:Body>
|
36
|
-
</s:Envelope>
|
1
|
+
<s:Envelope xml:lang='en-US' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer' xmlns:e='http://schemas.xmlsoap.org/ws/2004/08/eventing' xmlns:n='http://schemas.xmlsoap.org/ws/2004/09/enumeration' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd'>
|
2
|
+
<s:Header>
|
3
|
+
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault</a:Action>
|
4
|
+
<a:MessageID>uuid:AF8907B2-F47E-4DE5-A4AA-E1EC36EA0E49</a:MessageID>
|
5
|
+
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
+
<a:RelatesTo>uuid:B90EC4BB-4484-4ADA-920B-019517747915</a:RelatesTo>
|
7
|
+
</s:Header>
|
8
|
+
<s:Body>
|
9
|
+
<s:Fault>
|
10
|
+
<s:Code>
|
11
|
+
<s:Value>s:Sender</s:Value>
|
12
|
+
<s:Subcode>
|
13
|
+
<s:Value>n:CannotProcessFilter</s:Value>
|
14
|
+
</s:Subcode>
|
15
|
+
</s:Code>
|
16
|
+
<s:Reason>
|
17
|
+
<s:Text xml:lang='en-US'>
|
18
|
+
The data source could not process the filter. The filter might be
|
19
|
+
missing or it might be invalid. Change the filter and try the request
|
20
|
+
again.
|
21
|
+
</s:Text>
|
22
|
+
</s:Reason>
|
23
|
+
<s:Detail>
|
24
|
+
<f:WSManFault xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault' Code='2150858778' Machine=''>
|
25
|
+
<f:Message>
|
26
|
+
<f:ProviderFault provider='WMIv1 plugin for Windows Remote Management ' path='%systemroot%\system32\WsmWmiPl.dll'>
|
27
|
+
<f:WSManFault xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault' Code='2150858778' Machine='' xml:lang='en-US'>
|
28
|
+
<f:Message>The specified class does not exist in the given namespace. </f:Message>
|
29
|
+
</f:WSManFault>
|
30
|
+
</f:ProviderFault>
|
31
|
+
</f:Message>
|
32
|
+
</f:WSManFault>
|
33
|
+
</s:Detail>
|
34
|
+
</s:Fault>
|
35
|
+
</s:Body>
|
36
|
+
</s:Envelope>
|
@@ -1,42 +1,42 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<s:Envelope xml:lang="en-US" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer">
|
3
|
-
<s:Header>
|
4
|
-
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault</a:Action>
|
5
|
-
<a:MessageID>uuid:CC816664-896D-46C7-9227-AE6E1231CE49</a:MessageID>
|
6
|
-
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
7
|
-
<a:RelatesTo>uuid:0CB1C49A-5054-4C12-AF30-FC60BE995DD9</a:RelatesTo>
|
8
|
-
</s:Header>
|
9
|
-
<s:Body>
|
10
|
-
<s:Fault>
|
11
|
-
<s:Code>
|
12
|
-
<s:Value>s:Sender</s:Value>
|
13
|
-
<s:Subcode>
|
14
|
-
<s:Value>n:CannotProcessFilter</s:Value>
|
15
|
-
</s:Subcode>
|
16
|
-
</s:Code>
|
17
|
-
<s:Reason>
|
18
|
-
<s:Text xml:lang="en-US">The data source could not process the filter. The filter might be missing or it might be invalid. Change the filter and try the request again. </s:Text>
|
19
|
-
</s:Reason>
|
20
|
-
<s:Detail>
|
21
|
-
<f:WSManFault Code="2150858778" Machine="localhost" xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault">
|
22
|
-
<f:Message>
|
23
|
-
<f:ProviderFault path="%systemroot%\system32\WsmWmiPl.dll" provider="WMI Provider">
|
24
|
-
<f:WSManFault Code="2150858778" Machine="vagrant-2008R2" xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault">
|
25
|
-
<f:Message>The specified class does not exist in the given namespace. </f:Message>
|
26
|
-
</f:WSManFault>
|
27
|
-
<f:ExtendedError>
|
28
|
-
<p:__ExtendedStatus xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/__ExtendedStatus" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="p:__ExtendedStatus_Type">
|
29
|
-
<p:Description xsi:nil="true"/>
|
30
|
-
<p:Operation>ExecQuery</p:Operation>
|
31
|
-
<p:ParameterInfo>Select * from Win32_Processa where name="sshd.exe"</p:ParameterInfo>
|
32
|
-
<p:ProviderName>WinMgmt</p:ProviderName>
|
33
|
-
<p:StatusCode xsi:nil="true"/>
|
34
|
-
</p:__ExtendedStatus>
|
35
|
-
</f:ExtendedError>
|
36
|
-
</f:ProviderFault>
|
37
|
-
</f:Message>
|
38
|
-
</f:WSManFault>
|
39
|
-
</s:Detail>
|
40
|
-
</s:Fault>
|
41
|
-
</s:Body>
|
42
|
-
</s:Envelope>
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<s:Envelope xml:lang="en-US" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer">
|
3
|
+
<s:Header>
|
4
|
+
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/fault</a:Action>
|
5
|
+
<a:MessageID>uuid:CC816664-896D-46C7-9227-AE6E1231CE49</a:MessageID>
|
6
|
+
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
7
|
+
<a:RelatesTo>uuid:0CB1C49A-5054-4C12-AF30-FC60BE995DD9</a:RelatesTo>
|
8
|
+
</s:Header>
|
9
|
+
<s:Body>
|
10
|
+
<s:Fault>
|
11
|
+
<s:Code>
|
12
|
+
<s:Value>s:Sender</s:Value>
|
13
|
+
<s:Subcode>
|
14
|
+
<s:Value>n:CannotProcessFilter</s:Value>
|
15
|
+
</s:Subcode>
|
16
|
+
</s:Code>
|
17
|
+
<s:Reason>
|
18
|
+
<s:Text xml:lang="en-US">The data source could not process the filter. The filter might be missing or it might be invalid. Change the filter and try the request again. </s:Text>
|
19
|
+
</s:Reason>
|
20
|
+
<s:Detail>
|
21
|
+
<f:WSManFault Code="2150858778" Machine="localhost" xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault">
|
22
|
+
<f:Message>
|
23
|
+
<f:ProviderFault path="%systemroot%\system32\WsmWmiPl.dll" provider="WMI Provider">
|
24
|
+
<f:WSManFault Code="2150858778" Machine="vagrant-2008R2" xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault">
|
25
|
+
<f:Message>The specified class does not exist in the given namespace. </f:Message>
|
26
|
+
</f:WSManFault>
|
27
|
+
<f:ExtendedError>
|
28
|
+
<p:__ExtendedStatus xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/__ExtendedStatus" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="p:__ExtendedStatus_Type">
|
29
|
+
<p:Description xsi:nil="true"/>
|
30
|
+
<p:Operation>ExecQuery</p:Operation>
|
31
|
+
<p:ParameterInfo>Select * from Win32_Processa where name="sshd.exe"</p:ParameterInfo>
|
32
|
+
<p:ProviderName>WinMgmt</p:ProviderName>
|
33
|
+
<p:StatusCode xsi:nil="true"/>
|
34
|
+
</p:__ExtendedStatus>
|
35
|
+
</f:ExtendedError>
|
36
|
+
</f:ProviderFault>
|
37
|
+
</f:Message>
|
38
|
+
</f:WSManFault>
|
39
|
+
</s:Detail>
|
40
|
+
</s:Fault>
|
41
|
+
</s:Body>
|
42
|
+
</s:Envelope>
|
@@ -1,41 +1,41 @@
|
|
1
|
-
<s:Envelope xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:e='http://schemas.xmlsoap.org/ws/2004/08/eventing' xml:lang='en-US' xmlns:n='http://schemas.xmlsoap.org/ws/2004/09/enumeration' xmlns:p='http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer'>
|
2
|
-
<s:Header>
|
3
|
-
<a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</a:Action>
|
4
|
-
<a:MessageID>uuid:B8829021-48C3-4F27-B94B-491DAC4F29B1</a:MessageID>
|
5
|
-
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
-
</s:Header>
|
7
|
-
<s:Body>
|
8
|
-
<s:Fault>
|
9
|
-
<s:Code>
|
10
|
-
<s:Value>s:Sender</s:Value>
|
11
|
-
<s:Subcode>
|
12
|
-
<s:Value>w:QuotaLimit</s:Value>
|
13
|
-
</s:Subcode>
|
14
|
-
</s:Code>
|
15
|
-
<s:Reason>
|
16
|
-
<s:Text xml:lang='en-US'>The WS-Management service cannot process the request. The maximum number of concurrent shells for this user has been exceeded. Close existing shells or raise the quota for this user. </s:Text>
|
17
|
-
</s:Reason>
|
18
|
-
<s:Detail>
|
19
|
-
<p:MSFT_WmiError b:IsCIM_Error='true' xmlns:b='http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd' xmlns:cim='http://schemas.dmtf.org/wbem/wscim/1/common' xmlns:p='http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/MSFT_WmiError' xsi:type='p:MSFT_WmiError_Type' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
20
|
-
<p:CIMStatusCode xsi:type='cim:cimUnsignedInt'>27</p:CIMStatusCode>
|
21
|
-
<p:CIMStatusCodeDescription xsi:nil='true' xsi:type='cim:cimString'/>
|
22
|
-
<p:ErrorSource xsi:nil='true' xsi:type='cim:cimString'/>
|
23
|
-
<p:ErrorSourceFormat xsi:type='cim:cimUnsignedShort'>0</p:ErrorSourceFormat>
|
24
|
-
<p:ErrorType xsi:type='cim:cimUnsignedShort'>0</p:ErrorType>
|
25
|
-
<p:Message xsi:type='cim:cimString'>The WS-Management service cannot process the request. This user is allowed a maximum number of 30 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </p:Message>
|
26
|
-
<p:MessageID xsi:type='cim:cimString'>HRESULT 0x803381a5</p:MessageID>
|
27
|
-
<p:OtherErrorSourceFormat xsi:nil='true' xsi:type='cim:cimString'/>
|
28
|
-
<p:OtherErrorType xsi:nil='true' xsi:type='cim:cimString'/>
|
29
|
-
<p:OwningEntity xsi:nil='true' xsi:type='cim:cimString'/>
|
30
|
-
<p:PerceivedSeverity xsi:type='cim:cimUnsignedShort'>0</p:PerceivedSeverity>
|
31
|
-
<p:ProbableCause xsi:type='cim:cimUnsignedShort'>0</p:ProbableCause>
|
32
|
-
<p:ProbableCauseDescription xsi:nil='true' xsi:type='cim:cimString'/>
|
33
|
-
<p:error_Category xsi:type='cim:cimUnsignedInt'>30</p:error_Category>
|
34
|
-
<p:error_Code xsi:type='cim:cimUnsignedInt'>2150859173</p:error_Code>
|
35
|
-
<p:error_Type xsi:type='cim:cimString'>HRESULT</p:error_Type>
|
36
|
-
<p:error_WindowsErrorMessage xsi:type='cim:cimString'>The WS-Management service cannot process the request. This user is allowed a maximum number of 30 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </p:error_WindowsErrorMessage>
|
37
|
-
</p:MSFT_WmiError>
|
38
|
-
</s:Detail>
|
39
|
-
</s:Fault>
|
40
|
-
</s:Body>
|
41
|
-
</s:Envelope>
|
1
|
+
<s:Envelope xmlns:a='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:e='http://schemas.xmlsoap.org/ws/2004/08/eventing' xml:lang='en-US' xmlns:n='http://schemas.xmlsoap.org/ws/2004/09/enumeration' xmlns:p='http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd' xmlns:s='http://www.w3.org/2003/05/soap-envelope' xmlns:w='http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd' xmlns:x='http://schemas.xmlsoap.org/ws/2004/09/transfer'>
|
2
|
+
<s:Header>
|
3
|
+
<a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</a:Action>
|
4
|
+
<a:MessageID>uuid:B8829021-48C3-4F27-B94B-491DAC4F29B1</a:MessageID>
|
5
|
+
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
|
6
|
+
</s:Header>
|
7
|
+
<s:Body>
|
8
|
+
<s:Fault>
|
9
|
+
<s:Code>
|
10
|
+
<s:Value>s:Sender</s:Value>
|
11
|
+
<s:Subcode>
|
12
|
+
<s:Value>w:QuotaLimit</s:Value>
|
13
|
+
</s:Subcode>
|
14
|
+
</s:Code>
|
15
|
+
<s:Reason>
|
16
|
+
<s:Text xml:lang='en-US'>The WS-Management service cannot process the request. The maximum number of concurrent shells for this user has been exceeded. Close existing shells or raise the quota for this user. </s:Text>
|
17
|
+
</s:Reason>
|
18
|
+
<s:Detail>
|
19
|
+
<p:MSFT_WmiError b:IsCIM_Error='true' xmlns:b='http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd' xmlns:cim='http://schemas.dmtf.org/wbem/wscim/1/common' xmlns:p='http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/MSFT_WmiError' xsi:type='p:MSFT_WmiError_Type' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
20
|
+
<p:CIMStatusCode xsi:type='cim:cimUnsignedInt'>27</p:CIMStatusCode>
|
21
|
+
<p:CIMStatusCodeDescription xsi:nil='true' xsi:type='cim:cimString'/>
|
22
|
+
<p:ErrorSource xsi:nil='true' xsi:type='cim:cimString'/>
|
23
|
+
<p:ErrorSourceFormat xsi:type='cim:cimUnsignedShort'>0</p:ErrorSourceFormat>
|
24
|
+
<p:ErrorType xsi:type='cim:cimUnsignedShort'>0</p:ErrorType>
|
25
|
+
<p:Message xsi:type='cim:cimString'>The WS-Management service cannot process the request. This user is allowed a maximum number of 30 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </p:Message>
|
26
|
+
<p:MessageID xsi:type='cim:cimString'>HRESULT 0x803381a5</p:MessageID>
|
27
|
+
<p:OtherErrorSourceFormat xsi:nil='true' xsi:type='cim:cimString'/>
|
28
|
+
<p:OtherErrorType xsi:nil='true' xsi:type='cim:cimString'/>
|
29
|
+
<p:OwningEntity xsi:nil='true' xsi:type='cim:cimString'/>
|
30
|
+
<p:PerceivedSeverity xsi:type='cim:cimUnsignedShort'>0</p:PerceivedSeverity>
|
31
|
+
<p:ProbableCause xsi:type='cim:cimUnsignedShort'>0</p:ProbableCause>
|
32
|
+
<p:ProbableCauseDescription xsi:nil='true' xsi:type='cim:cimString'/>
|
33
|
+
<p:error_Category xsi:type='cim:cimUnsignedInt'>30</p:error_Category>
|
34
|
+
<p:error_Code xsi:type='cim:cimUnsignedInt'>2150859173</p:error_Code>
|
35
|
+
<p:error_Type xsi:type='cim:cimString'>HRESULT</p:error_Type>
|
36
|
+
<p:error_WindowsErrorMessage xsi:type='cim:cimString'>The WS-Management service cannot process the request. This user is allowed a maximum number of 30 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </p:error_WindowsErrorMessage>
|
37
|
+
</p:MSFT_WmiError>
|
38
|
+
</s:Detail>
|
39
|
+
</s:Fault>
|
40
|
+
</s:Body>
|
41
|
+
</s:Envelope>
|
data/spec/winrm_options_spec.rb
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
describe 'WinRM options', unit: true do
|
3
|
-
let(:subject) { WinRM::WinRMWebService.new('http://localhost:55985/wsman', :plaintext) }
|
4
|
-
|
5
|
-
context 'when operations timeout is set to 60' do
|
6
|
-
before(:each) { subject.set_timeout(60) }
|
7
|
-
describe '#receive_timeout' do
|
8
|
-
it 'is set to 70s' do
|
9
|
-
transportclass = subject.instance_variable_get(:@xfer)
|
10
|
-
expect(transportclass.receive_timeout).to eql(70)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
describe '#op_timeout' do
|
14
|
-
it 'is set to 60s' do
|
15
|
-
expect(subject.timeout).to eql('PT60S')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'when operations timeout is set to 30 and receive timeout is set to 120' do
|
21
|
-
before(:each) { subject.set_timeout(30, 120) }
|
22
|
-
describe '#receive_timeout' do
|
23
|
-
it 'is set to 120s' do
|
24
|
-
transportclass = subject.instance_variable_get(:@xfer)
|
25
|
-
expect(transportclass.receive_timeout).to eql(120)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
describe '#op_timeout' do
|
29
|
-
it 'is set to 30s' do
|
30
|
-
expect(subject.timeout).to eql('PT30S')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'when max_env_size is set to 614400' do
|
36
|
-
before(:each) { subject.max_env_size(614_400) }
|
37
|
-
describe '@max_env_sz' do
|
38
|
-
it 'is set to 614400' do
|
39
|
-
expect(subject.instance_variable_get('@max_env_sz')).to eq(614_400)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'when locale is set to en-CA' do
|
45
|
-
before(:each) { subject.locale('en-CA') }
|
46
|
-
describe '@locale' do
|
47
|
-
it 'is set to en-CA' do
|
48
|
-
expect(subject.instance_variable_get('@locale')).to eq('en-CA')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context 'default' do
|
54
|
-
describe '#receive_timeout' do
|
55
|
-
it 'should be 3600ms' do
|
56
|
-
transportclass = subject.instance_variable_get(:@xfer)
|
57
|
-
expect(transportclass.receive_timeout).to eql(3600)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
describe '#timeout' do
|
61
|
-
it 'should be 60s' do
|
62
|
-
expect(subject.timeout).to eql('PT60S')
|
63
|
-
end
|
64
|
-
end
|
65
|
-
describe '@locale' do
|
66
|
-
it 'should be en-US' do
|
67
|
-
expect(subject.instance_variable_get('@locale')).to eq('en-US')
|
68
|
-
end
|
69
|
-
end
|
70
|
-
describe '@max_env_sz' do
|
71
|
-
it 'should be 153600' do
|
72
|
-
expect(subject.instance_variable_get('@max_env_sz')).to eq(153_600)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
describe 'WinRM options', unit: true do
|
3
|
+
let(:subject) { WinRM::WinRMWebService.new('http://localhost:55985/wsman', :plaintext) }
|
4
|
+
|
5
|
+
context 'when operations timeout is set to 60' do
|
6
|
+
before(:each) { subject.set_timeout(60) }
|
7
|
+
describe '#receive_timeout' do
|
8
|
+
it 'is set to 70s' do
|
9
|
+
transportclass = subject.instance_variable_get(:@xfer)
|
10
|
+
expect(transportclass.receive_timeout).to eql(70)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
describe '#op_timeout' do
|
14
|
+
it 'is set to 60s' do
|
15
|
+
expect(subject.timeout).to eql('PT60S')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when operations timeout is set to 30 and receive timeout is set to 120' do
|
21
|
+
before(:each) { subject.set_timeout(30, 120) }
|
22
|
+
describe '#receive_timeout' do
|
23
|
+
it 'is set to 120s' do
|
24
|
+
transportclass = subject.instance_variable_get(:@xfer)
|
25
|
+
expect(transportclass.receive_timeout).to eql(120)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe '#op_timeout' do
|
29
|
+
it 'is set to 30s' do
|
30
|
+
expect(subject.timeout).to eql('PT30S')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when max_env_size is set to 614400' do
|
36
|
+
before(:each) { subject.max_env_size(614_400) }
|
37
|
+
describe '@max_env_sz' do
|
38
|
+
it 'is set to 614400' do
|
39
|
+
expect(subject.instance_variable_get('@max_env_sz')).to eq(614_400)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when locale is set to en-CA' do
|
45
|
+
before(:each) { subject.locale('en-CA') }
|
46
|
+
describe '@locale' do
|
47
|
+
it 'is set to en-CA' do
|
48
|
+
expect(subject.instance_variable_get('@locale')).to eq('en-CA')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'default' do
|
54
|
+
describe '#receive_timeout' do
|
55
|
+
it 'should be 3600ms' do
|
56
|
+
transportclass = subject.instance_variable_get(:@xfer)
|
57
|
+
expect(transportclass.receive_timeout).to eql(3600)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
describe '#timeout' do
|
61
|
+
it 'should be 60s' do
|
62
|
+
expect(subject.timeout).to eql('PT60S')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
describe '@locale' do
|
66
|
+
it 'should be en-US' do
|
67
|
+
expect(subject.instance_variable_get('@locale')).to eq('en-US')
|
68
|
+
end
|
69
|
+
end
|
70
|
+
describe '@max_env_sz' do
|
71
|
+
it 'should be 153600' do
|
72
|
+
expect(subject.instance_variable_get('@max_env_sz')).to eq(153_600)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|