Tuesday, May 19, 2015

Testing OpenStack REST API using JMeter

OpenStack provides numerous REST APIs for managing various tasks and fetching information. Project website provides a well written API document which can be found here.
APIs are classified based on components and version numbers.


While creating API end points, we need to give  three different URLs namely public, internal and admin and level of access for these endpoints are defined in keystone-paste.ini file.

1. Download JMeter from http://jmeter.apache.org/ and extract the archive.

2. Download JMeter plugins from http://jmeter-plugins.org/ and extract the content into JMeter directory.

3. Create a new JMeter test plan and add "Thread Group" controller with single thread.



4. Add "HTTP Header Manager" Config Element.



5.  In HTTP Request sampler, configure server ip, port  and REST request(In Body Data field).




6.  Configure JSON Path to extract the toke id.



7. Now configure another HTTP Request control to send the API request to the Nova node. Here HTTP request type is GET.



Save the configuration and click on run button. First JMeter will fire a request to Keystone endpoint and token id is obtained. Later token id is extracted using JSon Path and passed to the second API. You can view the results in Result tree.

No comments:

Post a Comment