Added support for offline testing
[snaps.git] / docs / how-to-use / IntegrationTests.rst
1 SNAPS OpenStack Integration Testing
2 ===================================
3
4 These tests are ones designed to be run within their own dynamically created project along with a newly generated user
5 account and generally require other OpenStack object creators.
6
7 The Test Classes
8 ================
9
10 create_security_group_tests.py - CreateSecurityGroupTests
11 ---------------------------------------------------------
12
13 +---------------------------------------+---------------+-----------------------------------------------------------+
14 | Test Name                             | API Versions  | Description                                               |
15 +=======================================+===============+===========================================================+
16 | test_create_group_without_rules       | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup class can create a     |
17 |                                       | Neutron 2     | security group without any rules                          |
18 +---------------------------------------+---------------+-----------------------------------------------------------+
19 | test_create_delete_group              | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup class clean() method   |
20 |                                       | Neutron 2     | will not raise an exception should the group be deleted by|
21 |                                       |               | some other process                                        |
22 +---------------------------------------+---------------+-----------------------------------------------------------+
23 | test_create_group_with_one_simple_rule| Keysone 2 & 3 | Ensures the OpenStackSecurityGroup class can create a     |
24 |                                       | Neutron 2     | security group with a single rule                         |
25 +---------------------------------------+---------------+-----------------------------------------------------------+
26 | test_create_group_with_several_rules  | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup class can create a     |
27 |                                       | Neutron 2     | security group with several rules                         |
28 +---------------------------------------+---------------+-----------------------------------------------------------+
29 | test_add_rule                         | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup#add_rule() method      |
30 |                                       | Neutron 2     | properly creates and associates the new rule              |
31 +---------------------------------------+---------------+-----------------------------------------------------------+
32 | test_remove_rule_by_id                | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup#remove_rule() method   |
33 |                                       | Neutron 2     | properly deletes and disassociates the old rule via its ID|
34 +---------------------------------------+---------------+-----------------------------------------------------------+
35 | test_remove_rule_by_setting           | Keysone 2 & 3 | Ensures the OpenStackSecurityGroup#remove_rule() method   |
36 |                                       | Neutron 2     | properly deletes and disassociates the old rule via its   |
37 |                                       |               | setting object                                            |
38 +---------------------------------------+---------------+-----------------------------------------------------------+
39
40 create_image_tests.py - CreateImageSuccessTests
41 -----------------------------------------------
42
43 +---------------------------------------+---------------+-----------------------------------------------------------+
44 | Test Name                             | Glance API    | Description                                               |
45 +=======================================+===============+===========================================================+
46 | test_create_image_clean_url           | 1             | Ensures the OpenStackImage class can create an image from |
47 |                                       |               | a download URL location                                   |
48 +---------------------------------------+---------------+-----------------------------------------------------------+
49 | test_create_image_clean_file          | 1             | Ensures the OpenStackImage class can create an image from |
50 |                                       |               | a locally sourced image file                              |
51 +---------------------------------------+---------------+-----------------------------------------------------------+
52 | test_create_delete_image              | 1             | Ensures the OpenStackImage.clean() method deletes an image|
53 |                                       |               | and does not raise an exception on subsequent calls to the|
54 |                                       |               | clean() method                                            |
55 +---------------------------------------+---------------+-----------------------------------------------------------+
56 | test_create_same_image                | 1             | Ensures the OpenStackImage.create() method does not create|
57 |                                       |               | another image when one already exists with the same name  |
58 +---------------------------------------+---------------+-----------------------------------------------------------+
59 | test_create_same_image_new_settings   | 1             | Tests the creation of an OpenStack image when the image   |
60 |                                       |               | already exists and the configuration only contains the    |
61 |                                       |               | the name.                                                 |
62 +---------------------------------------+---------------+-----------------------------------------------------------+
63
64 create_image_tests.py - CreateImageNegativeTests
65 ------------------------------------------------
66
67 +---------------------------------------+---------------+-----------------------------------------------------------+
68 | Test Name                             | Glance API    | Description                                               |
69 +=======================================+===============+===========================================================+
70 | test_bad_image_name                   | 1             | Ensures OpenStackImage.create() results in an Exception   |
71 |                                       |               | being raised when the ImageSettings.name attribute has    |
72 |                                       |               | not been set                                              |
73 +---------------------------------------+---------------+-----------------------------------------------------------+
74 | test_bad_image_url                    | 1             | Ensures OpenStackImage.create() results in an Exception   |
75 |                                       |               | being raised when the download URL is invalid             |
76 +---------------------------------------+---------------+-----------------------------------------------------------+
77 | test_bad_image_file                   | 1             | Ensures OpenStackImage.create() results in an Exception   |
78 |                                       |               | being raised when the image file does not exist           |
79 +---------------------------------------+---------------+-----------------------------------------------------------+
80
81 create_image_tests.py - CreateMultiPartImageTests
82 -------------------------------------------------
83
84 +----------------------------------------+---------------+-----------------------------------------------------------+
85 | Test Name                              | Glance API    | Description                                               |
86 +========================================+===============+===========================================================+
87 | test_create_three_part_image_from_url  | 1             | Ensures that a 3-part image can be created when each part |
88 |                                        |               | is being sourced from URLs                                |
89 +----------------------------------------+---------------+-----------------------------------------------------------+
90 | test_create_three_part_image_from_file | 1             | Ensures that a 3-part image can be created when each part |
91 |                                        |               | is being sourced from local files                         |
92 +----------------------------------------+---------------+-----------------------------------------------------------+
93
94 create_keypairs_tests.py - CreateKeypairsTests
95 ----------------------------------------------
96
97 +---------------------------------------+---------------+-----------------------------------------------------------+
98 | Test Name                             | Nova API      | Description                                               |
99 +=======================================+===============+===========================================================+
100 | test_create_keypair_only              | 2             | Ensures that a keypair object can be created simply by    |
101 |                                       |               | only configuring a name                                   |
102 +---------------------------------------+---------------+-----------------------------------------------------------+
103 | test_create_delete_keypair            | 2             | Ensures that a keypair object is deleted via              |
104 |                                       |               | OpenStackKeypair.clean() and subsequent calls do not      |
105 |                                       |               | result in exceptions                                      |
106 +---------------------------------------+---------------+-----------------------------------------------------------+
107 | test_create_keypair_save_pub_only     | 2             | Ensures that a keypair object can be created when the only|
108 |                                       |               | the public key is cached to disk                          |
109 +---------------------------------------+---------------+-----------------------------------------------------------+
110 | test_create_keypair_save_both         | 2             | Ensures that a keypair object can be created when both the|
111 |                                       |               | public and private keys are cached to disk                |
112 +---------------------------------------+---------------+-----------------------------------------------------------+
113 | test_create_keypair_from_file         | 2             | Ensures that a keypair object can be created with an      |
114 |                                       |               | existing public key file                                  |
115 +---------------------------------------+---------------+-----------------------------------------------------------+
116
117 create_network_tests.py - CreateNetworkSuccessTests
118 ---------------------------------------------------
119
120 +---------------------------------------+---------------+-----------------------------------------------------------+
121 | Test Name                             | Neutron API   | Description                                               |
122 +=======================================+===============+===========================================================+
123 | test_create_network_without_router    | 2             | Ensures that a network can be created via the             |
124 |                                       |               | OpenStackNetwork class without any routers                |
125 +---------------------------------------+---------------+-----------------------------------------------------------+
126 | test_create_delete_network            | 2             | Ensures that a router can be deleted via the              |
127 |                                       |               | OpenStackNetwork.clean() method                           |
128 +---------------------------------------+---------------+-----------------------------------------------------------+
129 | test_create_network_with_router       | 2             | Ensures that a network can be created via the             |
130 |                                       |               | OpenStackNetwork class with a router                      |
131 +---------------------------------------+---------------+-----------------------------------------------------------+
132 | test_create_networks_same_name        | 2             | Ensures that the OpenStackNetwork.create() method will not|
133 |                                       |               | create a network with the same name                       |
134 +---------------------------------------+---------------+-----------------------------------------------------------+
135
136 create_router_tests.py - CreateRouterSuccessTests
137 -------------------------------------------------
138
139 +---------------------------------------+---------------+-----------------------------------------------------------+
140 | Test Name                             | Neutron API   | Description                                               |
141 +=======================================+===============+===========================================================+
142 | test_create_router_vanilla            | 2             | Ensures that a router can be created via the              |
143 |                                       |               | OpenStackRouter class with minimal settings               |
144 +---------------------------------------+---------------+-----------------------------------------------------------+
145 | test_create_delete_router             | 2             | Ensures that a router can be deleted via the              |
146 |                                       |               | OpenStackRouter.clean() method                            |
147 +---------------------------------------+---------------+-----------------------------------------------------------+
148 | test_create_router_admin_state_false  | 2             | Ensures that a router can created with                    |
149 |                                       |               | admin_state_up = False                                    |
150 +---------------------------------------+---------------+-----------------------------------------------------------+
151 | test_create_router_admin_state_True   | 2             | Ensures that a router can created with                    |
152 |                                       |               | admin_state_up = True                                     |
153 +---------------------------------------+---------------+-----------------------------------------------------------+
154 | test_create_router_private_network    | 2             | Ensures that a router port can be created against a       |
155 |                                       |               | private network                                           |
156 +---------------------------------------+---------------+-----------------------------------------------------------+
157 | test_create_router_external_network   | 2             | Ensures that a router can be created that is connected to |
158 |                                       |               | both external and private internal networks               |
159 +---------------------------------------+---------------+-----------------------------------------------------------+
160
161 create_router_tests.py - CreateRouterNegativeTests
162 --------------------------------------------------
163
164 +----------------------------------------+---------------+-----------------------------------------------------------+
165 | Test Name                              | Neutron API   | Description                                               |
166 +========================================+===============+===========================================================+
167 | test_create_router_noname              | 2             | Ensures that an exception is raised when attempting to    |
168 |                                        |               | create a router without a name                            |
169 +----------------------------------------+---------------+-----------------------------------------------------------+
170 | test_create_router_invalid_gateway_name| 2             | Ensures that an exception is raised when attempting to    |
171 |                                        |               | create a router to an external network that does not exist|
172 +----------------------------------------+---------------+-----------------------------------------------------------+
173
174 create_instance_tests.py - CreateInstanceSimpleTests
175 ----------------------------------------------------
176
177 +---------------------------------------+---------------+-----------------------------------------------------------+
178 | Test Name                             | API Versions  | Description                                               |
179 +=======================================+===============+===========================================================+
180 | test_create_delete_instance           | Nova 2        | Ensures that the OpenStackVmInstance.clean() method       |
181 |                                       | Neutron 2     | deletes the instance                                      |
182 +---------------------------------------+---------------+-----------------------------------------------------------+
183
184 create_instance_tests.py - SimpleHealthCheck
185 --------------------------------------------
186
187 +---------------------------------------+---------------+-----------------------------------------------------------+
188 | Test Name                             | API Versions  | Description                                               |
189 +=======================================+===============+===========================================================+
190 | test_check_vm_ip_dhcp                 | Nova 2        | Tests the creation of an OpenStack instance with a single |
191 |                                       | Neutron 2     | port and it's assigned IP address                         |
192 +---------------------------------------+---------------+-----------------------------------------------------------+
193
194 create_instance_tests.py - CreateInstanceSingleNetworkTests
195 -----------------------------------------------------------
196
197 +---------------------------------------+---------------+-----------------------------------------------------------+
198 | Test Name                             | API Versions  | Description                                               |
199 +=======================================+===============+===========================================================+
200 | test_single_port_static               | Nova 2        | Ensures that an instance with a single port/NIC with a    |
201 |                                       | Neutron 2     | static IP can be created                                  |
202 +---------------------------------------+---------------+-----------------------------------------------------------+
203 | test_ssh_client_fip_before_active     | Nova 2        | Ensures that an instance can be reached over SSH when the |
204 |                                       | Neutron 2     | floating IP is assigned prior to the VM becoming ACTIVE   |
205 +---------------------------------------+---------------+-----------------------------------------------------------+
206 | test_ssh_client_fip_after_active      | Nova 2        | Ensures that an instance can be reached over SSH when the |
207 |                                       | Neutron 2     | floating IP is assigned after to the VM becoming ACTIVE   |
208 +---------------------------------------+---------------+-----------------------------------------------------------+
209
210 create_instance_tests.py - CreateInstancePortManipulationTests
211 --------------------------------------------------------------
212
213 +---------------------------------------+---------------+-----------------------------------------------------------+
214 | Test Name                             | API Versions  | Description                                               |
215 +=======================================+===============+===========================================================+
216 | test_set_custom_valid_ip_one_subnet   | Nova 2        | Ensures that an instance's can have a valid static IP is  |
217 |                                       | Neutron 2     | properly assigned                                         |
218 +---------------------------------------+---------------+-----------------------------------------------------------+
219 | test_set_custom_invalid_ip_one_subnet | Nova 2        | Ensures that an instance's port with an invalid static IP |
220 |                                       | Neutron 2     | raises an exception                                       |
221 +---------------------------------------+---------------+-----------------------------------------------------------+
222 | test_set_custom_valid_mac             | Nova 2        | Ensures that an instance's port can have a valid MAC      |
223 |                                       | Neutron 2     | address properly assigned                                 |
224 +---------------------------------------+---------------+-----------------------------------------------------------+
225 | test_set_custom_invalid_mac           | Nova 2        | Ensures that an instance's port with an invalid MAC       |
226 |                                       | Neutron 2     | address raises and exception                              |
227 +---------------------------------------+---------------+-----------------------------------------------------------+
228 | test_set_custom_mac_and_ip            | Nova 2        | Ensures that an instance's port with a valid static IP and|
229 |                                       | Neutron 2     | MAC are properly assigned                                 |
230 +---------------------------------------+---------------+-----------------------------------------------------------+
231 | test_set_allowed_address_pairs        | Nova 2        | Ensures the configured allowed_address_pairs is properly  |
232 |                                       | Neutron 2     | set on a VMs port                                         |
233 +---------------------------------------+---------------+-----------------------------------------------------------+
234 | test_set_allowed_address_pairs_bad_mac| Nova 2        | Ensures the port cannot be created when a bad MAC address |
235 |                                       | Neutron 2     | format is used in the allowed_address_pairs port attribute|
236 +---------------------------------------+---------------+-----------------------------------------------------------+
237 | test_set_allowed_address_pairs_bad_ip | Nova 2        | Ensures the port cannot be created when a bad IP address  |
238 |                                       | Neutron 2     | format is used in the allowed_address_pairs port attribute|
239 +---------------------------------------+---------------+-----------------------------------------------------------+
240
241 create_instance_tests.py - CreateInstanceOnComputeHost
242 ------------------------------------------------------
243
244 +---------------------------------------+---------------+-----------------------------------------------------------+
245 | Test Name                             | API Versions  | Description                                               |
246 +=======================================+===============+===========================================================+
247 | test_deploy_vm_to_each_compute_node   | Nova 2        | Tests to ensure that one can fire up an instance on each  |
248 |                                       | Neutron 2     | active compute node                                       |
249 +---------------------------------------+---------------+-----------------------------------------------------------+
250
251 create_instance_tests.py - CreateInstanceFromThreePartImage
252 -----------------------------------------------------------
253
254 +-----------------------------------------------------+---------------+-----------------------------------------------------------+
255 | Test Name                                           | API Versions  | Description                                               |
256 +=====================================================+===============+===========================================================+
257 | test_create_delete_instance_from_three_part_image   | Nova 2        | Tests to ensure that one can fire up an instance then     |
258 |                                                     | Neutron 2     | delete it when using a 3-part image                       |
259 +-----------------------------------------------------+---------------+-----------------------------------------------------------+
260
261 create_instance_tests.py - CreateInstancePubPrivNetTests
262 --------------------------------------------------------
263
264 +---------------------------------------+---------------+-----------------------------------------------------------+
265 | Test Name                             | API Versions  | Description                                               |
266 +=======================================+===============+===========================================================+
267 | test_dual_ports_dhcp                  | Nova 2        | Ensures that a VM with two ports/NICs can have its second |
268 |                                       | Neutron 2     | NIC configured via SSH/Ansible after startup              |
269 +---------------------------------------+---------------+-----------------------------------------------------------+
270
271 create_instance_tests.py - InstanceSecurityGroupTests
272 -----------------------------------------------------
273
274 +---------------------------------------+---------------+-----------------------------------------------------------+
275 | Test Name                             | API Versions  | Description                                               |
276 +=======================================+===============+===========================================================+
277 | test_add_security_group               | Nova 2        | Ensures that a VM instance can have security group added  |
278 |                                       | Neutron 2     | to it while its running                                   |
279 +---------------------------------------+---------------+-----------------------------------------------------------+
280 | test_add_invalid_security_group       | Nova 2        | Ensures that a VM instance does not accept the addition of|
281 |                                       | Neutron 2     | a security group that no longer exists                    |
282 +---------------------------------------+---------------+-----------------------------------------------------------+
283 | test_remove_security_group            | Nova 2        | Ensures that a VM instance accepts the removal of a       |
284 |                                       | Neutron 2     | security group                                            |
285 +---------------------------------------+---------------+-----------------------------------------------------------+
286 | test_remove_security_group_never_added| Nova 2        | Ensures that a VM instance does not accept the removal of |
287 |                                       | Neutron 2     | a security group that was never added in the first place  |
288 +---------------------------------------+---------------+-----------------------------------------------------------+
289 | test_add_same_security_group          | Nova 2        | Ensures that a VM instance does not add a security group  |
290 |                                       | Neutron 2     | that has already been added to the instance               |
291 +---------------------------------------+---------------+-----------------------------------------------------------+
292
293 ansible_utils_tests.py - AnsibleProvisioningTests
294 -------------------------------------------------
295
296 +---------------------------------------+---------------+-----------------------------------------------------------+
297 | Test Name                             | API Versions  | Description                                               |
298 +=======================================+===============+===========================================================+
299 | test_apply_simple_playbook            | Nova 2        | Ensures that an instance assigned with a floating IP will |
300 |                                       | Neutron 2     | apply a simple Ansible playbook                           |
301 +---------------------------------------+---------------+-----------------------------------------------------------+
302 | test_apply_template_playbook          | Nova 2        | Ensures that an instance assigned with a floating IP will |
303 |                                       | Neutron 2     | apply a Ansible playbook containing Jinga2 substitution   |
304 |                                       |               | values                                                    |
305 +---------------------------------------+---------------+-----------------------------------------------------------+