@@ -1651,47 +1651,53 @@ def test_share_paid_bursting(self, **kwargs):
1651
1651
premium_storage_file_account_name = kwargs .pop ("premium_storage_file_account_name" )
1652
1652
premium_storage_file_account_key = kwargs .pop ("premium_storage_file_account_key" )
1653
1653
1654
- # Arrange
1655
- self ._setup (premium_storage_file_account_name , premium_storage_file_account_key )
1656
- mibps = 10340
1657
- iops = 102400
1658
-
1659
- # Act / Assert
1660
- share = self ._create_share (
1661
- paid_bursting_enabled = True ,
1662
- paid_bursting_bandwidth_mibps = 5000 ,
1663
- paid_bursting_iops = 1000
1664
- )
1665
- share_props = share .get_share_properties ()
1666
- assert share_props .paid_bursting_enabled
1667
- assert share_props .paid_bursting_bandwidth_mibps == 5000
1668
- assert share_props .paid_bursting_iops == 1000
1669
-
1670
- share .set_share_properties (
1671
- root_squash = "NoRootSquash" ,
1672
- paid_bursting_enabled = True ,
1673
- paid_bursting_bandwidth_mibps = mibps ,
1674
- paid_bursting_iops = iops
1675
- )
1676
- share_props = share .get_share_properties ()
1677
- share_name = share_props .name
1678
- assert share_props .paid_bursting_enabled
1679
- assert share_props .paid_bursting_bandwidth_mibps == mibps
1680
- assert share_props .paid_bursting_iops == iops
1681
-
1682
- shares = list (self .fsc .list_shares ())
1683
- assert shares is not None
1684
- assert len (shares ) >= 1
1685
- for share in shares :
1686
- if share .name == share_name :
1687
- assert share is not None
1688
- assert share .paid_bursting_enabled
1689
- assert share .paid_bursting_bandwidth_mibps == mibps
1690
- assert share .paid_bursting_iops == iops
1691
- break
1692
- raise ValueError ("Share with modified bursting values not found." )
1693
-
1694
- self ._delete_shares ()
1654
+ try :
1655
+ # Arrange
1656
+ self ._setup (premium_storage_file_account_name , premium_storage_file_account_key )
1657
+ mibps = 10340
1658
+ iops = 102400
1659
+
1660
+ # Act / Assert
1661
+ share = self ._create_share (
1662
+ paid_bursting_enabled = True ,
1663
+ paid_bursting_bandwidth_mibps = 5000 ,
1664
+ paid_bursting_iops = 1000
1665
+ )
1666
+ share_props = share .get_share_properties ()
1667
+ assert share_props .paid_bursting_enabled
1668
+ assert share_props .paid_bursting_bandwidth_mibps == 5000
1669
+ assert share_props .paid_bursting_iops == 1000
1670
+
1671
+ share .set_share_properties (
1672
+ root_squash = "NoRootSquash" ,
1673
+ paid_bursting_enabled = True ,
1674
+ paid_bursting_bandwidth_mibps = mibps ,
1675
+ paid_bursting_iops = iops
1676
+ )
1677
+ share_props = share .get_share_properties ()
1678
+ share_name = share_props .name
1679
+ assert share_props .paid_bursting_enabled
1680
+ assert share_props .paid_bursting_bandwidth_mibps == mibps
1681
+ assert share_props .paid_bursting_iops == iops
1682
+
1683
+ shares = list (self .fsc .list_shares ())
1684
+ assert shares is not None
1685
+ assert len (shares ) >= 1
1686
+
1687
+ share_exists = False
1688
+ for share in shares :
1689
+ if share .name == share_name :
1690
+ assert share is not None
1691
+ assert share .paid_bursting_enabled
1692
+ assert share .paid_bursting_bandwidth_mibps == mibps
1693
+ assert share .paid_bursting_iops == iops
1694
+ share_exists = True
1695
+ break
1696
+
1697
+ if not share_exists :
1698
+ raise ValueError ("Share with modified bursting values not found." )
1699
+ finally :
1700
+ self ._delete_shares ()
1695
1701
1696
1702
@FileSharePreparer ()
1697
1703
@recorded_by_proxy
0 commit comments