Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 1 | # Copyright 2014 Mirantis Inc. |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
| 16 | from tempest import clients |
Sam Wan | c7b7f1f | 2015-11-25 00:22:28 -0500 | [diff] [blame] | 17 | from tempest.common import credentials_factory as common_creds |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 18 | |
| 19 | from manila_tempest_tests.services.share.json import shares_client |
Clinton Knight | e5c8f09 | 2015-08-27 15:00:23 -0400 | [diff] [blame] | 20 | from manila_tempest_tests.services.share.v2.json import shares_client \ |
| 21 | as shares_v2_client |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 22 | |
| 23 | |
| 24 | class Manager(clients.Manager): |
Sam Wan | c7b7f1f | 2015-11-25 00:22:28 -0500 | [diff] [blame] | 25 | def __init__( |
| 26 | self, |
| 27 | credentials=common_creds.get_configured_credentials('user'), |
| 28 | service=None): |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 29 | super(Manager, self).__init__(credentials, service) |
| 30 | self.shares_client = shares_client.SharesClient(self.auth_provider) |
Clinton Knight | e5c8f09 | 2015-08-27 15:00:23 -0400 | [diff] [blame] | 31 | self.shares_v2_client = shares_v2_client.SharesV2Client( |
| 32 | self.auth_provider) |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 33 | |
| 34 | |
| 35 | class AltManager(Manager): |
| 36 | def __init__(self, service=None): |
| 37 | super(AltManager, self).__init__( |
Sam Wan | c7b7f1f | 2015-11-25 00:22:28 -0500 | [diff] [blame] | 38 | common_creds.get_configured_credentials('alt_user'), service) |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 39 | |
| 40 | |
| 41 | class AdminManager(Manager): |
| 42 | def __init__(self, service=None): |
| 43 | super(AdminManager, self).__init__( |
Sam Wan | c7b7f1f | 2015-11-25 00:22:28 -0500 | [diff] [blame] | 44 | common_creds.get_configured_credentials('identity_admin'), |
Marc Koderer | 0abc93b | 2015-07-15 09:18:35 +0200 | [diff] [blame] | 45 | service) |