Skip to content

Commit aad9b8a

Browse files
author
sailajamada
committed
Added global config validation test
1 parent 8840d90 commit aad9b8a

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

test/integration/component/test_browse_volumes.py

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,36 @@ def browse_upload_volume(self):
203203

204204
return(getuploadparamsresponce)
205205

206+
def validate_max_vol_size(self,up_vol,volumestate):
207+
208+
list_volume_response = Volume.list(
209+
self.apiclient,
210+
id=up_vol.id
211+
)
212+
self.assertNotEqual(
213+
list_volume_response,
214+
None,
215+
"Check if volume exists in ListVolumes"
216+
)
217+
218+
self.assertEqual(
219+
list_volume_response[0].state,
220+
volumestate,
221+
"Check volume state in ListVolumes"
222+
)
223+
224+
config = Configurations.list(
225+
self.apiclient,
226+
name='storage.max.volume.upload.size'
227+
)
228+
229+
max_size = int(config[0].value)
230+
231+
if int(list_volume_response[0].size) > max_size:
232+
self.fail("Global Config storage.max.volume.upload.size is not considered with Browser Based Upload volumes")
233+
234+
235+
206236
def browse_upload_volume_with_md5(self):
207237
cmd = getUploadParamsForVolume.getUploadParamsForVolumeCmd()
208238
cmd.zoneid = self.zone.id
@@ -1407,7 +1437,7 @@ def test_01_Browser_volume_Life_cycle_tpath(self):
14071437
self.debug("========================= Test 15: Recover destroyed VM which has Uploaded volumes attached========================= ")
14081438

14091439
self.recover_destroyed_vm(vm4details)
1410-
self.destroy_vm(vm4details)
1440+
self.expunge_vm(vm4details)
14111441

14121442
self.deletevolume(newvolumetodestoy_VM.id)
14131443

@@ -1434,6 +1464,7 @@ def test_01_Browser_volume_Life_cycle_tpath(self):
14341464
self.debug("========================= Test 19: Create template from Backup Snapshot of attached uploaded volume========================= ")
14351465
self.volume_snapshot_template(snapshotdetails)
14361466

1467+
self.detach_volume(vm6details,browseup_vol6.id)
14371468
self.deletevolume(browseup_vol6.id)
14381469
self.expunge_vm(vm6details)
14391470

@@ -1523,6 +1554,22 @@ def test_02_SSVM_Life_Cycle_With_Browser_Volume_TPath(self):
15231554
return
15241555

15251556

1557+
@attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true")
1558+
def test_03_Browser_Upload_Volume_Global_Config_TPath(self):
1559+
"""
1560+
Test Browser_Upload_Volume_Global_Config limits
1561+
"""
1562+
try:
1563+
1564+
self.debug("========================= Test 1 Validate Storage.max.upload.size ========================= ")
1565+
globalconfig_browse_up_vol=self.browse_upload_volume()
1566+
self.validate_max_vol_size(globalconfig_browse_up_vol,"Uploaded")
1567+
1568+
except Exception as e:
1569+
self.fail("Exception occurred : %s" % e)
1570+
return
1571+
1572+
15261573
@classmethod
15271574
def tearDownClass(self):
15281575
try:

0 commit comments

Comments
 (0)