1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
# Copyright 2015 Tesora Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from proboscis import test
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.configuration_group"
class ConfigurationRunnerFactory(test_runners.RunnerFactory):
_runner_ns = 'configuration_runners'
_runner_cls = 'ConfigurationRunner'
@test(groups=[GROUP, groups.CFGGRP_CREATE],
runs_after_groups=[groups.MODULE_CREATE])
class ConfigurationCreateGroup(TestGroup):
"""Test Configuration Group functionality."""
def __init__(self):
super(ConfigurationCreateGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def create_bad_group(self):
"""Ensure a group with bad entries fails create."""
self.test_runner.run_create_bad_group()
@test
def create_invalid_groups(self):
"""Ensure a group with invalid entries fails create."""
self.test_runner.run_create_invalid_groups()
@test
def delete_non_existent_group(self):
"""Ensure delete non-existent group fails."""
self.test_runner.run_delete_non_existent_group()
@test
def delete_bad_group_id(self):
"""Ensure delete bad group fails."""
self.test_runner.run_delete_bad_group_id()
@test
def create_dynamic_group(self):
"""Create a group with only dynamic entries."""
self.test_runner.run_create_dynamic_group()
@test
def create_non_dynamic_group(self):
"""Create a group with only non-dynamic entries."""
self.test_runner.run_create_non_dynamic_group()
@test(depends_on=[create_dynamic_group, create_non_dynamic_group])
def list_configuration_groups(self):
"""Test list configuration groups."""
self.test_runner.run_list_configuration_groups()
@test(depends_on=[create_dynamic_group])
def dynamic_configuration_show(self):
"""Test show on dynamic group."""
self.test_runner.run_dynamic_configuration_show()
@test(depends_on=[create_non_dynamic_group])
def non_dynamic_configuration_show(self):
"""Test show on non-dynamic group."""
self.test_runner.run_non_dynamic_configuration_show()
@test(depends_on=[create_dynamic_group])
def dynamic_conf_get_unauthorized_user(self):
"""Ensure show dynamic fails with unauthorized user."""
self.test_runner.run_dynamic_conf_get_unauthorized_user()
@test(depends_on=[create_non_dynamic_group])
def non_dynamic_conf_get_unauthorized_user(self):
"""Ensure show non-dynamic fails with unauthorized user."""
self.test_runner.run_non_dynamic_conf_get_unauthorized_user()
@test(depends_on_groups=[groups.INST_CREATE_WAIT,
groups.CFGGRP_CREATE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_CREATE],
runs_after_groups=[groups.MODULE_INST_CREATE])
class ConfigurationInstCreateGroup(TestGroup):
"""Test Instance Configuration Group Create functionality."""
def __init__(self):
super(ConfigurationInstCreateGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def attach_non_existent_group(self):
"""Ensure attach non-existent group fails."""
self.test_runner.run_attach_non_existent_group()
@test
def attach_non_existent_group_to_non_existent_inst(self):
"""Ensure attach non-existent group to non-existent inst fails."""
self.test_runner.run_attach_non_existent_group_to_non_existent_inst()
@test
def detach_group_with_none_attached(self):
"""Test detach with none attached."""
self.test_runner.run_detach_group_with_none_attached()
@test
def attach_dynamic_group_to_non_existent_inst(self):
"""Ensure attach dynamic group to non-existent inst fails."""
self.test_runner.run_attach_dynamic_group_to_non_existent_inst()
@test
def attach_non_dynamic_group_to_non_existent_inst(self):
"""Ensure attach non-dynamic group to non-existent inst fails."""
self.test_runner.run_attach_non_dynamic_group_to_non_existent_inst()
@test
def list_dynamic_inst_conf_groups_before(self):
"""Count list instances for dynamic group before attach."""
self.test_runner.run_list_dynamic_inst_conf_groups_before()
@test(depends_on=[list_dynamic_inst_conf_groups_before],
runs_after=[attach_non_existent_group,
detach_group_with_none_attached])
def attach_dynamic_group(self):
"""Test attach dynamic group."""
self.test_runner.run_attach_dynamic_group()
@test(depends_on=[attach_dynamic_group])
def verify_dynamic_values(self):
"""Verify dynamic values on the instance."""
self.test_runner.run_verify_dynamic_values()
@test(depends_on=[attach_dynamic_group],
runs_after=[verify_dynamic_values])
def list_dynamic_inst_conf_groups_after(self):
"""Test list instances for dynamic group after attach."""
self.test_runner.run_list_dynamic_inst_conf_groups_after()
@test(depends_on=[attach_dynamic_group],
runs_after=[list_dynamic_inst_conf_groups_after])
def attach_dynamic_group_again(self):
"""Ensure attaching dynamic group again fails."""
self.test_runner.run_attach_dynamic_group_again()
@test(depends_on=[attach_dynamic_group],
runs_after=[attach_dynamic_group_again])
def delete_attached_dynamic_group(self):
"""Ensure deleting attached dynamic group fails."""
self.test_runner.run_delete_attached_dynamic_group()
@test(depends_on=[attach_dynamic_group],
runs_after=[delete_attached_dynamic_group])
def update_dynamic_group(self):
"""Test update dynamic group."""
self.test_runner.run_update_dynamic_group()
@test(depends_on=[attach_dynamic_group],
runs_after=[update_dynamic_group])
def detach_dynamic_group(self):
"""Test detach dynamic group."""
self.test_runner.run_detach_dynamic_group()
@test(runs_after=[detach_dynamic_group])
def list_non_dynamic_inst_conf_groups_before(self):
"""Count list instances for non-dynamic group before attach."""
self.test_runner.run_list_non_dynamic_inst_conf_groups_before()
@test(runs_after=[list_non_dynamic_inst_conf_groups_before,
attach_non_existent_group])
def attach_non_dynamic_group(self):
"""Test attach non-dynamic group."""
self.test_runner.run_attach_non_dynamic_group()
@test(depends_on=[attach_non_dynamic_group])
def verify_non_dynamic_values(self):
"""Verify non-dynamic values on the instance."""
self.test_runner.run_verify_non_dynamic_values()
@test(depends_on=[attach_non_dynamic_group],
runs_after=[verify_non_dynamic_values])
def list_non_dynamic_inst_conf_groups_after(self):
"""Test list instances for non-dynamic group after attach."""
self.test_runner.run_list_non_dynamic_inst_conf_groups_after()
@test(depends_on=[attach_non_dynamic_group],
runs_after=[list_non_dynamic_inst_conf_groups_after])
def attach_non_dynamic_group_again(self):
"""Ensure attaching non-dynamic group again fails."""
self.test_runner.run_attach_non_dynamic_group_again()
@test(depends_on=[attach_non_dynamic_group],
runs_after=[attach_non_dynamic_group_again])
def delete_attached_non_dynamic_group(self):
"""Ensure deleting attached non-dynamic group fails."""
self.test_runner.run_delete_attached_non_dynamic_group()
@test(depends_on=[attach_non_dynamic_group],
runs_after=[delete_attached_non_dynamic_group])
def update_non_dynamic_group(self):
"""Test update non-dynamic group."""
self.test_runner.run_update_non_dynamic_group()
@test(depends_on=[attach_non_dynamic_group],
runs_after=[update_non_dynamic_group])
def detach_non_dynamic_group(self):
"""Test detach non-dynamic group."""
self.test_runner.run_detach_non_dynamic_group()
@test(runs_after=[detach_non_dynamic_group])
def create_instance_with_conf(self):
"""Test create instance with conf group."""
self.test_runner.run_create_instance_with_conf()
@test(depends_on_groups=[groups.CFGGRP_INST_CREATE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_CREATE_WAIT],
runs_after_groups=[groups.INST_ACTIONS,
groups.INST_UPGRADE,
groups.MODULE_INST_CREATE_WAIT])
class ConfigurationInstCreateWaitGroup(TestGroup):
"""Test that Instance Configuration Group Create Completes."""
def __init__(self):
super(ConfigurationInstCreateWaitGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def wait_for_conf_instance(self):
"""Test create instance with conf group completes."""
self.test_runner.run_wait_for_conf_instance()
@test(depends_on=[wait_for_conf_instance])
def verify_instance_values(self):
"""Verify configuration values on the instance."""
self.test_runner.run_verify_instance_values()
@test(depends_on_groups=[groups.CFGGRP_INST_CREATE_WAIT],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_DELETE],
runs_after_groups=[groups.MODULE_INST_DELETE])
class ConfigurationInstDeleteGroup(TestGroup):
"""Test Instance Configuration Group Delete functionality."""
def __init__(self):
super(ConfigurationInstDeleteGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def delete_conf_instance(self):
"""Test delete instance with conf group."""
self.test_runner.run_delete_conf_instance()
@test(depends_on_groups=[groups.CFGGRP_INST_DELETE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class ConfigurationInstDeleteWaitGroup(TestGroup):
"""Test that Instance Configuration Group Delete Completes."""
def __init__(self):
super(ConfigurationInstDeleteWaitGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def wait_for_delete_conf_instance(self):
"""Wait for delete instance with conf group to complete."""
self.test_runner.run_wait_for_delete_conf_instance()
@test(depends_on_groups=[groups.CFGGRP_CREATE],
runs_after_groups=[groups.CFGGRP_INST_DELETE_WAIT],
groups=[GROUP, groups.CFGGRP_DELETE])
class ConfigurationDeleteGroup(TestGroup):
"""Test Configuration Group Delete functionality."""
def __init__(self):
super(ConfigurationDeleteGroup, self).__init__(
ConfigurationRunnerFactory.instance())
@test
def delete_dynamic_group(self):
"""Test delete dynamic group."""
self.test_runner.run_delete_dynamic_group()
@test
def delete_non_dynamic_group(self):
"""Test delete non-dynamic group."""
self.test_runner.run_delete_non_dynamic_group()
|