summaryrefslogtreecommitdiff
path: root/unit_tests
diff options
context:
space:
mode:
authorFrode Nordahl <frode.nordahl@canonical.com>2019-01-28 16:39:57 +0100
committerFrode Nordahl <frode.nordahl@canonical.com>2019-01-28 16:43:11 +0100
commit0ec113afb7a553e6065b60ea8e9d6ac3ea4b2241 (patch)
treef98bd57f13b85d1ba7c5c8e5124a2e14bf9eda20 /unit_tests
parent1c92403c757731cbea97f9e2c7632e4ae050fffe (diff)
Add support for passing optional ``requested_roles`` attributeHEADmaster
When passing ``requested_roles`` down the ``identity-service`` relation the Keystone charm will create the listed roles for you. Useful for charm authors implementing charms with specific role requirements. Change-Id: I7c1eedb1e78ffc53ac3e0df81f6b52358dd8dfa5 Closes-Bug: #1813602
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: Chris MacNaughton (icey) <chris.macnaughton@canonical.com> Workflow+1: Chris MacNaughton (icey) <chris.macnaughton@canonical.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 29 Jan 2019 08:03:55 +0000 Reviewed-on: https://review.openstack.org/633532 Project: openstack/charm-interface-keystone Branch: refs/heads/master
Diffstat (limited to 'unit_tests')
-rw-r--r--unit_tests/test_requires.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/unit_tests/test_requires.py b/unit_tests/test_requires.py
index 7fb63d5..76d14f7 100644
--- a/unit_tests/test_requires.py
+++ b/unit_tests/test_requires.py
@@ -224,6 +224,22 @@ class TestKeystoneRequires(unittest.TestCase):
224 self.set_local.assert_called_once_with(**result) 224 self.set_local.assert_called_once_with(**result)
225 self.set_remote.assert_called_once_with(**result) 225 self.set_remote.assert_called_once_with(**result)
226 226
227 def test_register_endpoints_requested_roles(self):
228 self.patch_kr('set_local')
229 self.patch_kr('set_remote')
230 self.kr.register_endpoints('s', 'r', 'p_url', 'i_url', 'a_url',
231 requested_roles=['role1', 'role2'])
232 result = {
233 'service': 's',
234 'public_url': 'p_url',
235 'internal_url': 'i_url',
236 'admin_url': 'a_url',
237 'region': 'r',
238 'requested_roles': 'role1,role2',
239 }
240 self.set_local.assert_called_once_with(**result)
241 self.set_remote.assert_called_once_with(**result)
242
227 def test_request_keystone_endpoint_information(self): 243 def test_request_keystone_endpoint_information(self):
228 self.patch_kr('set_local') 244 self.patch_kr('set_local')
229 self.patch_kr('set_remote') 245 self.patch_kr('set_remote')