Revision fa337742 test/ganeti.ovf_unittest.py

b/test/ganeti.ovf_unittest.py
237 237
                "AllocationSettingData\" xmlns:vssd=\"http://schemas.dmtf.org"
238 238
                "/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData\""
239 239
                " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" />")
240
EXPORT_DISKS_EMPTY = "<References /><DiskSection />"
240
EXPORT_DISKS_EMPTY = ("<References /><DiskSection><Info>Virtual disk"
241
                      " information</Info></DiskSection>")
241 242
EXPORT_DISKS = ("<References><File ovf:compression=\"gzip\" ovf:href=\"new_disk"
242 243
                ".cow.gz\" ovf:id=\"file0\" ovf:size=\"203\" /><File ovf:href="
243 244
                "\"new_disk.cow\" ovf:id=\"file1\" ovf:size=\"15\" />"
244
                "</References><DiskSection><Disk ovf:capacity=\"90000\""
245
                " ovf:diskId=\"disk0\" ovf:fileRef=\"file0\" ovf:format=\"http"
246
                "://www.vmware.com/interfaces/specifications/vmdk.html"
247
                "#monolithicSparse\" /><Disk ovf:capacity=\"15\" ovf:diskId="
248
                "\"disk1\" ovf:fileRef=\"file1\" ovf:format=\"http://www.gnome"
249
                ".org/~markmc/qcow-image-format.html\" /></DiskSection>")
250
EXPORT_NETWORKS_EMPTY = "<NetworkSection />"
251
EXPORT_NETWORKS = ("<NetworkSection><Network ovf:name=\"routed0\" />"
252
                   "</NetworkSection>")
245
                "</References><DiskSection><Info>Virtual disk information"
246
                "</Info><Disk ovf:capacity=\"90000\" ovf:diskId=\"disk0\" ovf"
247
                ":fileRef=\"file0\" ovf:format=\"http://www.vmware.com/"
248
                "interfaces/specifications/vmdk.html#monolithicSparse\" /><Disk"
249
                " ovf:capacity=\"15\" ovf:diskId=\"disk1\" ovf:fileRef"
250
                "=\"file1\" ovf:format=\"http://www.gnome.org/~markmc/qcow"
251
                "-image-format.html\" /></DiskSection>")
252
EXPORT_NETWORKS_EMPTY = ("<NetworkSection><Info>List of logical networks</Info>"
253
                         "</NetworkSection>")
254
EXPORT_NETWORKS = ("<NetworkSection><Info>List of logical networks</Info>"
255
                   "<Network ovf:name=\"routed0\" /></NetworkSection>")
253 256
EXPORT_GANETI_INCOMPLETE = ("<gnt:GanetiSection><gnt:Version>0</gnt:Version>"
254 257
                            "<gnt:AutoBalance>True</gnt:AutoBalance><gnt:"
255 258
                            "OperatingSystem><gnt:Name>lenny-image</gnt:Name>"
......
274 277
EXPORT_SYSTEM = ("<References><File ovf:compression=\"gzip\" ovf:href=\"new_"
275 278
                 "disk.cow.gz\" ovf:id=\"file0\" ovf:size=\"203\" /><File ovf:"
276 279
                 "href=\"new_disk.cow\" ovf:id=\"file1\" ovf:size=\"15\" />"
277
                 "</References><DiskSection><Disk ovf:capacity=\"90000\" ovf:"
278
                 "diskId=\"disk0\" ovf:fileRef=\"file0\" ovf:format=\"http://"
279
                 "www.vmware.com/interfaces/specifications/vmdk.html#monolithic"
280
                 "Sparse\" /><Disk ovf:capacity=\"15\" ovf:diskId=\"disk1\""
281
                 " ovf:fileRef=\"file1\" ovf:format=\"http://www.gnome.org/"
282
                 "~markmc/qcow-image-format.html\" /></DiskSection><Network"
283
                 "Section><Network ovf:name=\"routed0\" /></NetworkSection>"
284
                 "<VirtualSystem ovf:id=\"xen-dev-i1\"><Name>xen-dev-i1</Name>"
285
                 "<OperatingSystemSection ovf:id=\"0\" /><VirtualHardware"
286
                 "Section><System><vssd:ElementName>Virtual Hardware Family"
287
                 "</vssd:ElementName><vssd:InstanceId>0</vssd:InstanceId><vssd:"
280
                 "</References><DiskSection><Info>Virtual disk information"
281
                 "</Info><Disk ovf:capacity=\"90000\" ovf:diskId=\"disk0\""
282
                 " ovf:fileRef=\"file0\" ovf:format=\"http://www.vmware.com"
283
                 "/interfaces/specifications/vmdk.html#monolithicSparse\" />"
284
                 "<Disk ovf:capacity=\"15\" ovf:diskId=\"disk1\" ovf:fileRef"
285
                 "=\"file1\" ovf:format=\"http://www.gnome.org/~markmc/qcow"
286
                 "-image-format.html\" /></DiskSection><NetworkSection><Info>"
287
                 "List of logical networks</Info><Network ovf:name=\"routed0\""
288
                 " /></NetworkSection><VirtualSystem ovf:id=\"xen-dev-i1\">"
289
                 "<Info>A virtual machine</Info><Name>xen-dev-i1</Name>"
290
                 "<OperatingSystemSection ovf:id=\"0\"><Info>Installed guest"
291
                 " operating system</Info></OperatingSystemSection><Virtual"
292
                 "HardwareSection><Info>Virtual hardware requirements</Info>"
293
                 "<System><vssd:ElementName>Virtual Hardware Family"
294
                 "</vssd:ElementName><vssd:InstanceID>0</vssd:InstanceID><vssd:"
288 295
                 "VirtualSystemIdentifier>xen-dev-i1</vssd:VirtualSystem"
289 296
                 "Identifier><vssd:VirtualSystemType>ganeti-ovf</vssd:Virtual"
290 297
                 "SystemType></System><Item><rasd:ElementName>1 virtual CPU(s)"
......
296 303
                 "InstanceID><rasd:ResourceType>4</rasd:ResourceType><rasd:"
297 304
                 "VirtualQuantity>512</rasd:VirtualQuantity></Item><Item>"
298 305
                 "<rasd:Address>0</rasd:Address><rasd:ElementName>scsi"
299
                 "_controller0</rasd:ElementName><rasd:ResourceType>6</rasd"
300
                 ":ResourceType><rasd:InstanceId>3</rasd:InstanceId></Item>"
301
                 "<Item><rasd:ElementName>disk0</rasd:ElementName><rasd:"
302
                 "ResourceType>17</rasd:ResourceType><rasd:HostResource>ovf:/"
303
                 "disk/disk0</rasd:HostResource><rasd:Parent>3</rasd:Parent>"
304
                 "<rasd:InstanceID>4</rasd:InstanceID></Item><Item><rasd:"
305
                 "ElementName>disk1</rasd:ElementName><rasd:ResourceType>17"
306
                 "</rasd:ResourceType><rasd:HostResource>ovf:/disk/disk1</rasd:"
307
                 "HostResource><rasd:Parent>3</rasd:Parent><rasd:InstanceID>5"
308
                 "</rasd:InstanceID></Item><Item><rasd:ElementName>routed0"
309
                 "</rasd:ElementName><rasd:ResourceType>10</rasd:ResourceType>"
310
                 "<rasd:Connection>routed0</rasd:Connection><rasd:Address>aa:00"
311
                 ":00:d8:2c:1e</rasd:Address><rasd:InstanceID>6</rasd:Instance"
312
                 "ID></Item></VirtualHardwareSection></VirtualSystem>")
306
                 "_controller0</rasd:ElementName><rasd:InstanceID>3"
307
                 "</rasd:InstanceID><rasd:ResourceSubType>lsilogic</rasd"
308
                 ":ResourceSubType><rasd:ResourceType>6</rasd:ResourceType>"
309
                 "</Item><Item><rasd:ElementName>disk0</rasd:ElementName><rasd"
310
                 ":HostResource>ovf:/disk/disk0</rasd:HostResource><rasd"
311
                 ":InstanceID>4</rasd:InstanceID><rasd:Parent>3</rasd:Parent>"
312
                 "<rasd:ResourceType>17</rasd:ResourceType></Item><Item><rasd:"
313
                 "ElementName>disk1</rasd:ElementName><rasd:HostResource>ovf:/"
314
                 "disk/disk1</rasd:HostResource><rasd:InstanceID>5</rasd"
315
                 ":InstanceID><rasd:Parent>3</rasd:Parent><rasd:ResourceType>17"
316
                 "</rasd:ResourceType></Item><Item><rasd:Address>aa:00"
317
                 ":00:d8:2c:1e</rasd:Address><rasd:Connection>routed0</rasd"
318
                 ":Connection><rasd:ElementName>routed0</rasd:ElementName><rasd"
319
                 ":InstanceID>6</rasd:InstanceID><rasd:ResourceType>10</rasd"
320
                 ":ResourceType></Item></VirtualHardwareSection>"
321
                 "</VirtualSystem>")
313 322

  
314 323

  
315 324
def _GetArgs(args, with_name=False):

Also available in: Unified diff