mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
[marvin, VMware] Fix repeated test failures observed on 'main' branch (#5992)
* [marvin, VMware] Fix test_06_disk_offering_strictness_false observed on 'main' branch * Fix test * update config only if false * reset full clone setting to original values
This commit is contained in:
parent
59dda5b129
commit
ee947e1310
@ -27,6 +27,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
@ -1685,7 +1686,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||||||
|
|
||||||
DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
|
DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
|
||||||
DiskProfile diskProfile = new DiskProfile(volume, diskOffering, hypervisorType);
|
DiskProfile diskProfile = new DiskProfile(volume, diskOffering, hypervisorType);
|
||||||
if (volume.getDiskOfferingId() != diskOfferingId) {
|
if (!Objects.equals(volume.getDiskOfferingId(), diskOfferingId)) {
|
||||||
diskProfile.setSize(newSize);
|
diskProfile.setSize(newSize);
|
||||||
diskProfile.setMinIops(newMinIops);
|
diskProfile.setMinIops(newMinIops);
|
||||||
diskProfile.setMaxIops(newMaxIops);
|
diskProfile.setMaxIops(newMaxIops);
|
||||||
|
|||||||
@ -1697,10 +1697,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||||||
boolean volumeResizeRequired = false;
|
boolean volumeResizeRequired = false;
|
||||||
|
|
||||||
// VALIDATIONS
|
// VALIDATIONS
|
||||||
Long updateNewSize[] = {newSize};
|
Long[] updateNewSize = {newSize};
|
||||||
Long updateNewMinIops[] = {newMinIops};
|
Long[] updateNewMinIops = {newMinIops};
|
||||||
Long updateNewMaxIops[] = {newMaxIops};
|
Long[] updateNewMaxIops = {newMaxIops};
|
||||||
Integer updateNewHypervisorSnapshotReserve[] = {newHypervisorSnapshotReserve};
|
Integer[] updateNewHypervisorSnapshotReserve = {newHypervisorSnapshotReserve};
|
||||||
validateVolumeResizeWithNewDiskOfferingAndLoad(volume, existingDiskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
|
validateVolumeResizeWithNewDiskOfferingAndLoad(volume, existingDiskOffering, newDiskOffering, updateNewSize, updateNewMinIops, updateNewMaxIops, updateNewHypervisorSnapshotReserve);
|
||||||
newSize = updateNewSize[0];
|
newSize = updateNewSize[0];
|
||||||
newMinIops = updateNewMinIops[0];
|
newMinIops = updateNewMinIops[0];
|
||||||
|
|||||||
@ -25,8 +25,10 @@ from marvin.lib.utils import (isAlmostEqual,
|
|||||||
cleanup_resources,
|
cleanup_resources,
|
||||||
random_gen)
|
random_gen)
|
||||||
from marvin.lib.base import (ServiceOffering,
|
from marvin.lib.base import (ServiceOffering,
|
||||||
|
Configurations,
|
||||||
DiskOffering,
|
DiskOffering,
|
||||||
Account,
|
Account,
|
||||||
|
StoragePool,
|
||||||
VirtualMachine)
|
VirtualMachine)
|
||||||
from marvin.lib.common import (list_service_offering,
|
from marvin.lib.common import (list_service_offering,
|
||||||
list_virtual_machines,
|
list_virtual_machines,
|
||||||
@ -715,6 +717,16 @@ class TestServiceOfferings(cloudstackTestCase):
|
|||||||
|
|
||||||
if self.hypervisor.lower() == "lxc":
|
if self.hypervisor.lower() == "lxc":
|
||||||
self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
|
self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
|
||||||
|
self.storeCloneValues = {}
|
||||||
|
if self.hypervisor.lower() == "vmware":
|
||||||
|
self.fullClone = Configurations.list(self.apiclient, name="vmware.create.full.clone")
|
||||||
|
assert isinstance(self.fullClone, list), "Config list not retrieved for vmware.create.full.clone"
|
||||||
|
allStoragePools = StoragePool.list(
|
||||||
|
self.apiclient
|
||||||
|
)
|
||||||
|
for pool in allStoragePools:
|
||||||
|
self.storeCloneValues[pool.id] = Configurations.list(self.apiclient, name="vmware.create.full.clone", storageid=pool.id)[0].value.lower()
|
||||||
|
self.updateVmwareCreateFullCloneSetting(False)
|
||||||
|
|
||||||
offering_data = {
|
offering_data = {
|
||||||
'displaytext': 'TestDiskOfferingStrictnessFalse',
|
'displaytext': 'TestDiskOfferingStrictnessFalse',
|
||||||
@ -811,8 +823,37 @@ class TestServiceOfferings(cloudstackTestCase):
|
|||||||
"Check service offering of the VM"
|
"Check service offering of the VM"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.hypervisor.lower() == "vmware":
|
||||||
|
self.updateVmwareCreateFullCloneSetting(True)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def updateVmwareCreateFullCloneSetting(self, tearDown):
|
||||||
|
if not tearDown:
|
||||||
|
Configurations.update(self.apiclient,
|
||||||
|
"vmware.create.full.clone",
|
||||||
|
"true")
|
||||||
|
allStoragePools = StoragePool.list(
|
||||||
|
self.apiclient
|
||||||
|
)
|
||||||
|
for pool in allStoragePools:
|
||||||
|
Configurations.update(self.apiclient,
|
||||||
|
storageid=pool.id,
|
||||||
|
name="vmware.create.full.clone",
|
||||||
|
value="true")
|
||||||
|
else:
|
||||||
|
Configurations.update(self.apiclient,
|
||||||
|
"vmware.create.full.clone",
|
||||||
|
self.fullClone[0].value.lower())
|
||||||
|
allStoragePools = StoragePool.list(
|
||||||
|
self.apiclient
|
||||||
|
)
|
||||||
|
for pool in allStoragePools:
|
||||||
|
Configurations.update(self.apiclient,
|
||||||
|
storageid=pool.id,
|
||||||
|
name="vmware.create.full.clone",
|
||||||
|
value=self.storeCloneValues[pool.id])
|
||||||
|
|
||||||
class TestCpuCapServiceOfferings(cloudstackTestCase):
|
class TestCpuCapServiceOfferings(cloudstackTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user