Skip to content

Commit 07c8b40

Browse files
author
Glover, Rene (rg9975)
committed
fix storagemotion test case issue
1 parent 07544c7 commit 07c8b40

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

engine/storage/datamotion/src/test/java/org/apache/cloudstack/storage/motion/KvmNonManagedStorageSystemDataMotionTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -482,17 +482,19 @@ public void testVerifyLiveMigrationMapForKVM() {
482482

483483
@Test
484484
public void testVerifyLiveMigrationMapForKVMManagedFiberChannelAllowed() {
485-
when(pool1.isManaged()).thenReturn(true);
486-
when(pool2.isManaged()).thenReturn(true);
487-
when(pool1.getPoolType()).thenReturn(Storage.StoragePoolType.FiberChannel);
488-
when(pool2.getPoolType()).thenReturn(Storage.StoragePoolType.FiberChannel);
489-
when(pool1.getId()).thenReturn(POOL_1_ID);
490-
when(pool2.getId()).thenReturn(POOL_2_ID);
491-
when(volumeInfo1.getAttachedVM()).thenReturn(attachedVm);
492-
when(volumeInfo2.getAttachedVM()).thenReturn(attachedVm);
485+
lenient().when(pool1.isManaged()).thenReturn(true);
486+
lenient().when(pool2.isManaged()).thenReturn(true);
487+
lenient().when(pool1.getPoolType()).thenReturn(Storage.StoragePoolType.FiberChannel);
488+
lenient().when(pool2.getPoolType()).thenReturn(Storage.StoragePoolType.FiberChannel);
489+
lenient().when(pool1.getId()).thenReturn(POOL_1_ID);
490+
lenient().when(pool2.getId()).thenReturn(POOL_2_ID);
491+
lenient().when(volumeInfo1.getAttachedVM()).thenReturn(attachedVm);
493492
when(attachedVm.getState()).thenReturn(com.cloud.vm.VirtualMachine.State.Running);
494493

495-
kvmNonManagedStorageDataMotionStrategy.verifyLiveMigrationForKVM(migrationMap);
494+
Map<VolumeInfo, DataStore> fiberChannelMigrationMap = new HashMap<>();
495+
fiberChannelMigrationMap.put(volumeInfo1, dataStore2);
496+
497+
kvmNonManagedStorageDataMotionStrategy.verifyLiveMigrationForKVM(fiberChannelMigrationMap);
496498
}
497499

498500
@Test(expected = CloudRuntimeException.class)

0 commit comments

Comments
 (0)