@@ -72,6 +72,11 @@ def test_delete_network(self):
72
72
self .assertTrue (self .enforce ('delete_network' , self .target , self .context ))
73
73
self .assertTrue (self .enforce ('delete_network' , self .alt_target , self .context ))
74
74
75
+ def test_update_quotas (self ):
76
+ """Admin can update quotas"""
77
+ self .assertTrue (self .enforce ('update_quota' , self .target , self .context ))
78
+ self .assertTrue (self .enforce ('update_quota' , self .alt_target , self .context ))
79
+
75
80
76
81
class DomainAdminNetworkPolicyTests (ProjectAdminNetworkPolicyTests ):
77
82
"""
@@ -140,13 +145,21 @@ def test_create_network_provider_segmentation_id(self):
140
145
'create_network:provider:segmentation_id' , self .alt_target , self .context )
141
146
142
147
def test_delete_network (self ):
143
- """Project manager cannot create networks"""
148
+ """Project manager can create networks"""
144
149
self .assertTrue (self .enforce ('delete_network' , self .target , self .context ))
145
150
self .assertRaises (
146
151
policy .PolicyNotAuthorized ,
147
152
self .enforce ,
148
153
'delete_network' , self .alt_target , self .context )
149
154
155
+ def test_update_quotas (self ):
156
+ """Project manager can update quotas"""
157
+ self .assertTrue (self .enforce ('update_quota' , self .target , self .context ))
158
+ self .assertRaises (
159
+ policy .PolicyNotAuthorized ,
160
+ self .enforce ,
161
+ 'update_quota' , self .alt_target , self .context )
162
+
150
163
151
164
class DomainManagerNetworkPolicyTests (base .PolicyTestsBase ):
152
165
"""
@@ -224,6 +237,17 @@ def test_delete_network(self):
224
237
self .enforce ,
225
238
'delete_network' , self .alt_target , self .context )
226
239
240
+ def test_update_quotas (self ):
241
+ """Domain manager cannot update quotas"""
242
+ self .assertRaises (
243
+ policy .PolicyNotAuthorized ,
244
+ self .enforce ,
245
+ 'update_quota' , self .target , self .context )
246
+ self .assertRaises (
247
+ policy .PolicyNotAuthorized ,
248
+ self .enforce ,
249
+ 'update_quota' , self .alt_target , self .context )
250
+
227
251
228
252
class ProjectMemberNetworkPolicyTests (base .PolicyTestsBase ):
229
253
"""
@@ -279,6 +303,13 @@ def test_delete_network(self):
279
303
self .enforce ,
280
304
'delete_network' , self .alt_target , self .context )
281
305
306
+ def test_update_quotas (self ):
307
+ """Project member cannot update quotas"""
308
+ self .assertRaises (
309
+ policy .PolicyNotAuthorized ,
310
+ self .enforce ,
311
+ 'update_quota' , self .target , self .context )
312
+
282
313
283
314
class DomainMemberNetworkPolicyTests (base .PolicyTestsBase ):
284
315
"""
@@ -326,10 +357,17 @@ def test_create_network_provider_segmentation_id(self):
326
357
'create_network:provider:segmentation_id' , self .target , self .context )
327
358
328
359
def test_delete_network (self ):
329
- """Project member can delete networks"""
360
+ """Domain member cannot delete networks"""
330
361
self .assertRaises (
331
362
policy .PolicyNotAuthorized ,
332
363
self .enforce ,
333
364
'delete_network' , self .target , self .context )
334
365
366
+ def test_update_quotas (self ):
367
+ """Domain member cannot update quotas"""
368
+ self .assertRaises (
369
+ policy .PolicyNotAuthorized ,
370
+ self .enforce ,
371
+ 'update_quota' , self .target , self .context )
372
+
335
373
# vi: ts=4 et:
0 commit comments