Merge "Add Rally based bench scenario for OPNFV Add md document to explain how to...
[functest.git] / testcases / VIM / OpenStack / OpenStack.md
1 # Rally tests for OpenStack
2
3 Original Rally testsuites can be found here: https://github.com/stackforge/rally 
4
5 ---
6 ## Intro
7 In order to perform functional and performance testing, we use a dedicated VM.
8
9     TODO: add test-tool VM in architecture and puppetise test-tool VM
10
11 On this VM, we installed:
12 * Rally: https://wiki.openstack.org/wiki/Rally
13
14     TODO RobotFramework: http://robotframework.org, SIPP http://sipp.sourceforge.net/
15
16
17
18 ## Installation & Configuration
19
20 ### Rally
21
22 * Log on the test-tool VM
23 * install Rally (https://rally.readthedocs.org/en/latest/tutorial/step_0_installation.html)
24
25 openrc file (info from OpenStack) is needed, password is required during configuration procedure
26
27 * check 
28 ```bash
29 # rally deployment check
30 keystone endpoints are valid and following service are available:
31 +-------------+-----------+------------+
32 | Services  | Type        | Status     |
33 +-----------+-------------+------------+
34 | cinder    | volume      | Available  |
35 | cinderv2  | volumev2    | Available  |
36 | glance    | image       | Available  |
37 | keystone  | identity    | Available  | 
38 | neutron   | network     | Available  |
39 | nova      | compute     | Available  |
40 | nova_ec2  | compute_ec2 | Available  |
41 | novav3    | computev3   | Available  |
42 +-----------+-------------+------------+
43
44 ```
45
46 * For Rally scenario, follow https://rally.readthedocs.org/en/latest/tutorial/step_1_setting_up_env_and_running_benchmark_from_samples.html
47 ```bash
48 # rally task start ./samples/tasks/scenarios/nova/my-boot-and-delete.json 
49 --------------------------------------------------------------------------------
50  Preparing input task
51 --------------------------------------------------------------------------------
52
53 Input task is:
54 {
55     "NovaServers.boot_and_delete_server": [
56         {
57             "args": {
58                 "flavor": {
59                     "name": "m1.small"
60                 },
61                 "image": {
62                     "name": "^ubuntu-14.10-64b"
63                 },
64                 "force_delete": false
65             },
66             "runner": {
67                 "type": "constant",
68                 "times": 10,
69                 "concurrency": 2
70             },
71             "context": {
72                 "users": {
73                     "tenants": 3,
74                     "users_per_tenant": 2
75                 }
76             }
77         }
78     ]
79 }
80
81 --------------------------------------------------------------------------------
82  Task  f42c8aed-00a6-4715-9951-945b4fb97c32: started
83 --------------------------------------------------------------------------------
84
85 Benchmarking... This can take a while...
86
87 To track task status use:
88
89         rally task status
90         or
91         rally task detailed
92         
93 --------------------------------------------------------------------------------
94 Task f42c8aed-00a6-4715-9951-945b4fb97c32: finished
95 --------------------------------------------------------------------------------
96
97 test scenario NovaServers.boot_and_delete_server
98 args position 0
99 args values:
100 OrderedDict([(u'runner', OrderedDict([(u'type', u'constant'), (u'concurrency', 2), (u'times', 10)])), (u'args', OrderedDict([(u'force_delete', False), (u'flavor', OrderedDict([(u'name', u'm1.small')])), (u'image', OrderedDict([(u'name', u'^ubuntu-14.10-64b')]))])), (u'context', OrderedDict([(u'users', OrderedDict([(u'project_domain', u'default'), (u'users_per_tenant', 2), (u'tenants', 3), (u'resource_management_workers', 30), (u'user_domain', u'default')]))]))])
101 +--------------------+-----------+-----------+-----------+---------------+---------------+---------+-------+
102 | action             | min (sec) | avg (sec) | max (sec) | 90 percentile | 95 percentile | success | count |
103 +--------------------+-----------+-----------+-----------+---------------+---------------+---------+-------+
104 | nova.boot_server   | 4.675     | 5.554     | 6.357     | 6.289         | 6.323         | 100.0%  | 10    |
105 | nova.delete_server | 2.365     | 3.301     | 4.728     | 4.553         | 4.64          | 100.0%  | 10    |
106 | total              | 7.303     | 8.857     | 10.789    | 10.543        | 10.666        | 100.0%  | 10    |
107 +--------------------+-----------+-----------+-----------+---------------+---------------+---------+-------+
108 Load duration: 45.7972288132
109 Full duration: 58.912060976
110
111 HINTS:
112 * To plot HTML graphics with this data, run:
113         rally task report f42c8aed-00a6-4715-9951-945b4fb97c32 --out output.html
114
115 * To get raw JSON output of task results, run:
116         rally task results f42c8aed-00a6-4715-9951-945b4fb97c32
117
118 Using task: f42c8aed-00a6-4715-9951-945b4fb97c32
119
120 ```
121 * For Tempest, follow the instructions https://www.mirantis.com/blog/rally-openstack-tempest-testing-made-simpler
122 * In first step Rally scenario were fine but Tempest scenarios failed due to configuration
123 Apply patch https://review.openstack.org/#/c/163330/
124 ```bash
125 pip uninstall rally && cd ./rally && python setup.py install
126 ```
127
128 You shall be able to run Rally/Tempest towards your OpenStack
129 ```bash
130 root@rally:~/rally# rally verify start
131 [...]
132 tempest.api.volume.test_volumes_negative.VolumesV2NegativeTest
133     test_attach_volumes_with_nonexistent_volume_id[compute,gate,id-f5e56b0a-5d02-43c1-a2a7-c9b792c2e3f6,negative]FAIL
134     test_create_volume_with_invalid_size[gate,id-1ed83a8a-682d-4dfb-a30e-ee63ffd6c049,negative]OK  0.02
135     test_create_volume_with_nonexistent_snapshot_id[gate,id-0c36f6ae-4604-4017-b0a9-34fdc63096f9,negative]OK  0.04
136     test_create_volume_with_nonexistent_source_volid[gate,id-47c73e08-4be8-45bb-bfdf-0c4e79b88344,negative]OK  0.05
137     test_create_volume_with_nonexistent_volume_type[gate,id-10254ed8-3849-454e-862e-3ab8e6aa01d2,negative]OK  0.02
138     test_create_volume_with_out_passing_size[gate,id-9387686f-334f-4d31-a439-33494b9e2683,negative]OK  0.02
139     test_create_volume_with_size_negative[gate,id-8b472729-9eba-446e-a83b-916bdb34bef7,negative]OK  0.02
140 [...]
141 Ran 933 tests in 1020.200s
142
143 FAILED (failures=186)
144 Test set 'full' has been finished with error. Check log for details
145
146 ```
147
148 It is possible to get a better view on the result
149 ```bash
150 # rally verify list
151 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------------+----------+
152 | UUID                                 | Deployment UUID                      | Set name | Tests | Failures | Created at                 | Duration       | Status   |
153 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------------+----------+
154 | b1de3608-dbee-40e7-84c4-1c756ca0347c | e7d70ddf-9be0-4681-9456-aa8dce515e0e | None     | 0     | 0        | 2015-03-11 08:48:04.416793 | 0:00:00.102275 | running  |
155 | ff0d9285-184f-47d5-9474-7475135ae8cf | e7d70ddf-9be0-4681-9456-aa8dce515e0e | full     | 933   | 186      | 2015-03-11 09:57:01.836611 | 0:18:08.360204 | finished |
156 | fec2fd0a-a4ef-4064-a292-95e9da68025c | e7d70ddf-9be0-4681-9456-aa8dce515e0e | full     | 933   | 186      | 2015-03-12 09:46:40.818691 | 0:17:02.316443 | finished |
157 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------------+----------+
158
159 rally verify show fec2fd0a-a4ef-4064-a292-95e9da68025c
160 Total results of verification:
161
162 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
163 | UUID                                 | Deployment UUID                      | Set name | Tests | Failures | Created at                 | Status   |
164 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
165 | fec2fd0a-a4ef-4064-a292-95e9da68025c | e7d70ddf-9be0-4681-9456-aa8dce515e0e | full     | 933   | 186      | 2015-03-12 09:46:40.818691 | finished |
166 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
167
168 Tests:
169
170 +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------+
171 | name                                                                                                                                                                                                      | time      | status |
172 +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------+
173 | tearDownClass (tempest.api.image.v1.test_images.CreateRegisterImagesTest)                                                                                                                                 | 0.0       | FAIL   |
174 | tearDownClass (tempest.api.image.v1.test_images.UpdateImageMetaTest)                                                                                                                                      | 0.0       | FAIL   |
175 [...]
176 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_quota_show[id-18166673-ffa8-4df3-b60c-6375532288bc]                                                            | 1.309555  | OK     |
177 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_rate_limits[id-b2c66ed9-ca96-4dc4-94cc-8083e664e516]                                                           | 1.277704  | OK     |
178 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_region_list[id-95a2850c-35b4-4159-bb93-51647a5ad232]                                                           | 1.105877  | FAIL   |
179 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_retries_list[id-6d97fcd2-5dd1-429d-af70-030c949d86cd]                                                          | 1.306407  | OK     |
180 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_service_list[id-301b5ae1-9591-4e9f-999c-d525a9bdf822]                                                          | 1.24909   | OK     |
181 | tempest.cli.simple_read_only.volume.test_cinder.SimpleReadOnlyCinderClientTest.test_cinder_snapshot_list[id-7a19955b-807c-481a-a2ee-9d76733eac28]                                                         | 1.270242  | OK     |
182 [...]
183 | tempest.thirdparty.boto.test_s3_ec2_images.S3ImagesTest                                                                                                                                                   | 0.0       | SKIP   |
184 | tempest.thirdparty.boto.test_s3_objects.S3BucketsTest.test_create_get_delete_object[id-4eea567a-b46a-405b-a475-6097e1faebde]                                                                              | 0.239222  | FAIL   |
185 +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------+
186
187 ```
188 Rally includes a reporting tool
189 https://rally.readthedocs.org/en/latest/tutorial/step_1_setting_up_env_and_running_benchmark_from_samples.html
190
191
192
193
194
195 ## Test description
196
197 ### Rally
198
199 By default, the different Rally Scenarios are:
200 ```bash
201
202 ls samples/tasks/scenarios/
203 authenticate  cinder     dummy   heat      mistral  nova    README.rst  sahara                                 vm
204 ceilometer    designate  glance  keystone  neutron  quotas  requests    tempest-do-not-run-against-production  zaqar
205
206 ```
207
208 tempest tests can be retrieved at https://github.com/openstack/tempest
209
210
211 ## Automation