commit | 912b9fe9c50d43a3bc1cadbca80b6b5f7f784a80 | [log] [tgz] |
---|---|---|
author | rajat29 <rajat.sharma@nectechnologies.in> | Fri Oct 27 13:26:17 2017 +0530 |
committer | rajat29 <rajat.sharma@nectechnologies.in> | Wed Nov 08 09:51:38 2017 +0530 |
tree | 8aaa88463b5e2b3bf1502d55ac0f1b7f17661aed | |
parent | 21db8fca4a06b8bf799acc2fa0c03672242827d9 [diff] |
Add Show ' update_backup ' policy tests Adding missing RBAC test for volume backup update in policy file[1], api-ref[2] [1]https://github.com/openstack/patrole/blob/master/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py [2]https://github.com/openstack/cinder/blob/master/cinder/policies/backups.py#L80 Change-Id: I1189f53f32b5008200dbf2b67e349577973065df
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py index 7ca3d9f..b6de3c2 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py
@@ -201,3 +201,31 @@ if expected_attr not in body: raise rbac_exceptions.RbacMalformedResponse( attribute=expected_attr) + + +class VolumesBackupsV39RbacTest(rbac_base.BaseVolumeRbacTest): + _api_version = 3 + min_microversion = '3.9' + max_microversion = 'latest' + + @classmethod + def skip_checks(cls): + super(VolumesBackupsV39RbacTest, cls).skip_checks() + if not CONF.volume_feature_enabled.backup: + raise cls.skipException("Cinder backup feature disabled") + + @decorators.attr(type='slow') + @decorators.idempotent_id('b45b0e98-6eb8-4c62-aa53-0f8c7c09faa6') + @rbac_rule_validation.action( + service="cinder", + rule="backup:update") + def test_backup_update(self): + volume = self.create_volume() + backup = self.create_backup(volume_id=volume['id']) + update_kwargs = { + 'name': data_utils.rand_name(self.__class__.__name__ + '-Backup'), + 'description': data_utils.rand_name("volume-backup-description") + } + self.rbac_utils.switch_role(self, toggle_rbac_role=True) + self.backups_client.update_backup(backup['id'], + **update_kwargs)