~ubuntu-branches/debian/sid/keystone/sid

« back to all changes in this revision

Viewing changes to tests/default_fixtures.py

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2013-05-10 10:22:18 UTC
  • mfrom: (1.2.1) (26.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130510102218-7hph1420gz5jsyr7
Tags: 2013.1.1-2
* Uploading to unstable.
* New upstream release:
  - Fixes CVE-2013-2059: Keystone tokens not immediately invalidated when
  user is deleted [OSSA 2013-011] (Closes: #707598).
* Also installs httpd/keystone.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# License for the specific language governing permissions and limitations
15
15
# under the License.
16
16
 
 
17
# NOTE(dolph): please try to avoid additional fixtures if possible; test suite
 
18
#              performance may be negatively affected.
 
19
 
 
20
from keystone import config
 
21
 
 
22
 
 
23
CONF = config.CONF
 
24
 
 
25
 
 
26
DEFAULT_DOMAIN_ID = config.CONF.identity.default_domain_id
 
27
 
 
28
 
17
29
TENANTS = [
18
 
    {'id': 'bar', 'name': 'BAR'},
19
 
    {'id': 'baz', 'name': 'BAZ'},
20
 
    {'id': 'tenent4add', 'name': 'tenant4add'},
21
 
    ]
 
30
    {
 
31
        'id': 'bar',
 
32
        'name': 'BAR',
 
33
        'domain_id': DEFAULT_DOMAIN_ID,
 
34
        'description': 'description',
 
35
        'enabled': True,
 
36
    }, {
 
37
        'id': 'baz',
 
38
        'name': 'BAZ',
 
39
        'domain_id': DEFAULT_DOMAIN_ID,
 
40
        'description': 'description',
 
41
        'enabled': True,
 
42
    }, {
 
43
        'id': 'mtu',
 
44
        'name': 'MTU',
 
45
        'description': 'description',
 
46
        'enabled': True,
 
47
        'domain_id': DEFAULT_DOMAIN_ID
 
48
    }
 
49
]
22
50
 
23
51
# NOTE(ja): a role of keystone_admin and attribute "is_admin" is done in setUp
24
52
USERS = [
25
 
    {'id': 'foo', 'name': 'FOO', 'password': 'foo2', 'tenants': ['bar']},
26
 
    {'id': 'two', 'name': 'TWO', 'password': 'two2', 'tenants': ['baz']},
27
 
    {'id': 'no_meta',
28
 
     'name': 'NO_META',
29
 
     'password': 'no_meta2',
30
 
     'tenants': ['baz']},
31
 
    ]
 
53
    {
 
54
        'id': 'foo',
 
55
        'name': 'FOO',
 
56
        'domain_id': DEFAULT_DOMAIN_ID,
 
57
        'password': 'foo2',
 
58
        'tenants': ['bar'],
 
59
        'enabled': True,
 
60
        'email': 'foo@bar.com',
 
61
    }, {
 
62
        'id': 'two',
 
63
        'name': 'TWO',
 
64
        'domain_id': DEFAULT_DOMAIN_ID,
 
65
        'password': 'two2',
 
66
        'email': 'two@example.com',
 
67
        'enabled': True,
 
68
        'tenant_id': 'baz',
 
69
        'tenants': ['baz'],
 
70
        'email': 'two@three.com',
 
71
    }, {
 
72
        'id': 'badguy',
 
73
        'name': 'BadGuy',
 
74
        'domain_id': DEFAULT_DOMAIN_ID,
 
75
        'password': 'bad',
 
76
        'email': 'bad@guy.com',
 
77
        'enabled': False,
 
78
        'tenant_id': 'baz',
 
79
        'tenants': ['baz'],
 
80
        'email': 'badguy@goodguy.com',
 
81
    }, {
 
82
        'id': 'sna',
 
83
        'name': 'SNA',
 
84
        'domain_id': DEFAULT_DOMAIN_ID,
 
85
        'password': 'snafu',
 
86
        'enabled': True,
 
87
        'tenants': ['bar'],
 
88
        'email': 'sna@snl.coom',
 
89
    }
 
90
]
32
91
 
33
92
METADATA = [
34
 
    {'user_id': 'foo', 'tenant_id': 'bar', 'extra': 'extra'},
35
 
    {'user_id': 'two', 'tenant_id': 'baz', 'extra': 'extra'},
36
 
    ]
 
93
    {
 
94
        'user_id': 'sna',
 
95
        'tenant_id': 'mtu',
 
96
    }
 
97
]
37
98
 
38
99
ROLES = [
39
 
    {'id': 'keystone_admin', 'name': 'Keystone Admin'},
40
 
    {'id': 'useless', 'name': 'Useless'},
41
 
    ]
42
 
 
43
 
SERVICES = [
44
 
    {
45
 
        'id': 'COMPUTE_ID',
46
 
        'type': 'compute',
47
 
        'name': 'Nova',
48
 
        'description': 'OpenStack Compute service'
49
 
    },
50
 
    {
51
 
        'id': 'IDENTITY_ID',
52
 
        'type': 'identity',
53
 
        'name': 'Keystone',
54
 
        'description': 'OpenStack Identity service'
55
 
    },
56
 
    {
57
 
        'id': 'IMAGE_ID',
58
 
        'type': 'image',
59
 
        'name': 'Glance',
60
 
        'description': 'OpenStack Image service'
61
 
    },
 
100
    {
 
101
        'id': 'admin',
 
102
        'name': 'admin',
 
103
    }, {
 
104
        'id': 'member',
 
105
        'name': 'Member',
 
106
    }, {
 
107
        'id': CONF.member_role_id,
 
108
        'name': CONF.member_role_name,
 
109
    }, {
 
110
        'id': 'other',
 
111
        'name': 'Other',
 
112
    }, {
 
113
        'id': 'browser',
 
114
        'name': 'Browser',
 
115
    }, {
 
116
        'id': 'writer',
 
117
        'name': 'Writer',
 
118
    }
 
119
 
 
120
]
 
121
 
 
122
DOMAINS = [
 
123
    {
 
124
        'id': DEFAULT_DOMAIN_ID,
 
125
        'name': 'Default',
 
126
        'enabled': True,
 
127
        'description': 'Owns users and tenants (i.e. projects) available '
 
128
                       'on Identity API v2.'
 
129
    }
62
130
]