blob: 48f67d2429419cba98dc63594698641191e68de6 [file] [log] [blame]
Andrea Frittoli7d707a52014-04-06 11:46:32 +01001# Copyright 2014 Hewlett-Packard Development Company, L.P.
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
16from tempest import auth
17
18
19class FakeCredentials(auth.Credentials):
20
21 def is_valid(self):
22 return True
23
24
25class FakeKeystoneV2Credentials(auth.KeystoneV2Credentials):
26
27 def __init__(self):
28 creds = dict(
29 username='fake_username',
30 password='fake_password',
31 tenant_name='fake_tenant_name'
32 )
33 super(FakeKeystoneV2Credentials, self).__init__(**creds)
Andrea Frittolib1b04bb2014-04-06 11:57:07 +010034
35
36class FakeKeystoneV3Credentials(auth.KeystoneV3Credentials):
37 """
38 Fake credentials suitable for the Keystone Identity V3 API
39 """
40
41 def __init__(self):
42 creds = dict(
43 username='fake_username',
44 password='fake_password',
45 user_domain_name='fake_domain_name',
46 project_name='fake_tenant_name'
47 )
48 super(FakeKeystoneV3Credentials, self).__init__(**creds)
49
50
51class FakeKeystoneV3DomainCredentials(auth.KeystoneV3Credentials):
52 """
53 Fake credentials suitable for the Keystone Identity V3 API, with no scope
54 """
55
56 def __init__(self):
57 creds = dict(
58 username='fake_username',
59 password='fake_password',
60 user_domain_name='fake_domain_name'
61 )
62 super(FakeKeystoneV3DomainCredentials, self).__init__(**creds)