blob: 9a801bd334afc843b01fca04fb97325013dc72c5 [file] [log] [blame]
DavidPurcell663aedf2017-01-03 10:01:14 -05001# Copyright 2010-2011 OpenStack Foundation
2# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
DavidPurcellb25f93d2017-01-27 12:46:27 -05003# Copyright 2017 AT&T Corporation.
DavidPurcell663aedf2017-01-03 10:01:14 -05004#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
Sergey Vilgelm19e3bec2019-01-07 11:59:41 -060017from tempest.tests import base
DavidPurcell663aedf2017-01-03 10:01:14 -050018
19
Sergey Vilgelm19e3bec2019-01-07 11:59:41 -060020class TestCase(base.TestCase):
DavidPurcell663aedf2017-01-03 10:01:14 -050021
22 """Test case base class for all unit tests."""
Sergey Vilgelm19e3bec2019-01-07 11:59:41 -060023
24 def get_all_needed_roles(self, roles):
25 role_inferences_mapping = {
26 "admin": {"member", "reader"},
27 "member": {"reader"}
28 }
29 res = set(r.lower() for r in roles)
30 for role in res.copy():
31 res.update(role_inferences_mapping.get(role, set()))
32 return list(res)