1 SNAPS OpenStack API Testing
2 ===========================
4 Tests designated as component tests extend the snaps.openstack.tests.OSComponentTestCase class and must be exercised
5 with OpenStack credentials for all as well as an external network for many. When leveraging the unit\_test\_suite.py
6 application, the -e argument and -n arguments will suffice. When attempting to execute these tests within your IDE
7 of choice (tested on IntelliJ), you will need to edit the [repo\_dir]/snaps/openstack/tests/conf/os\_env.yaml file as well
8 as ensuring that your run configuration's working directory is set to [repo\_dir]/snaps.
13 glance_utils_tests.py - GlanceSmokeTests
14 ----------------------------------------
16 Ensures that a Glance client can be obtained as well as the proper
17 exceptions thrown with the wrong credentials.
19 keystone_utils_tests.py - KeystoneSmokeTests
20 --------------------------------------------
22 Ensures that a Keystone client can be obtained as well as the proper
23 exceptions thrown with the wrong credentials.
25 neutron_utils_tests.py - NeutronSmokeTests
26 ------------------------------------------
28 Ensures that a Neutron client can be obtained as well as the proper
29 exceptions thrown with the wrong credentials.
31 nova_utils_tests.py - NovaSmokeTests
32 ------------------------------------
34 Ensures that a Nova client can be obtained as well as the proper
35 exceptions thrown with the wrong credentials.
37 heat_utils_tests.py - HeatSmokeTests
38 ------------------------------------
40 Ensures that a Heat client can be obtained as well as the proper
41 exceptions thrown with the wrong credentials.
43 keystone_utils_tests.py - KeystoneUtilsTests
44 --------------------------------------------
46 +----------------------------------+---------------+-----------------------------------------------------------+
47 | Test Name | Keystone API | Description |
48 +==================================+===============+===========================================================+
49 | test_create_user_minimal | 2 & 3 | Tests the creation of a user with minimal configuration |
50 | | | settings via the utility functions |
51 +----------------------------------+---------------+-----------------------------------------------------------+
52 | test_create_project_minimal | 2 & 3 | Tests the creation of a project with minimal configuration|
53 | | | settings via the utility functions |
54 +----------------------------------+---------------+-----------------------------------------------------------+
55 | test_get_endpoint_success | 2 & 3 | Tests to ensure that proper credentials and proper service|
56 | | | type can succeed |
57 +----------------------------------+---------------+-----------------------------------------------------------+
58 | test_get_endpoint_fail_without | 2 & 3 | Tests to ensure that proper credentials and improper |
59 | _proper_service | | service type cannot succeed |
60 +----------------------------------+---------------+-----------------------------------------------------------+
61 | test_get_endpoint_fail_without | 2 & 3 | Tests to ensure that improper credentials and proper |
62 | _proper_credentials | | service type cannot succeed |
63 +----------------------------------+---------------+-----------------------------------------------------------+
64 | test_get_endpoint_with_each | 2 & 3 | Tests to ensure that an interface URL is returned for each|
65 | _interface | | supported interface type (i.e. public, internal, & admin) |
66 +----------------------------------+---------------+-----------------------------------------------------------+
67 | test_grant_user_role_to_project | 2 & 3 | Tests to ensure that one can grant a new user's role to a |
69 +----------------------------------+---------------+-----------------------------------------------------------+
71 create_user_tests.py - CreateUserSuccessTests
72 ---------------------------------------------
73 +----------------------------------+---------------+-----------------------------------------------------------+
74 | Test Name | Keystone API | Description |
75 +==================================+===============+===========================================================+
76 | test_create_user | 2 & 3 | Tests the creation of a user with minimal configuration |
77 | | | settings via the utility functions |
78 +----------------------------------+---------------+-----------------------------------------------------------+
79 | test_create_user_2x | 2 & 3 | Tests the creation of a user 2x and ensure it has been |
80 | | | done only once |
81 +----------------------------------+---------------+-----------------------------------------------------------+
82 | test_create_delete_user | 2 & 3 | Tests the creation of a user and ensure clean can be |
83 | | | called 2x without exceptions being raised |
84 +----------------------------------+---------------+-----------------------------------------------------------+
85 | test_create_admin_user | 2 & 3 | Tests the creation of a user with an 'admin' role |
86 +----------------------------------+---------------+-----------------------------------------------------------+
88 create_project_tests.py - CreateProjectSuccessTests
89 ---------------------------------------------------
91 +----------------------------------+---------------+-----------------------------------------------------------+
92 | Test Name | Keystone API | Description |
93 +==================================+===============+===========================================================+
94 | test_create_project_bad_domain | 3 | Ensures that keystone v3 clients using the domain ID |
95 | | | project setting project creation will fail with an invalid|
96 | | | domain id/name |
97 +----------------------------------+---------------+-----------------------------------------------------------+
98 | test_create_project | 2 & 3 | Tests the creation of a project via the OpenStackProject |
100 +----------------------------------+---------------+-----------------------------------------------------------+
101 | test_create_project_2x | 2 & 3 | Tests the creation of a project a second time via the |
102 | | | OpenStackProject class to ensure it is only created once |
103 +----------------------------------+---------------+-----------------------------------------------------------+
104 | test_create_delete_project | 2 & 3 | Tests the creation and deletion of a project via the |
105 | | | OpenStackProject class to ensure that clean will not raise|
107 +----------------------------------+---------------+-----------------------------------------------------------+
108 | test_update_quotas | 2 & 3 | Tests the ability to update quota values |
109 | | nova & neutron| |
110 +----------------------------------+---------------+-----------------------------------------------------------+
112 create_project_tests.py - CreateProjectUserTests
113 ------------------------------------------------
115 +---------------------------------------+---------------+-----------------------------------------------------------+
116 | Test Name | Keystone API | Description |
117 +=======================================+===============+===========================================================+
118 | test_create_project_sec_grp_one_user | 2 & 3 | Tests the creation of an OpenStack object to a project |
119 | | | with a new users and to create a security group |
121 +---------------------------------------+---------------+-----------------------------------------------------------+
122 | test_create_project_sec_grp_two_users | 2 & 3 | Tests the creation of an OpenStack object to a project |
123 | | | with two new users and to create a security group under |
125 +---------------------------------------+---------------+-----------------------------------------------------------+
127 glance_utils_tests.py - GlanceUtilsTests
128 ----------------------------------------
130 +---------------------------------------+---------------+-----------------------------------------------------------+
131 | Test Name | Glance API | Description |
132 +=======================================+===============+===========================================================+
133 | test_create_image_minimal_url | 1 | Tests the glance_utils.create_image() function with a URL |
134 +---------------------------------------+---------------+-----------------------------------------------------------+
135 | test_create_image_minimal_file | 1 | Tests the glance_utils.create_image() function with a file|
136 +---------------------------------------+---------------+-----------------------------------------------------------+
138 neutron_utils_tests.py - NeutronUtilsNetworkTests
139 -------------------------------------------------
141 +---------------------------------------+---------------+-----------------------------------------------------------+
142 | Test Name | Neutron API | Description |
143 +=======================================+===============+===========================================================+
144 | test_create_network | 2 | Ensures neutron_utils.create_network() properly creates a |
146 +---------------------------------------+---------------+-----------------------------------------------------------+
147 | test_create_network_empty_name | 2 | Ensures neutron_utils.create_network() raises an exception|
148 | | | when the network name is an empty string |
149 +---------------------------------------+---------------+-----------------------------------------------------------+
150 | test_create_network_null_name | 2 | Ensures neutron_utils.create_network() raises an exception|
151 | | | when the network name is None |
152 +---------------------------------------+---------------+-----------------------------------------------------------+
154 neutron_utils_tests.py - NeutronUtilsSubnetTests
155 ------------------------------------------------
157 +---------------------------------------+---------------+-----------------------------------------------------------+
158 | Test Name | Neutron API | Description |
159 +=======================================+===============+===========================================================+
160 | test_create_subnet | 2 | Ensures neutron_utils.create_subnet() can properly create |
161 | | | an OpenStack subnet object |
162 +---------------------------------------+---------------+-----------------------------------------------------------+
163 | test_create_subnet_null_name | 2 | Ensures neutron_utils.create_subnet() raises an exception |
164 | | | when the subnet name is None |
165 +---------------------------------------+---------------+-----------------------------------------------------------+
166 | test_create_subnet_empty_name | 2 | Ensures neutron_utils.create_subnet() raises an exception |
167 | | | when the subnet name is an empty string |
168 +---------------------------------------+---------------+-----------------------------------------------------------+
169 | test_create_subnet_null_cidr | 2 | Ensures neutron_utils.create_subnet() raises an exception |
170 | | | when the subnet CIDR is None |
171 +---------------------------------------+---------------+-----------------------------------------------------------+
172 | test_create_subnet_empty_cidr | 2 | Ensures neutron_utils.create_subnet() raises an exception |
173 | | | when the subnet CIDR is an empty string |
174 +---------------------------------------+---------------+-----------------------------------------------------------+
176 neutron_utils_tests.py - NeutronUtilsRouterTests
177 ------------------------------------------------
179 +---------------------------------------+---------------+-----------------------------------------------------------+
180 | Test Name | Neutron API | Description |
181 +=======================================+===============+===========================================================+
182 | test_create_router_simple | 2 | Ensures neutron_utils.create_router() can properly create |
183 | | | a simple OpenStack router object |
184 +---------------------------------------+---------------+-----------------------------------------------------------+
185 | test_create_router_with_public_inter | 2 | Ensures neutron_utils.create_router() can properly create |
186 | face | | an OpenStack router object with an interface to the |
187 | | | external network |
188 +---------------------------------------+---------------+-----------------------------------------------------------+
189 | test_create_router_empty_name | 2 | Ensures neutron_utils.create_router() raises an exception |
190 | | | when the name is an empty string |
191 +---------------------------------------+---------------+-----------------------------------------------------------+
192 | test_create_router_null_name | 2 | Ensures neutron_utils.create_router() raises an exception |
193 | | | when the name is None |
194 +---------------------------------------+---------------+-----------------------------------------------------------+
195 | test_add_interface_router | 2 | Ensures neutron_utils.add_interface_router() properly adds|
196 | | | an interface to another subnet |
197 +---------------------------------------+---------------+-----------------------------------------------------------+
198 | test_add_interface_router_null_router | 2 | Ensures neutron_utils.add_interface_router() raises an |
199 | | | exception when the router object is None |
200 +---------------------------------------+---------------+-----------------------------------------------------------+
201 | test_add_interface_router_null_subnet | 2 | Ensures neutron_utils.add_interface_router() raises an |
202 | | | exception when the subnet object is None |
203 +---------------------------------------+---------------+-----------------------------------------------------------+
204 | test_create_port | 2 | Ensures neutron_utils.create_port() can properly create an|
205 | | | OpenStack port object |
206 +---------------------------------------+---------------+-----------------------------------------------------------+
207 | test_create_port_empty_name | 2 | Ensures neutron_utils.create_port() raises an exception |
208 | | | when the port name is an empty string |
209 +---------------------------------------+---------------+-----------------------------------------------------------+
210 | test_create_port_null_name | 2 | Ensures neutron_utils.create_port() raises an exception |
211 | | | when the port name is None |
212 +---------------------------------------+---------------+-----------------------------------------------------------+
213 | test_create_port_null_network_object | 2 | Ensures neutron_utils.create_port() raises an exception |
214 | | | when the network object is None |
215 +---------------------------------------+---------------+-----------------------------------------------------------+
216 | test_create_port_null_ip | 2 | Ensures neutron_utils.create_port() raises an exception |
217 | | | when the assigned IP value is None |
218 +---------------------------------------+---------------+-----------------------------------------------------------+
219 | test_create_port_invalid_ip | 2 | Ensures neutron_utils.create_port() raises an exception |
220 | | | when the assigned IP value is invalid |
221 +---------------------------------------+---------------+-----------------------------------------------------------+
222 | test_create_port_invalid_ip_to_subnet | 2 | Ensures neutron_utils.create_port() raises an exception |
223 | | | when the assigned IP value is not part of CIDR |
224 +---------------------------------------+---------------+-----------------------------------------------------------+
226 neutron_utils_tests.py - NeutronUtilsSecurityGroupTests
227 -------------------------------------------------------
229 +---------------------------------------+---------------+-----------------------------------------------------------+
230 | Test Name | Neutron API | Description |
231 +=======================================+===============+===========================================================+
232 | test_create_delete_simple_sec_grp | 2 | Ensures that a security group can be created |
233 | | | (neutron_utils.create_security_group() and deleted via |
234 | | | neutron_utils.delete_security_group() |
235 +---------------------------------------+---------------+-----------------------------------------------------------+
236 | test_create_sec_grp_no_name | 2 | Ensures that neutron_utils.create_security_group() raises |
237 | | | an exception when attempting to create a security group |
238 | | | without a name |
239 +---------------------------------------+---------------+-----------------------------------------------------------+
240 | test_create_sec_grp_no_rules | 2 | Ensures that neutron_utils.create_security_group() can |
241 | | | create a security group without any rules |
242 +---------------------------------------+---------------+-----------------------------------------------------------+
243 | test_create_sec_grp_one_rule | 2 | Ensures that neutron_utils.create_security_group_rule() |
244 | | | can add a rule to a security group |
245 +---------------------------------------+---------------+-----------------------------------------------------------+
246 | test_get_sec_grp_by_id | 2 | Ensures that neutron_utils.get_security_group_by_id() |
247 | | | returns the expected security group |
248 +---------------------------------------+---------------+-----------------------------------------------------------+
250 neutron_utils_tests.py - NeutronUtilsFloatingIpTests
251 ----------------------------------------------------
253 +---------------------------------------+---------------+-----------------------------------------------------------+
254 | Test Name | Neutron API | Description |
255 +=======================================+===============+===========================================================+
256 | test_floating_ips | 2 | Ensures that a floating IP can be created |
257 +---------------------------------------+---------------+-----------------------------------------------------------+
259 nova_utils_tests.py - NovaUtilsKeypairTests
260 -------------------------------------------
262 +---------------------------------------+---------------+-----------------------------------------------------------+
263 | Test Name | Nova API | Description |
264 +=======================================+===============+===========================================================+
265 | test_create_keypair | 2 | Ensures that a keypair can be properly created via |
266 | | | nova_utils.upload_keypair() with a public_key object |
267 +---------------------------------------+---------------+-----------------------------------------------------------+
268 | test_create_delete_keypair | 2 | Ensures that a keypair can be properly deleted via |
269 | | | nova_utils.delete_keypair() |
270 +---------------------------------------+---------------+-----------------------------------------------------------+
271 | test_create_key_from_file | 2 | Ensures that a keypair can be properly created via |
272 | | | nova_utils.upload_keypair_file() |
273 +---------------------------------------+---------------+-----------------------------------------------------------+
275 nova_utils_tests.py - NovaUtilsFlavorTests
276 ------------------------------------------
278 +---------------------------------------+---------------+-----------------------------------------------------------+
279 | Test Name | Nova API | Description |
280 +=======================================+===============+===========================================================+
281 | test_create_flavor | 2 | Ensures that a flavor can be properly created via |
282 | | | nova_utils.create_flavor() |
283 +---------------------------------------+---------------+-----------------------------------------------------------+
284 | test_create_delete_flavor | 2 | Ensures that a flavor can be properly deleted via |
285 | | | nova_utils.delete_flavor() |
286 +---------------------------------------+---------------+-----------------------------------------------------------+
288 nova_utils_tests.py - NovaUtilsInstanceTests
289 --------------------------------------------
291 +---------------------------------------+---------------+-----------------------------------------------------------+
292 | Test Name | Nova API | Description |
293 +=======================================+===============+===========================================================+
294 | test_create_instance | 2 | Ensures that a VM instance can be properly created via |
295 | | | nova_utils.create_server() |
296 +---------------------------------------+---------------+-----------------------------------------------------------+
298 create_flavor_tests.py - CreateFlavorTests
299 ------------------------------------------
301 +---------------------------------------+---------------+-----------------------------------------------------------+
302 | Test Name | Nova API | Description |
303 +=======================================+===============+===========================================================+
304 | test_create_flavor | 2 | Ensures that the OpenStackFlavor class's create() method |
305 | | | creates an OpenStack flavor object |
306 +---------------------------------------+---------------+-----------------------------------------------------------+
307 | test_create_flavor_existing | 2 | Ensures that the OpenStackFlavor class's create() will not|
308 | | | create a flavor with the same name more than once |
309 +---------------------------------------+---------------+-----------------------------------------------------------+
310 | test_create_clean_flavor | 2 | Ensures that the OpenStackFlavor class's clean() method |
311 | | | will delete the flavor object |
312 +---------------------------------------+---------------+-----------------------------------------------------------+
313 | test_create_delete_flavor | 2 | Ensures that the OpenStackFlavor class's clean() method |
314 | | | will not raise an exception when called and the object no |
315 | | | longer exists |
316 +---------------------------------------+---------------+-----------------------------------------------------------+
317 | test_create_delete_flavor_all_settings| 2 | Ensures that the OpenStackFlavor class will create a |
318 | | | a flavor properly with all supported settings |
319 +---------------------------------------+---------------+-----------------------------------------------------------+
321 heat_utils_tests.py - HeatUtilsCreateStackTests
322 -----------------------------------------------
324 +---------------------------------------+---------------+-----------------------------------------------------------+
325 | Test Name | Glance API | Description |
326 +=======================================+===============+===========================================================+
327 | test_create_stack | 1 | Tests the heat_utils.create_stack() with a test template |
328 +---------------------------------------+---------------+-----------------------------------------------------------+