root | d8ab63c | 2017-07-25 07:19:31 +0000 | [diff] [blame] | 1 | |
| 2 | from runtest import conditions |
| 3 | from runtest.tempest_sections import base_section |
| 4 | |
| 5 | class Auth(base_section.BaseSection): |
| 6 | |
| 7 | name = "auth" |
| 8 | options = [ |
| 9 | 'admin_domain_name', |
| 10 | 'admin_password', |
| 11 | 'admin_project_name', |
| 12 | 'admin_username', |
| 13 | 'create_isolated_networks', |
| 14 | 'default_credentials_domain_name', |
| 15 | 'tempest_roles', |
| 16 | 'test_accounts_file', |
| 17 | 'use_dynamic_credentials', |
| 18 | ] |
| 19 | |
| 20 | |
| 21 | @property |
| 22 | def admin_domain_name(self): |
sgarbuz | d24e12f | 2018-02-27 18:34:00 +0200 | [diff] [blame] | 23 | return 'Default' |
root | d8ab63c | 2017-07-25 07:19:31 +0000 | [diff] [blame] | 24 | |
| 25 | @property |
| 26 | def admin_password(self): |
| 27 | c = conditions.BaseRule('keystone.server.enabled', 'eq', True) |
| 28 | return self.get_item_when_condition_match( |
| 29 | 'keystone.server.admin_password', c) |
| 30 | |
| 31 | @property |
| 32 | def admin_project_name(self): |
| 33 | c = conditions.BaseRule('keystone.server.enabled', 'eq', True) |
| 34 | return self.get_item_when_condition_match( |
| 35 | 'keystone.server.admin_tenant', c) |
| 36 | |
| 37 | @property |
| 38 | def admin_username(self): |
| 39 | c = conditions.BaseRule('keystone.server.enabled', 'eq', True) |
| 40 | return self.get_item_when_condition_match( |
| 41 | 'keystone.server.admin_name', c) |
| 42 | |
| 43 | @property |
| 44 | def create_isolated_networks(self): |
| 45 | pass |
| 46 | |
| 47 | @property |
| 48 | def default_credentials_domain_name(self): |
| 49 | pass |
| 50 | |
| 51 | @property |
| 52 | def tempest_roles(self): |
sandriichenko | 59a489c | 2018-04-02 11:14:26 +0300 | [diff] [blame] | 53 | # Barbican may be enabled in several components like nova,glance,cinder. |
| 54 | # Look for nova only as it is core openstack service and present on each installation. |
| 55 | # Assume if barbican is enabled in nova, its integration enabled globally. |
Vasyl Saienko | b11fe5f | 2018-11-08 07:56:54 +0000 | [diff] [blame] | 56 | |
ibumarskov | c53f114 | 2018-11-08 15:14:16 +0400 | [diff] [blame] | 57 | roles = [] |
| 58 | contrail_enabled = conditions.BaseRule('*.opencontrail.control.enabled', |
| 59 | 'eq', True, multiple='any') |
| 60 | if contrail_enabled.check(self.pillar): |
| 61 | roles.append("admin") |
sandriichenko | 59a489c | 2018-04-02 11:14:26 +0300 | [diff] [blame] | 62 | c = conditions.BaseRule('nova.controller.enabled', 'eq', True) |
| 63 | if self.get_item_when_condition_match('nova.controller.barbican.enabled', c): |
ibumarskov | c53f114 | 2018-11-08 15:14:16 +0400 | [diff] [blame] | 64 | roles.append("creator") |
| 65 | if roles: |
| 66 | return ', '.join(roles) |
root | d8ab63c | 2017-07-25 07:19:31 +0000 | [diff] [blame] | 67 | |
| 68 | @property |
| 69 | def test_accounts_file(self): |
| 70 | pass |
| 71 | |
| 72 | @property |
| 73 | def use_dynamic_credentials(self): |
Mykyta Karpin | 576db5f | 2018-05-18 09:14:12 +0000 | [diff] [blame] | 74 | pass |
root | d8ab63c | 2017-07-25 07:19:31 +0000 | [diff] [blame] | 75 | |