jmeter3.2 测试openstack-kilo cinder 的rest api
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jmeter3.2 测试openstack-kilo cinder 的rest api相关的知识,希望对你有一定的参考价值。
1.参考
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://www.cnblogs.com/TingJie/articles/5198505.html
2.cinder api 测试
1》获取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.首先创建线程组
2.基本上每个接口涉及到poject_id,用户可自定义变量
线程组-添加-配置元件-用户自定义变量
根据自己测试需求测试某个项目,就
3.设置http请求默认值(输入openstack管理系统的ip地址)
4.设置http信息头
a》先添加:线程组-添加-配置元件-http信息头管理器
b》添加:Content-Type: application/json
c》通过请求获取到token的id,将其写入
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‘
5.开始接口请求
a>.(前提openstack里面有vm)获取vms,为以后attach volume to vm or deatach volume from vm
得到某个vm的id
b》(前提openstack里面有image)获取img,为以后从img 创建volume
得到某个img的id
c》获得所有项目(这个只是为了记住这个接口请求与cinder可以不写这个借口)
d》获取volumes
简单获取
详细获取
e》创建卷
得到创建卷的id
{
"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》查看某个卷详情
f》扩容卷,由于创建卷有一个过程,之间得等待一些时间,可以添加定时器
用到了参数关联
{
"os-extend": {
"new_size": 10
}
}
g》卷创建快照(用了参数关联)
h》查看snap
列出
详细列出
详细列出某个
i》从快照创建卷
{
"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》从img创建卷
{
"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
{
"os-volume_upload_image": {
"container_format": "bare",
"force": false,
"image_name": "jicy-img",
"disk_format": "raw"
}
}
l》create volume from volume
{
"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
n》delete snap
本文出自 “xiaocaoer” 博客,请务必保留此出处http://11211989.blog.51cto.com/2386238/1982523
以上是关于jmeter3.2 测试openstack-kilo cinder 的rest api的主要内容,如果未能解决你的问题,请参考以下文章
jmeter3.2版本如何进行webservice接口功能测试
jmeter3.2 测试openstack-kilo cinder 的rest api
Jmeter3.2版本中Generating Report Dashboard功能浅析
JMeter4.0学习之SoapUI创建WebService接口模拟服务端以及JMeter测试SOAP协议性能测试脚本开发