rbvmomi 1.8.5 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +13 -0
- data/.travis.yml +10 -0
- data/Gemfile +3 -0
- data/README.rdoc +6 -2
- data/Rakefile +2 -35
- data/{bin → exe}/rbvmomish +0 -0
- data/ext/mkrf_conf.rb +24 -0
- data/lib/rbvmomi/basic_types.rb +6 -0
- data/lib/rbvmomi/trivial_soap.rb +5 -7
- data/lib/rbvmomi/utils/admission_control.rb +19 -19
- data/lib/rbvmomi/utils/perfdump.rb +1 -1
- data/lib/rbvmomi/version.rb +3 -0
- data/lib/rbvmomi/vim.rb +25 -4
- data/lib/rbvmomi/vim/Datacenter.rb +5 -0
- data/lib/rbvmomi/vim/Datastore.rb +2 -1
- data/lib/rbvmomi/vim/OvfManager.rb +2 -1
- data/lib/rbvmomi/vim/ReflectManagedMethodExecuter.rb +2 -2
- data/rbvmomi.gemspec +33 -0
- data/vmodl.db +0 -0
- metadata +100 -32
- data/VERSION +0 -1
- data/test/test_deserialization.rb +0 -383
- data/test/test_emit_request.rb +0 -128
- data/test/test_exceptions.rb +0 -14
- data/test/test_helper.rb +0 -14
- data/test/test_misc.rb +0 -24
- data/test/test_parse_response.rb +0 -69
- data/test/test_serialization.rb +0 -311
data/vmodl.db
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,73 +1,143 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbvmomi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich Lane
|
8
8
|
- Christian Dickmann
|
9
9
|
autorequire:
|
10
|
-
bindir:
|
10
|
+
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: builder
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: '3.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: '3.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: json
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.8'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.8'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: nokogiri
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
|
-
- - "
|
46
|
+
- - "~>"
|
33
47
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
48
|
+
version: 1.5.11
|
35
49
|
type: :runtime
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
|
-
- - "
|
53
|
+
- - "~>"
|
40
54
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
55
|
+
version: 1.5.11
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: trollop
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
|
-
- - "
|
60
|
+
- - "~>"
|
47
61
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
62
|
+
version: '2.1'
|
49
63
|
type: :runtime
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- - "
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.1'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '10.5'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
54
82
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
83
|
+
version: '10.5'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: simplecov
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.12.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.12.0
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: yard
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 0.9.5
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 0.9.5
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: test-unit
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '3.2'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.2'
|
56
126
|
description:
|
57
|
-
email:
|
127
|
+
email: jr@garciaole.com
|
58
128
|
executables:
|
59
129
|
- rbvmomish
|
60
|
-
extensions:
|
61
|
-
|
62
|
-
|
63
|
-
- README.rdoc
|
130
|
+
extensions:
|
131
|
+
- ext/mkrf_conf.rb
|
132
|
+
extra_rdoc_files: []
|
64
133
|
files:
|
134
|
+
- ".gitignore"
|
135
|
+
- ".travis.yml"
|
65
136
|
- ".yardopts"
|
137
|
+
- Gemfile
|
66
138
|
- LICENSE
|
67
139
|
- README.rdoc
|
68
140
|
- Rakefile
|
69
|
-
- VERSION
|
70
|
-
- bin/rbvmomish
|
71
141
|
- devel/analyze-vim-declarations.rb
|
72
142
|
- devel/analyze-xml.rb
|
73
143
|
- devel/benchmark.rb
|
@@ -91,6 +161,8 @@ files:
|
|
91
161
|
- examples/screenshot.rb
|
92
162
|
- examples/vdf.rb
|
93
163
|
- examples/vm_drs_behavior.rb
|
164
|
+
- exe/rbvmomish
|
165
|
+
- ext/mkrf_conf.rb
|
94
166
|
- lib/rbvmomi.rb
|
95
167
|
- lib/rbvmomi/basic_types.rb
|
96
168
|
- lib/rbvmomi/connection.rb
|
@@ -106,6 +178,7 @@ files:
|
|
106
178
|
- lib/rbvmomi/utils/deploy.rb
|
107
179
|
- lib/rbvmomi/utils/leases.rb
|
108
180
|
- lib/rbvmomi/utils/perfdump.rb
|
181
|
+
- lib/rbvmomi/version.rb
|
109
182
|
- lib/rbvmomi/vim.rb
|
110
183
|
- lib/rbvmomi/vim/ComputeResource.rb
|
111
184
|
- lib/rbvmomi/vim/Datacenter.rb
|
@@ -128,13 +201,7 @@ files:
|
|
128
201
|
- lib/rbvmomi/vim/ServiceInstance.rb
|
129
202
|
- lib/rbvmomi/vim/Task.rb
|
130
203
|
- lib/rbvmomi/vim/VirtualMachine.rb
|
131
|
-
-
|
132
|
-
- test/test_emit_request.rb
|
133
|
-
- test/test_exceptions.rb
|
134
|
-
- test/test_helper.rb
|
135
|
-
- test/test_misc.rb
|
136
|
-
- test/test_parse_response.rb
|
137
|
-
- test/test_serialization.rb
|
204
|
+
- rbvmomi.gemspec
|
138
205
|
- vmodl.db
|
139
206
|
homepage: https://github.com/vmware/rbvmomi
|
140
207
|
licenses: []
|
@@ -154,7 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
221
|
- !ruby/object:Gem::Version
|
155
222
|
version: '0'
|
156
223
|
requirements: []
|
157
|
-
|
224
|
+
rubyforge_project:
|
225
|
+
rubygems_version: 2.5.1
|
158
226
|
signing_key:
|
159
227
|
specification_version: 4
|
160
228
|
summary: Ruby interface to the VMware vSphere API
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.8.2
|
@@ -1,383 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class DeserializationTest < Test::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
conn = VIM.new(:ns => 'urn:vim25', :rev => '4.0')
|
6
|
-
@deserializer = RbVmomi::Deserializer.new conn
|
7
|
-
end
|
8
|
-
|
9
|
-
def check str, expected, type
|
10
|
-
got = @deserializer.deserialize Nokogiri(str).root, type
|
11
|
-
assert_equal expected, got
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_moref
|
15
|
-
check <<-EOS, VIM.Folder(nil, 'ha-folder-root'), 'Folder'
|
16
|
-
<root type="Folder">ha-folder-root</root>
|
17
|
-
EOS
|
18
|
-
|
19
|
-
check <<-EOS, VIM.Datacenter(nil, 'ha-datacenter'), 'ManagedObjectReference'
|
20
|
-
<ManagedObjectReference type="Datacenter" xsi:type="ManagedObjectReference">ha-datacenter</ManagedObjectReference>
|
21
|
-
EOS
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_dataobject
|
25
|
-
obj = VIM.DatastoreSummary(
|
26
|
-
:capacity => 1000,
|
27
|
-
:accessible => true,
|
28
|
-
:datastore => VIM.Datastore(nil, "foo"),
|
29
|
-
:freeSpace => 31,
|
30
|
-
:multipleHostAccess => false,
|
31
|
-
:name => "baz",
|
32
|
-
:type => "VMFS",
|
33
|
-
:url => "http://foo/",
|
34
|
-
:dynamicProperty => []
|
35
|
-
)
|
36
|
-
|
37
|
-
check <<-EOS, obj, 'DatastoreSummary'
|
38
|
-
<root>
|
39
|
-
<datastore type="Datastore">foo</datastore>
|
40
|
-
<name>baz</name>
|
41
|
-
<url>http://foo/</url>
|
42
|
-
<capacity>1000</capacity>
|
43
|
-
<freeSpace>31</freeSpace>
|
44
|
-
<accessible>1</accessible>
|
45
|
-
<multipleHostAccess>false</multipleHostAccess>
|
46
|
-
<type>VMFS</type>
|
47
|
-
</root>
|
48
|
-
EOS
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_enum
|
52
|
-
check <<-EOS, 'add', 'ConfigSpecOperation'
|
53
|
-
<root>add</root>
|
54
|
-
EOS
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_array
|
58
|
-
obj = VIM.ObjectContent(
|
59
|
-
:obj => VIM.Folder(nil, 'ha-folder-root'),
|
60
|
-
:dynamicProperty => [],
|
61
|
-
:missingSet => [],
|
62
|
-
:propSet => [
|
63
|
-
VIM.DynamicProperty(
|
64
|
-
:name => 'childEntity',
|
65
|
-
:val => [
|
66
|
-
VIM.Datacenter(nil, 'ha-datacenter')
|
67
|
-
]
|
68
|
-
)
|
69
|
-
]
|
70
|
-
)
|
71
|
-
|
72
|
-
check <<-EOS, obj, 'ObjectContent'
|
73
|
-
<root xmlns:xsi="#{VIM::NS_XSI}">
|
74
|
-
<obj type="Folder">ha-folder-root</obj>
|
75
|
-
<propSet>
|
76
|
-
<name>childEntity</name>
|
77
|
-
<val xsi:type="ArrayOfManagedObjectReference">
|
78
|
-
<ManagedObjectReference type="Datacenter" xsi:type="ManagedObjectReference">ha-datacenter</ManagedObjectReference>
|
79
|
-
</val>
|
80
|
-
</propSet>
|
81
|
-
</root>
|
82
|
-
EOS
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_array2
|
86
|
-
obj = VIM.DVPortStatus(
|
87
|
-
:dynamicProperty => [],
|
88
|
-
:linkUp => true,
|
89
|
-
:blocked => false,
|
90
|
-
:vlanIds => [
|
91
|
-
VIM::NumericRange(:dynamicProperty => [], :start => 5, :end => 7),
|
92
|
-
VIM::NumericRange(:dynamicProperty => [], :start => 10, :end => 20),
|
93
|
-
],
|
94
|
-
:vmDirectPathGen2InactiveReasonNetwork => [],
|
95
|
-
:vmDirectPathGen2InactiveReasonOther => []
|
96
|
-
)
|
97
|
-
|
98
|
-
check <<-EOS, obj, 'DVPortStatus'
|
99
|
-
<root>
|
100
|
-
<linkUp>1</linkUp>
|
101
|
-
<blocked>false</blocked>
|
102
|
-
<vlanIds>
|
103
|
-
<start>5</start>
|
104
|
-
<end>7</end>
|
105
|
-
</vlanIds>
|
106
|
-
<vlanIds>
|
107
|
-
<start>10</start>
|
108
|
-
<end>20</end>
|
109
|
-
</vlanIds>
|
110
|
-
</root>
|
111
|
-
EOS
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_empty_array
|
115
|
-
obj = VIM.DVPortStatus(
|
116
|
-
:dynamicProperty => [],
|
117
|
-
:linkUp => true,
|
118
|
-
:blocked => false,
|
119
|
-
:vlanIds => [],
|
120
|
-
:vmDirectPathGen2InactiveReasonNetwork => [],
|
121
|
-
:vmDirectPathGen2InactiveReasonOther => []
|
122
|
-
)
|
123
|
-
|
124
|
-
check <<-EOS, obj, 'DVPortStatus'
|
125
|
-
<root>
|
126
|
-
<linkUp>1</linkUp>
|
127
|
-
<blocked>false</blocked>
|
128
|
-
</root>
|
129
|
-
EOS
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_fault
|
133
|
-
obj = VIM.LocalizedMethodFault(
|
134
|
-
:localizedMessage => "The attempted operation cannot be performed in the current state (Powered off).",
|
135
|
-
:fault => VIM.InvalidPowerState(
|
136
|
-
:requestedState => 'poweredOn',
|
137
|
-
:existingState => 'poweredOff',
|
138
|
-
:faultMessage => []
|
139
|
-
)
|
140
|
-
)
|
141
|
-
|
142
|
-
check <<-EOS, obj, "LocalizedMethodFault"
|
143
|
-
<error xmlns:xsi="#{VIM::NS_XSI}">
|
144
|
-
<fault xsi:type="InvalidPowerState">
|
145
|
-
<requestedState>poweredOn</requestedState>
|
146
|
-
<existingState>poweredOff</existingState>
|
147
|
-
</fault>
|
148
|
-
<localizedMessage>The attempted operation cannot be performed in the current state (Powered off).</localizedMessage>
|
149
|
-
</error>
|
150
|
-
EOS
|
151
|
-
end
|
152
|
-
|
153
|
-
def test_wait_for_updates
|
154
|
-
obj = VIM.UpdateSet(
|
155
|
-
:version => '7',
|
156
|
-
:dynamicProperty => [],
|
157
|
-
:filterSet => [
|
158
|
-
VIM.PropertyFilterUpdate(
|
159
|
-
:dynamicProperty => [],
|
160
|
-
:filter => VIM.PropertyFilter(nil, "session[528BA5EB-335B-4AF6-B49C-6160CF5E8D5B]71E3AC7E-7927-4D9E-8BC3-522769F22DAF"),
|
161
|
-
:missingSet => [],
|
162
|
-
:objectSet => [
|
163
|
-
VIM.ObjectUpdate(
|
164
|
-
:dynamicProperty => [],
|
165
|
-
:kind => 'enter',
|
166
|
-
:obj => VIM.VirtualMachine(nil, 'vm-1106'),
|
167
|
-
:missingSet => [],
|
168
|
-
:changeSet => [
|
169
|
-
VIM.PropertyChange(
|
170
|
-
:dynamicProperty => [],
|
171
|
-
:name => 'runtime.powerState',
|
172
|
-
:op => 'assign',
|
173
|
-
:val => 'poweredOn'
|
174
|
-
)
|
175
|
-
]
|
176
|
-
)
|
177
|
-
]
|
178
|
-
)
|
179
|
-
]
|
180
|
-
)
|
181
|
-
|
182
|
-
check <<-EOS, obj, "UpdateSet"
|
183
|
-
<returnval xmlns:xsi="#{VIM::NS_XSI}">
|
184
|
-
<version>7</version>
|
185
|
-
<filterSet>
|
186
|
-
<filter type="PropertyFilter">session[528BA5EB-335B-4AF6-B49C-6160CF5E8D5B]71E3AC7E-7927-4D9E-8BC3-522769F22DAF</filter>
|
187
|
-
<objectSet>
|
188
|
-
<kind>enter</kind>
|
189
|
-
<obj type="VirtualMachine">vm-1106</obj>
|
190
|
-
<changeSet>
|
191
|
-
<name>runtime.powerState</name>
|
192
|
-
<op>assign</op>
|
193
|
-
<val xsi:type="VirtualMachinePowerState">poweredOn</val>
|
194
|
-
</changeSet>
|
195
|
-
</objectSet>
|
196
|
-
</filterSet>
|
197
|
-
</returnval>
|
198
|
-
EOS
|
199
|
-
end
|
200
|
-
|
201
|
-
def test_binary
|
202
|
-
obj = "\x00foo\x01bar\x02baz"
|
203
|
-
check <<-EOS, obj, 'xsd:base64Binary'
|
204
|
-
<root>AGZvbwFiYXICYmF6</root>
|
205
|
-
EOS
|
206
|
-
end
|
207
|
-
|
208
|
-
def test_hba
|
209
|
-
obj = VIM::HostBlockHba(
|
210
|
-
:dynamicProperty => [],
|
211
|
-
:key => 'key-vim.host.BlockHba-vmhba0',
|
212
|
-
:device => 'vmhba0',
|
213
|
-
:bus => 0,
|
214
|
-
:status => 'unknown',
|
215
|
-
:model => 'Virtual Machine Chipset',
|
216
|
-
:driver => 'ata_piix',
|
217
|
-
:pci => '00:07.1')
|
218
|
-
|
219
|
-
check <<-EOS, obj, "HostBlockHba"
|
220
|
-
<hostBusAdapter xsi:type="HostBlockHba">
|
221
|
-
<key>key-vim.host.BlockHba-vmhba0</key>
|
222
|
-
<device>vmhba0</device>
|
223
|
-
<bus>0</bus>
|
224
|
-
<status>unknown</status>
|
225
|
-
<model>Virtual Machine Chipset</model>
|
226
|
-
<driver>ata_piix</driver>
|
227
|
-
<pci>00:07.1</pci>
|
228
|
-
</hostBusAdapter>
|
229
|
-
EOS
|
230
|
-
end
|
231
|
-
|
232
|
-
=begin
|
233
|
-
def test_runtime_state
|
234
|
-
obj = VIM::VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState(
|
235
|
-
:dynamicProperty => [],
|
236
|
-
vmDirectPathGen2:Active => false,
|
237
|
-
vmDirectPathGen2:InactiveReasonOther => ["vmNptIncompatibleHost"],
|
238
|
-
vmDirectPathGen2:InactiveReasonVm => []
|
239
|
-
)
|
240
|
-
check <<-EOS, obj, 'VirtualMachineDeviceRuntimeInfoDeviceRuntimeState'
|
241
|
-
<runtimeState xsi:type="VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState" xmlns:xsi="#{VIM::NS_XSI}">
|
242
|
-
<vmDirectPathGen2Active>false</vmDirectPathGen2Active>
|
243
|
-
<vmDirectPathGen2InactiveReasonOther>vmNptIncompatibleHost</vmDirectPathGen2InactiveReasonOther>
|
244
|
-
</runtimeState>
|
245
|
-
EOS
|
246
|
-
end
|
247
|
-
=end
|
248
|
-
|
249
|
-
def test_runtime_info
|
250
|
-
obj = VIM::VirtualMachineRuntimeInfo(
|
251
|
-
:bootTime => Time.parse('2010-08-20 05:44:35 UTC'),
|
252
|
-
:connectionState => "connected",
|
253
|
-
:dynamicProperty => [],
|
254
|
-
:faultToleranceState => "notConfigured",
|
255
|
-
:featureMask => [],
|
256
|
-
:featureRequirement => [],
|
257
|
-
:host => VIM::HostSystem(nil, "host-32"),
|
258
|
-
:maxCpuUsage => 5612,
|
259
|
-
:maxMemoryUsage => 3072,
|
260
|
-
:memoryOverhead => 128671744,
|
261
|
-
:numMksConnections => 1,
|
262
|
-
:offlineFeatureRequirement => [],
|
263
|
-
:powerState => "poweredOn",
|
264
|
-
:recordReplayState => "inactive",
|
265
|
-
:suspendInterval => 0,
|
266
|
-
:toolsInstallerMounted => false,
|
267
|
-
:device => []
|
268
|
-
)
|
269
|
-
|
270
|
-
check <<-EOS, obj, 'VirtualMachineRuntimeInfo'
|
271
|
-
<val xsi:type="VirtualMachineRuntimeInfo" xmlns:xsi="#{VIM::NS_XSI}">
|
272
|
-
<host type="HostSystem">host-32</host>
|
273
|
-
<connectionState>connected</connectionState>
|
274
|
-
<powerState>poweredOn</powerState>
|
275
|
-
<faultToleranceState>notConfigured</faultToleranceState>
|
276
|
-
<toolsInstallerMounted>false</toolsInstallerMounted>
|
277
|
-
<bootTime>2010-08-20T05:44:35.0Z</bootTime>
|
278
|
-
<suspendInterval>0</suspendInterval>
|
279
|
-
<memoryOverhead>128671744</memoryOverhead>
|
280
|
-
<maxCpuUsage>5612</maxCpuUsage>
|
281
|
-
<maxMemoryUsage>3072</maxMemoryUsage>
|
282
|
-
<numMksConnections>1</numMksConnections>
|
283
|
-
<recordReplayState>inactive</recordReplayState>
|
284
|
-
</val>
|
285
|
-
EOS
|
286
|
-
end
|
287
|
-
|
288
|
-
def test_keyvalue
|
289
|
-
obj = ['a', 'b']
|
290
|
-
check <<-EOS, obj, 'KeyValue'
|
291
|
-
<root>
|
292
|
-
<key>a</key>
|
293
|
-
<value>b</value>
|
294
|
-
</root>
|
295
|
-
EOS
|
296
|
-
end
|
297
|
-
|
298
|
-
def test_boolean
|
299
|
-
check "<root>1</root>", true, 'xsd:boolean'
|
300
|
-
check "<root>true</root>", true, 'xsd:boolean'
|
301
|
-
check "<root>0</root>", false, 'xsd:boolean'
|
302
|
-
check "<root>false</root>", false, 'xsd:boolean'
|
303
|
-
end
|
304
|
-
|
305
|
-
def test_int
|
306
|
-
check "<root>5</root>", 5, 'xsd:byte'
|
307
|
-
check "<root>5</root>", 5, 'xsd:short'
|
308
|
-
check "<root>5</root>", 5, 'xsd:int'
|
309
|
-
check "<root>5</root>", 5, 'xsd:long'
|
310
|
-
end
|
311
|
-
|
312
|
-
def test_float
|
313
|
-
obj = 1.2
|
314
|
-
check <<-EOS, obj, 'xsd:float'
|
315
|
-
<root>1.2</root>
|
316
|
-
EOS
|
317
|
-
end
|
318
|
-
|
319
|
-
def test_date
|
320
|
-
time_str = '2010-08-20T05:44:35.0Z'
|
321
|
-
obj = Time.parse(time_str)
|
322
|
-
check <<-EOS, obj, 'xsd:dateTime'
|
323
|
-
<root>#{time_str}</root>
|
324
|
-
EOS
|
325
|
-
end
|
326
|
-
|
327
|
-
def test_array_mangling
|
328
|
-
obj = ["foo"]
|
329
|
-
check <<-EOS, obj, 'ArrayOfString'
|
330
|
-
<root><e>foo</e></root>
|
331
|
-
EOS
|
332
|
-
|
333
|
-
time_str = '2010-08-20T05:44:35.0Z'
|
334
|
-
obj = [Time.parse(time_str)]
|
335
|
-
check <<-EOS, obj, 'ArrayOfDateTime'
|
336
|
-
<root><e>#{time_str}</e></root>
|
337
|
-
EOS
|
338
|
-
|
339
|
-
obj = [1]
|
340
|
-
check <<-EOS, obj, 'ArrayOfAnyType'
|
341
|
-
<root xmlns:xsi="#{VIM::NS_XSI}">
|
342
|
-
<e xsi:type="xsd:int">1</e>
|
343
|
-
</root>
|
344
|
-
EOS
|
345
|
-
end
|
346
|
-
|
347
|
-
def test_propertypath
|
348
|
-
check "<root>foo</root>", "foo", 'PropertyPath'
|
349
|
-
end
|
350
|
-
|
351
|
-
def test_methodname
|
352
|
-
check "<root>foo</root>", "foo", 'MethodName'
|
353
|
-
end
|
354
|
-
|
355
|
-
def test_typename
|
356
|
-
check "<root>foo</root>", "foo", 'TypeName'
|
357
|
-
end
|
358
|
-
|
359
|
-
def test_new_fields
|
360
|
-
obj = VIM::HostBlockHba(
|
361
|
-
:dynamicProperty => [],
|
362
|
-
:key => 'key-vim.host.BlockHba-vmhba0',
|
363
|
-
:device => 'vmhba0',
|
364
|
-
:bus => 0,
|
365
|
-
:status => 'unknown',
|
366
|
-
:model => 'Virtual Machine Chipset',
|
367
|
-
:driver => 'ata_piix',
|
368
|
-
:pci => '00:07.1')
|
369
|
-
|
370
|
-
check <<-EOS, obj, "HostBlockHba"
|
371
|
-
<hostBusAdapter xsi:type="HostBlockHba">
|
372
|
-
<key>key-vim.host.BlockHba-vmhba0</key>
|
373
|
-
<device>vmhba0</device>
|
374
|
-
<bus>0</bus>
|
375
|
-
<status>unknown</status>
|
376
|
-
<foo>bar</foo>
|
377
|
-
<model>Virtual Machine Chipset</model>
|
378
|
-
<driver>ata_piix</driver>
|
379
|
-
<pci>00:07.1</pci>
|
380
|
-
</hostBusAdapter>
|
381
|
-
EOS
|
382
|
-
end
|
383
|
-
end
|