/* * Copyright 2016 Skyscape Cloud Services. All rights reserved. Licensed under the Apache v2 License. */ package govcd import ( // "fmt" "github.com/hmrc/vmware-govcd/testutil" . "gopkg.in/check.v1" ) func (s *K) Test_FindVMByHREF(c *C) { // Get the Org populated testServer.ResponseMap(1, testutil.ResponseMap{ "/api/vApp/vm-11111111-1111-1111-1111-111111111111": testutil.Response{200, nil, vmExample}, }) vm_href := vcdu_api.String() + "/vApp/vm-11111111-1111-1111-1111-111111111111" vm, err := s.client.FindVMByHREF(vm_href) _ = testServer.WaitRequest() testServer.Flush() c.Assert(err, IsNil) c.Assert(vm.VM.Name, Equals, "testvmxnet") c.Assert(vm.VM.VirtualHardwareSection.Item, NotNil) } var vmExample = ` Virtual hardware requirements Virtual Hardware Family 0 testvmxnet vmx-09 00:50:56:01:35:88 1 true Development Network Vmxnet3 ethernet adapter on "Development Network" Network adapter 1 1 VMXNET3 10 0 SCSI Controller SCSI Controller 0 2 lsilogic 6 0 Hard disk Hard disk 1 2000 2 17 1 IDE Controller IDE Controller 1 3 5 0 false CD/DVD Drive CD/DVD Drive 1 3002 3 15 hertz * 10^6 Number of Virtual CPUs 1 virtual CPU(s) 4 0 3 1 0 1 byte * 2^20 Memory Size 512 MB of memory 5 0 4 512 0 Specifies the operating system installed CentOS 4/5/6/7 (64-bit) Specifies the available VM network connections 1 1 10.40.0.11 true 00:50:56:01:35:88 POOL Specifies Guest OS Customization Settings true false 11111111-1111-1111-1111-111111111111 false false true true false 0 false testvmxnet3 Specifies Runtime info Snapshot information section vm false false `