jmeter3.2 Testing the rest API for Openstack-kilo Cinder

Source: Internet
Author: User

1. Reference


Http://www.aboutyun.com/thread-12002-1-1.html

Http://www.cnblogs.com/biangbiang/archive/2013/02/01/2888800.html

http://blog.csdn.net/nirendao/article/details/54977717

Http://www.cnblogs.com/littlebugfish/p/4027061.html

http://blog.csdn.net/lifeifei2010/article/details/8148793

Http://itfish.net/article/47307.html

http://blog.csdn.net/zhaoeryi/article/details/38980523?locationNum=6&fps=1http://blog.csdn.net/zhaoeryi/ Article/details/38980523?locationnum=6&fps=1

Http://www.cnblogs.com/TingJie/articles/5198505.html


2.cinder API Testing

1 "Get token

Curl-k-X ' POST '-v http://192.168.1.76:5000/v2.0/tokens-d ' {"auth": {"passwordcredentials": {"username": "admin", " Password ":" Password "}," TenantId ":" 82849a9c50604d62ab1c229ef0f7631e "}} '-H ' content-type:application/json '

1. Create a thread group first

2. Basically each interface involves poject_id, the user can customize the variable

Thread groups-add-Configure symbols-user-defined variables

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/b591a108cf759e13f4514499d26f800b.png-wh_500x0-wm_3 -wmp_4-s_4280474453.png "title=" 1.png "alt=" B591a108cf759e13f4514499d26f800b.png-wh_ "/>

Test a project based on your own testing needs,

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/b02510211d9b0db975c4f82932ac00f3.png-wh_500x0-wm_3 -wmp_4-s_2052795209.png "title=" 2.png "alt=" B02510211d9b0db975c4f82932ac00f3.png-wh_ "/>

3. Set the HTTP request default value (enter the IP address of the OpenStack management system)

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/ad96c5f7d8e88593b423aae4a8fb06b4.png-wh_500x0-wm_3 -wmp_4-s_865822084.png "title=" 3.png "alt=" Ad96c5f7d8e88593b423aae4a8fb06b4.png-wh_ "/>

4. Set HTTP Headers

A "Add first: Thread group-add-Configure a component-http Information header Manager

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/16/b7109ccfca4b69d1cda62cbc9e186daf.png-wh_500x0-wm_3 -wmp_4-s_63993288.png "title=" 4.png "alt=" B7109ccfca4b69d1cda62cbc9e186daf.png-wh_ "/>

B "added: Content-type:application/json

C "By requesting the token ID, write it to

Curl-k-X ' POST '-v http://192.168.1.76:5000/v2.0/tokens-d ' {"auth": {"passwordcredentials": {"username": "admin", " Password ":" Password "}," TenantId ":" 82849a9c50604d62ab1c229ef0f7631e "}} '-H ' content-type:application/json '

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/f31d0ccb00a62d6ad86373c13984ae11.png-wh_500x0-wm_3 -wmp_4-s_2238534300.png "title=" 5.png "alt=" F31d0ccb00a62d6ad86373c13984ae11.png-wh_ "/>

5. Start the interface request

A>. (Provided that OpenStack has VMS inside) get VMS for later attach volume to VM or Deatach volume from VM

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/896709531792a5496b6dc156c819b9a6.png-wh_500x0-wm_3 -wmp_4-s_2745393127.png "title=" 6.png "alt=" 896709531792a5496b6dc156c819b9a6.png-wh_ "/>

Get the ID of a VM

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/af9663a5732d555eec3d3acd8da67f71.png-wh_500x0-wm_3 -wmp_4-s_548004613.png "title=" 7.png "alt=" Af9663a5732d555eec3d3acd8da67f71.png-wh_ "/>

B (if there is an image in OpenStack) get IMG To create Volume from IMG later

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/4cc12002cfa90bd17b269379bb81eeb8.png-wh_500x0-wm_3 -wmp_4-s_388438698.png "title=" 8.png "alt=" 4cc12002cfa90bd17b269379bb81eeb8.png-wh_ "/>

Get the ID of an img

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/16/c8d7813cd862d026c795e5bf50bf2d6a.png-wh_500x0-wm_3 -wmp_4-s_3724376512.png "title=" 9.png "alt=" C8d7813cd862d026c795e5bf50bf2d6a.png-wh_ "/>

C "Get all items (this is just to remember this interface request with Cinder can not write this excuse)

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/16/c392bc1e4cd541cf236fa8e0d07a5328.png-wh_500x0-wm_3 -wmp_4-s_293598812.png "title=" 10.png "alt=" C392bc1e4cd541cf236fa8e0d07a5328.png-wh_ "/>

D "Get volumes

Easy access

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/5ec5664dbf71886fc32c5cf2c8d94eec.png-wh_500x0-wm_3 -wmp_4-s_4107726247.png "title=" 12.png "alt=" 5ec5664dbf71886fc32c5cf2c8d94eec.png-wh_ "/>

Get more

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/7ec0db81538bef567eb8a5a54108f1e5.png-wh_500x0-wm_3 -wmp_4-s_2004630796.png "title=" 13.png "alt=" 7ec0db81538bef567eb8a5a54108f1e5.png-wh_ "/>

E "Create a volume

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/16/9690c768a1ba82353ec37ca69fbd820d.png-wh_500x0-wm_3 -wmp_4-s_3884216114.png "title=" 14.png "alt=" 9690c768a1ba82353ec37ca69fbd820d.png-wh_ "/>

Get the ID of the created volume

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/92a0871abf1bf97bc2edcf9818268a93.png-wh_500x0-wm_3 -wmp_4-s_1056114028.png "title=" 15.png "alt=" 92a0871abf1bf97bc2edcf9818268a93.png-wh_ "/>

{

"Volume": {

"Size": 1,

"Availability_zone": null,

"Source_volid": null,

"description": null,

"Multiattach": false,

"snapshot_id": null,

"Name": "Testlilac",

"Imageref": null,

"Volume_type": null,

"Metadata": {},

"consistencygroup_id": null

}

}

E "View a volume details

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/16/99080f28ccd19f583daa8be0ee2ae1d1.png-wh_500x0-wm_3 -wmp_4-s_1104613213.png "title=" 16.png "alt=" 99080f28ccd19f583daa8be0ee2ae1d1.png-wh_ "/>

F "Expansion volume, because there is a process to create a volume, you have to wait for some time, you can add a timer

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/16/ca26812ee92a6dcd8e2e02fd7febb83a.png-wh_500x0-wm_3 -wmp_4-s_1773563942.png "title=" 17.png "alt=" Ca26812ee92a6dcd8e2e02fd7febb83a.png-wh_ "/>

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/c34e9ea684331a15521b2631129730c3.png-wh_500x0-wm_3 -wmp_4-s_973742626.png "title=" 18.png "alt=" C34e9ea684331a15521b2631129730c3.png-wh_ "/>

Parameter correlation was used

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/466960e074b60ae11e8a54e144749545.png-wh_500x0-wm_3 -wmp_4-s_1226479027.png "title=" 19.png "alt=" 466960e074b60ae11e8a54e144749545.png-wh_ "/>

{

"Os-extend": {

"New_size": 10

}

}

G volume create snapshot (parameter association)

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/16/f16fd525a8e2b0fa0bd54b57c7ee41d9.png-wh_500x0-wm_3 -wmp_4-s_1205434135.png "title=" 20.png "alt=" F16fd525a8e2b0fa0bd54b57c7ee41d9.png-wh_ "/>

H "View Snap

List

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/8016c701e22ee6881f5ddfc1a00e35b4.png-wh_500x0-wm_3 -wmp_4-s_2143999912.png "title=" 21.png "alt=" 8016c701e22ee6881f5ddfc1a00e35b4.png-wh_ "/>

Detailed list

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/16/f258b1ea14c8304b0cc6ae77fa346be1.png-wh_500x0-wm_3 -wmp_4-s_2391836242.png "title=" 22.png "alt=" F258b1ea14c8304b0cc6ae77fa346be1.png-wh_ "/>

Detailed list of a

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/16/a8ed432f5e01438bd57a84b83e64d16b.png-wh_500x0-wm_3 -wmp_4-s_2247327184.png "title=" 23.png "alt=" A8ed432f5e01438bd57a84b83e64d16b.png-wh_ "/>

I create a volume from a snapshot

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/228896f1d695077ded29ecddf9dce9a6.png-wh_500x0-wm_3 -wmp_4-s_633450004.png "style=" Float:none; "title=" 24.png "alt=" 228896f1d695077ded29ecddf9dce9a6.png-wh_ "/>

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/2e5ea58666795e1d63cf280c566d5633.png-wh_500x0-wm_3 -wmp_4-s_3335015545.png "style=" Float:none; "title=" 25.png "alt=" 2e5ea58666795e1d63cf280c566d5633.png-wh_ "/>

{

"Volume": {

"Size": 10,

"Availability_zone": null,

"Source_volid": null,

"description": null,

"Multiattach": false,

"snapshot_id": "${snapshot_id}",

"Name": "V-f-snap",

"Imageref": null,

"Volume_type": null,

"Metadata": {},

"consistencygroup_id": null

}

}

J Creating volumes from img

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/60fdd6ee636c7dd14f359f3a97116653.png-wh_500x0-wm_3 -wmp_4-s_1681428318.png "title=" 26.png "alt=" 60fdd6ee636c7dd14f359f3a97116653.png-wh_ "/>

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/16/f8b19c52f2881f176b3d69a349a80349.png-wh_500x0-wm_3 -wmp_4-s_4171219440.png "title=" 27.png "alt=" F8b19c52f2881f176b3d69a349a80349.png-wh_ "/>

{

"Volume": {

"Size": 2,

"Availability_zone": null,

"Source_volid": null,

"description": null,

"Multiattach": false,

"snapshot_id": null,

"Name": "V-f-img",

"Imageref": "${img_id}",

"Volume_type": null,

"Metadata": {},

"consistencygroup_id": null

}

}

K "Copy Volume to img

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/82b4e2068870fbb3a66bef0680c4b4a5.png-wh_500x0-wm_3 -wmp_4-s_636784123.png "title=" 28.png "alt=" 82b4e2068870fbb3a66bef0680c4b4a5.png-wh_ "/>

{

"Os-volume_upload_image": {

"Container_format": "Bare",

"Force": false,

"Image_name": "Jicy-img",

"Disk_format": "Raw"

}

}

L "Create volume from volume

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/ee832b0dacc44b3d8ce822d4b22d61e5.png-wh_500x0-wm_3 -wmp_4-s_3363722767.png "title=" 29.png "alt=" Ee832b0dacc44b3d8ce822d4b22d61e5.png-wh_ "/>

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/b9b63558f6f59e3c7e9a2adfad034efa.png-wh_500x0-wm_3 -wmp_4-s_2811467706.png "title=" 30.png "alt=" B9b63558f6f59e3c7e9a2adfad034efa.png-wh_ "/>

{

"Volume": {

"Size": 10,

"Availability_zone": null,

"Source_volid": "${volume_id}",

"description": null,

"Multiattach": false,

"snapshot_id": null,

"Name": "V-f-v",

"Imageref": null,

"Volume_type": null,

"Metadata": {},

"consistencygroup_id": null

}

}

M "Delete Volume

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/16/f6dac4125c733cdcdd33c7cd7470eb51.png-wh_500x0-wm_3 -wmp_4-s_230085782.png "title=" 33.png "alt=" F6dac4125c733cdcdd33c7cd7470eb51.png-wh_ "/>

N "Delete snap

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/16/c0e070e85e37032dc03bf203e099be2e.png-wh_500x0-wm_3 -wmp_4-s_1478922123.png "title=" 34.png "alt=" C0e070e85e37032dc03bf203e099be2e.png-wh_ "/>

This article is from the "xiaocaoer" blog, make sure to keep this source http://11211989.blog.51cto.com/2386238/1982523

jmeter3.2 Testing the rest API for Openstack-kilo Cinder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.