Skip to content

Commit b343252

Browse files
abh1sarclaude
andcommitted
sharedfs: drop duplicate skip-hypervisor test after 4.22 merge
The 4.22 merge brought in testDeploySharedFSContinuesWhenTemplateIsMissingForNonLastHypervisor from PR #13830, which covers the same skip-hypervisor-without-template path as testDeploySharedFSSkipsHypervisorWithoutTemplate. It was written against getSupportedHypervisorTypes(zoneId, false, null); deploySharedFSVM() now passes forSystemVm=true, so its stubs were never used and MockitoJUnitRunner failed the class with UnnecessaryStubbingException. Its External hypervisor scenario is also unreachable now, since forSystemVm=true filters External out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 3e79c70 commit b343252

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

plugins/storage/sharedfs/storagevm/src/test/java/org/apache/cloudstack/storage/sharedfs/lifecycle/StorageVmSharedFSLifeCycleTest.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -277,46 +277,6 @@ public void testDeploySharedFS() throws ResourceUnavailableException, Insufficie
277277
Assert.assertEquals(Optional.ofNullable(result.second()), Optional.ofNullable(s_vmId));
278278
}
279279

280-
@Test
281-
public void testDeploySharedFSContinuesWhenTemplateIsMissingForNonLastHypervisor() throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException, IOException, OperationTimedoutException {
282-
SharedFS sharedFS = prepareDeploySharedFS();
283-
when(resourceMgr.getSupportedHypervisorTypes(s_zoneId, false, null)).thenReturn(new ArrayList<>(List.of(Hypervisor.HypervisorType.External, Hypervisor.HypervisorType.KVM)) {
284-
@Override
285-
public Hypervisor.HypervisorType set(int index, Hypervisor.HypervisorType element) {
286-
// Keep the test order stable while exercising the production shuffle call.
287-
return get(index);
288-
}
289-
});
290-
when(templateDao.findSystemVMReadyTemplate(s_zoneId, Hypervisor.HypervisorType.External, ResourceManager.SystemVmPreferredArchitecture.defaultValue())).thenReturn(null);
291-
292-
Account owner = mock(Account.class);
293-
when(owner.getId()).thenReturn(s_ownerId);
294-
when(accountMgr.getActiveAccountById(s_ownerId)).thenReturn(owner);
295-
296-
UserVm vm = mock(UserVm.class);
297-
when(vm.getId()).thenReturn(s_vmId);
298-
when(userVmService.createAdvancedVirtualMachine(
299-
any(DataCenter.class), any(ServiceOffering.class), any(VirtualMachineTemplate.class), anyList(), any(Account.class), anyString(),
300-
anyString(), anyLong(), anyLong(), any(), isNull(), any(Hypervisor.HypervisorType.class), any(BaseCmd.HTTPMethod.class), anyString(),
301-
isNull(), isNull(), anyList(), isNull(), any(Network.IpAddresses.class), isNull(), isNull(), isNull(),
302-
anyMap(), isNull(), isNull(), isNull(), isNull(),
303-
anyBoolean(), anyString(), isNull(), isNull(), isNull())).thenReturn(vm);
304-
305-
VolumeVO rootVol = mock(VolumeVO.class);
306-
when(rootVol.getVolumeType()).thenReturn(Volume.Type.ROOT);
307-
when(rootVol.getName()).thenReturn("ROOT-1");
308-
VolumeVO dataVol = mock(VolumeVO.class);
309-
when(dataVol.getId()).thenReturn(s_volumeId);
310-
when(dataVol.getName()).thenReturn("DATA-1");
311-
when(dataVol.getVolumeType()).thenReturn(Volume.Type.DATADISK);
312-
when(volumeDao.findByInstance(s_vmId)).thenReturn(List.of(rootVol, dataVol));
313-
314-
Pair<Long, Long> result = lifeCycle.deploySharedFS(sharedFS, s_networkId, s_diskOfferingId, s_size, s_minIops, s_maxIops);
315-
316-
Assert.assertEquals(Optional.ofNullable(result.first()), Optional.ofNullable(s_volumeId));
317-
Assert.assertEquals(Optional.ofNullable(result.second()), Optional.ofNullable(s_vmId));
318-
}
319-
320280
@Test(expected = CloudRuntimeException.class)
321281
public void testDeploySharedFSHypervisorNotFound() throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException, IOException, OperationTimedoutException {
322282
SharedFS sharedFS = mock(SharedFS.class);

0 commit comments

Comments
 (0)