nitin-maharana commented on a change in pull request #2636: Fix limitation on 
tag matching in 'migrateVolume' with disk offering replacement
URL: https://github.com/apache/cloudstack/pull/2636#discussion_r187596392
 
 

 ##########
 File path: server/src/test/java/com/cloud/storage/VolumeApiServiceImplTest.java
 ##########
 @@ -580,9 +580,86 @@ public void 
validateConditionsToReplaceDiskOfferingOfVolumeTestEverythingWorking
         inOrder.verify(storagePoolMock).isLocal();
         inOrder.verify(newDiskOfferingMock, times(0)).isShared();
         
inOrder.verify(volumeApiServiceImpl).getStoragePoolTags(storagePoolMock);
-        inOrder.verify(newDiskOfferingMock).getTags();
 
         inOrder.verify(volumeVOMock).getSize();
         inOrder.verify(newDiskOfferingMock).getDiskSize();
     }
+
+    @Test
+    public void 
doesTargetStorageSupportNewDiskOfferingTestDiskOfferingMoreTagsThanStorageTags()
 {
+        DiskOfferingVO diskOfferingVoMock = Mockito.mock(DiskOfferingVO.class);
+        Mockito.doReturn("A,B,C").when(diskOfferingVoMock).getTags();
+
+        StoragePool storagePoolMock = Mockito.mock(StoragePool.class);
+        
Mockito.doReturn("A").when(volumeApiServiceImpl).getStoragePoolTags(storagePoolMock);
+
+        boolean result = 
volumeApiServiceImpl.doesTargetStorageSupportNewDiskOffering(storagePoolMock, 
diskOfferingVoMock);
+
+        Assert.assertFalse(result);
+    }
+
+    @Test
+    public void 
doesTargetStorageSupportNewDiskOfferingTestDiskOfferingTagsIsSubSetOfStorageTags()
 {
 
 Review comment:
   I think, would be good if we add the equal case as well. Like 
DiskOfferingTag('A') and StoragePoolTag('A'). Should return true.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to