Add Show ' os-attach-interfaces ' policy tests
Change-Id: Ic6b2b8530b7f736a97270c1d278f2563719d0e53
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
index 9ce4ba0..f15dd78 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
@@ -571,6 +571,20 @@
self.interfaces_client.list_interfaces(
self.server['id'])['interfaceAttachments']
+ @decorators.idempotent_id('1b9cf7db-dc50-48a2-8eb9-8c25af5e934a')
+ @testtools.skipUnless(CONF.compute_feature_enabled.interface_attach,
+ "Interface attachment is not available.")
+ @utils.requires_ext(extension='os-attach-interfaces', service='compute')
+ @rbac_rule_validation.action(
+ service="nova",
+ rule="os_compute_api:os-attach-interfaces")
+ def test_show_interface(self):
+ """Test show interfaces, part of os-attach-interfaces."""
+ interface = self._attach_interface_to_server()
+ self.rbac_utils.switch_role(self, toggle_rbac_role=True)
+ self.interfaces_client.show_interface(
+ self.server['id'], interface['port_id'])['interfaceAttachment']
+
@testtools.skipUnless(CONF.compute_feature_enabled.interface_attach,
"Interface attachment is not available.")
@utils.requires_ext(extension='os-attach-interfaces', service='compute')