You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by jb...@apache.org on 2016/11/17 05:32:45 UTC

[3/4] git commit: updated refs/heads/master to 5cc9070

Merge release branch 4.9 to master

* 4.9:
  CLOUDSTACK-9502: DS template copies don\u2019t get deleted in VMware ESXi with multiple clusters and zone wide storage


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c66cf1c6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c66cf1c6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c66cf1c6

Branch: refs/heads/master
Commit: c66cf1c60d78c44ba8a8402056e317bfff5c4283
Parents: becec33 20b4376
Author: John Burwell <me...@cockamamy.net>
Authored: Wed Nov 16 23:23:09 2016 -0500
Committer: John Burwell <me...@cockamamy.net>
Committed: Wed Nov 16 23:23:09 2016 -0500

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResourceTest.java      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c66cf1c6/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
index 3aac132,a3e2daa..c8143a7
--- a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
+++ b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/resource/VmwareResourceTest.java
@@@ -24,14 -25,10 +24,16 @@@ import static org.junit.Assert.assertFa
  import static org.junit.Assert.assertTrue;
  import static org.mockito.Mockito.any;
  import static org.mockito.Mockito.never;
 +import static org.mockito.Matchers.eq;
 +import static org.mockito.Mockito.times;
 +
 +import java.util.ArrayList;
 +import static org.powermock.api.mockito.PowerMockito.whenNew;
  
+ import static org.powermock.api.mockito.PowerMockito.whenNew;
+ 
  import java.util.Arrays;
 +import java.util.EnumMap;
  import java.util.HashMap;
  import java.util.Map;
  
@@@ -155,13 -132,7 +157,14 @@@ public class VmwareResourceTest 
          when(storageCmd.getSrcTO()).thenReturn(srcDataTO);
          when(srcDataTO.getDataStore()).thenReturn(srcDataNfsTO);
          when(srcDataNfsTO.getNfsVersion()).thenReturn(NFS_VERSION);
 +        when(videoCard.getVideoRamSizeInKB()).thenReturn(VIDEO_CARD_MEMORY_SIZE);
 +        when(volume.getPath()).thenReturn(VOLUME_PATH);
 +
 +        when(storageCmd.getDestTO()).thenReturn(destDataTO);
 +        when(destDataTO.getHypervisorType()).thenReturn(HypervisorType.VMware);
 +        when(destDataTO.getDataStore()).thenReturn(destDataStoreTO);
 +        when(destDataStoreTO.isFullCloneFlag()).thenReturn(FULL_CLONE_FLAG);
+         when(volume.getPath()).thenReturn(VOLUME_PATH);
      }
  
      //Test successful scaling up the vm
@@@ -329,15 -223,15 +332,21 @@@
      public void checkStorageProcessorAndHandlerNfsVersionAttributeVersionSet(){
          _resource.storageNfsVersion = NFS_VERSION;
          _resource.checkStorageProcessorAndHandlerNfsVersionAttribute(storageCmd);
 -        verify(_resource, never()).examineStorageSubSystemCommandNfsVersion(storageCmd);
 +        verify(_resource, never()).examineStorageSubSystemCommandNfsVersion(Matchers.eq(storageCmd), any(EnumMap.class));
 +    }
 +
 +    @Test(expected=CloudRuntimeException.class)
 +    public void testFindVmOnDatacenterNullHyperHostReference() throws Exception {
 +        when(hyperHost.getMor()).thenReturn(null);
 +        _resource.findVmOnDatacenter(context, hyperHost, volume);
      }
  
+     @Test(expected=CloudRuntimeException.class)
+     public void testFindVmOnDatacenterNullHyperHostReference() throws Exception {
+         when(hyperHost.getMor()).thenReturn(null);
+         _resource.findVmOnDatacenter(context, hyperHost, volume);
+     }
+ 
      @Test
      public void testFindVmOnDatacenter() throws Exception {
          when(hyperHost.getHyperHostDatacenter()).thenReturn(mor);