Cover more 'floating ips' APIs for policy tests
Change-Id: Ide1ed1dab738a273b6776f52378db9172bc88f08
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
index 290e523..8ab5a51 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
@@ -15,6 +15,7 @@
from tempest.common import utils
from tempest import config
+from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from patrole_tempest_plugin import rbac_rule_validation
@@ -47,3 +48,39 @@
def test_list_floating_ips(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.floating_ips_client.list_floating_ips()['floating_ips']
+
+ @decorators.idempotent_id('bebe52b3-5269-4e72-80c8-5a4a39c3bfa6')
+ @rbac_rule_validation.action(
+ service="nova",
+ rule="os_compute_api:os-floating-ips")
+ def test_show_floating_ip(self):
+ body = self.floating_ips_client.create_floating_ip(
+ pool=CONF.network.floating_network_name)['floating_ip']
+ self.addCleanup(
+ self.floating_ips_client.delete_floating_ip, body['id'])
+ self.rbac_utils.switch_role(self, toggle_rbac_role=True)
+ self.floating_ips_client.show_floating_ip(body['id'])['floating_ip']
+
+ @decorators.idempotent_id('2bfb8745-c329-4ee9-95f6-c165a1989dbf')
+ @rbac_rule_validation.action(
+ service="nova",
+ rule="os_compute_api:os-floating-ips")
+ def test_create_floating_ips(self):
+ self.rbac_utils.switch_role(self, toggle_rbac_role=True)
+ body = self.floating_ips_client.create_floating_ip(
+ pool=CONF.network.floating_network_name)['floating_ip']
+ self.addCleanup(
+ self.floating_ips_client.delete_floating_ip, body['id'])
+
+ @decorators.idempotent_id('d3028373-5027-4e7a-b761-01c515403ecb')
+ @rbac_rule_validation.action(
+ service="nova",
+ rule="os_compute_api:os-floating-ips")
+ def test_delete_floating_ip(self):
+ body = self.floating_ips_client.create_floating_ip(
+ pool=CONF.network.floating_network_name)['floating_ip']
+ self.addCleanup(
+ test_utils.call_and_ignore_notfound_exc,
+ self.floating_ips_client.delete_floating_ip, body['id'])
+ self.rbac_utils.switch_role(self, toggle_rbac_role=True)
+ self.floating_ips_client.delete_floating_ip(body['id'])