社区对OpenStack平台功能性的测试工具采用Tempest,性能测试采用Rally。

1、什么是Tempest

tempest
├── api # API的测试集
├── cli # OpenStack的命令行工具测试集
├── common # 一些公共的工具类和函数
├── scenario # 对OpenStack的常用场景进行测试,包括基本的启动VM,挂载volumn和网络配置等
├── services # tempest自己实现的OpenStack API Client,自己实现是为了不让一些bug隐藏在官方实现的Client里面。
├── stress # 压力测试集,利用multiprocessing来启动多个进程来同时对OpenStack发起请求。
├── thirdparty # EC2兼容的API测试集
├── whitebox # 白盒测试集,主要是对DB操作,然后发起请求,然后比对结果
2、tempest是通过nose驱动的,python语言编写,使用testtools和testresources等几个测试工具库
3、tempest.test.BaseTestCase,BaseTestCase声明config属性,读取配置文件
4、tempest.test.TestCase声明很多工具函数,供调用
5、每个测试可以分别测试JSON格式和XML格式

2、安装Tempest

##下载源码

git clone https://github.com/openstack/tempest.git
cd tempest
vim requirements.txt
##添加
discover>=0.4.0

###查看python版本

python --version

###如若是2.6执行如下,2.7不需要

wget https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz
tar zxvf unittest2-0.5.1.tar.gz
cd unittest2-0.5.1
python setup.py install

###查看xslt-config命令是否存在

[root@controller001 ~]# whereis xslt-config
xslt-config: /usr/bin/xslt-config(代表存在)

###如果没有执行安装命令


[root@controller001 ~]#yum install libxslt-devel

###检查是否有gcc环境,没有则安装


[root@controller001 ~]#yum install gcc-c++

###安装一些相关的包


[root@controller001 ~]#yum install libevent-devel openssl-devel libffi-devel python-devel
[root@controller001 ~]#/usr/bin/easy_install pip

###进入tempest目录进行安装(没有安装虚拟机环境)

[root@controller001 ~]#python setup.py install

(可选)###如果不想将tempest安装在真实环境中那么执行如下命令

[root@controller001 ~]#pip install -U virtualenv
[root@controller001 ~]#virtualenv .venv
[root@controller001 ~]#. .venv/bin/activate
[root@controller001 ~]#python setup.py install

###安装junitxml,是测试报告输出为xml格式

[root@controller001]#pip install junitxml

###由于tempest在Icehouse时期上使用是有bug的,bug如下:

###在/root/tempest/tempest/openstack/common/log.py文件下添加

注意:在Juno版本时期,此bug已修复,故而可以跳过。

###修改tempest.conf文件,注意创建外网的时候不要共享,否则在测试启动虚拟机以及进行网络测试的时候会报错

cp etc/tempest.conf.sample etc/tempest.conf
[root@controller001 etc]# egrep "^[^#]" tempest.conf
[DEFAULT]
lock_path =keystone
[auth]
[baremetal]
[boto]
[cli]
cli_dir = /usr/bin (是否测试cli命令)
enabled=true
[compute]
catalog_type= compute (keystone service-list命令显示type的值)
endpoint_type = publicURL (keystone endpoint-list命令显示)
fixed_network_name=53f6877e-2f46-43e3-93b7-7e22786cacb2
flavor_ref = 1
flavor_ref_alt = 2
floating_ip_range = 172.16.101.0/24
image_ref = 7e4b08b4-d7a1-4eff-9757-25e2234ca4db (镜像id)
image_ref_alt = 7e4b08b4-d7a1-4eff-9757-25e2234ca4db
region =RegionOne (与keystone endpoint-list命令列出值region值相同)
ssh_user = root
use_floatingip_for_ssh = true
volume_device_name = vdb (挂载云硬盘)
[compute-admin]
domain_name = nova
password =admin
tenant_name = admin
username = admin
[compute-feature-enabled]
live_migration = true
rescue = true
resize = true
shelve = true
snapshot = true
suspend = true
vnc_console = true
[dashboard]
dashboard_url = http://172.16.100.162/dashboard/
login_url = http://172.16.100.162/auth/login/
[data_processing]
[database]
[debug]
[identity] (keystone方面的配置)
admin_password = admin
admin_role = admin
admin_tenant_name = admin
admin_username = admin
alt_password = tempest
alt_tenant_name = tempest
alt_username = tempest
catalog_type = identity
endpoint_type = publicURL
password = admin
region = RegionOne
tenant_name = admin
uri = http://172.16.100.162:35357/v2.0
uri_v3 = 172.16.100.162
username = admin
[identity-feature-enabled]
api_v2 = true
api_v3 = true
[image] (glance方面的配置)
catalog_type = image
endpoint_type = publicURL
http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz
region =RegionOne
[image-feature-enabled]
api_v1 = true
api_v2 = true
[input-scenario]
[messaging]
[negative]
catalog_type = network
dns_servers = 8.8.8.8,8.8.4.4
endpoint_type = publicURL
public_network_id =53f6877e-2f46-43e3-93b7-7e22786cacb2
public_router_id =ac4a4d9b-27c7-492b-824a-ae384710ab2a
region =RegionOne
tenant_network_cidr = 10.100.0.0/16
tenant_network_mask_bits = 28
tenant_networks_reachable = true
[network-feature-enabled]
[object-storage]
[object-storage-feature-enabled]
[orchestration]
[scenario]
[service_available] (这里配置需要测试哪些模块)
ceilometer = false
cinder = true
glance = true
heat = false
horizon = true
ironic = false
neutron = true
nova = true
sahara = false
swift = false
trove = false
zaqar = false
[stress]
[telemetry]
[volume]
[volume-feature-enabled]
multi_backend =true (测试cinder的后端存储有多个backend)

###修改好配置文件之后,进行测试(以测试keystone当中token为例)

[root@controller001 tempest]# nosetests tempest/api/identity/admin/test_tokens.py --with-xunit --xunit-file=/root/keystone_test_tokens.xml

----------------------------------------------------------------------
Ran 2 tests in 1.532s

OK

[root@controller001 ~]# cat keystone_test_tokens.xml
<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="2" errors="0" failures="0" skip="0"><testcase classname="tempest.api.identity.admin.test_tokens.TokensTestJSON" name="test_create_get_delete_token[gate]" time="0.270"><system-out><![CDATA[I want to the url'value and body's value tenants,{"tenant": {"enabled": true, "name": "tenant--1612865724", "description": ""}}
I want to the url'value and body's value users,{"user": {"tenantId": "b8f636519ff949d19405e59fce2f78ac", "password": "pass--1460623961", "name": "user--1945966900", "email": ""}}
I want to the url'value and body's value http://172.16.100.162:35357/v2.0/tokens,{"auth": {"tenantName": "tenant--1612865724", "passwordCredentials": {"username": "user--1945966900", "password": "pass--1460623961"}}}
]]></system-out></testcase><testcase classname="tempest.api.identity.admin.test_tokens.TokensTestJSON" name="test_rescope_token[gate]" time="0.526"><system-out><![CDATA[I want to the url'value and body's value users,{"user": {"password": "pass--46178537", "name": "user--996425809", "email": ""}}
I want to the url'value and body's value tenants,{"tenant": {"enabled": true, "name": "tenant--781047271", "description": ""}}
I want to the url'value and body's value tenants,{"tenant": {"enabled": true, "name": "tenant--1886860973", "description": ""}}
I want to the url'value and body's value OS-KSADM/roles,{"role": {"name": "role--684861165"}}
I want to the url'value and body's value http://172.16.100.162:35357/v2.0/tokens,{"auth": {"passwordCredentials": {"username": "user--996425809", "password": "pass--46178537"}}}
I want to the url'value and body's value http://172.16.100.162:35357/v2.0/tokens,{"auth": {"token": {"id": "MIIDLgYJKoZIhvcNAQcCoIIDHzCCAxsCAQExCTAHBgUrDgMCGjCCAYQGCSqGSIb3DQEHAaCCAXUEggFxeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMS0yMlQwNTo1MDowNy42NDg5NjIiLCAiZXhwaXJlcyI6ICIyMDE1LTAxLTIyVDA2OjUwOjA3WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJhdWRpdF9pZHMiOiBbIkpIZ0U0eDgwVFJXSkJORjJFUjdXV3ciXX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFtdLCAidXNlciI6IHsidXNlcm5hbWUiOiAidXNlci0tOTk2NDI1ODA5IiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICI4OGQwNGVkZmU0YWE0MmEyYWUzZWQxZjAyNzVmYWQ3NCIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJ1c2VyLS05OTY0MjU4MDkifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFtdfX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBAAjoxz4e-hnwHy45cd+o3tgQI1SdvidiOIfRrDAg5hMc0Fn9pGxnt-fYmZIBRH9b0LMjkjJa32OO2M0xmlcwCmaALsMMpBk5ouaECzNEJNGb2UyFW6Lpi5r5seM5HBO40brE0muMraOnzoRqkmGijEXf0RDn84iFrX40pvwo-htACNsB9fm1BkqUg8A+ANOJNHRGnqY80fIj+ipp5-53drN0VxbakHZvYJHAut5GsOdK-+TThj3fvbDA1fM-wa-SmZNV7xl-X8F9NChbe7VV3AFdE4XQHpdFZr+c4ZEDGlcq6VVRyD0OpeM2Nt9GbN8gevNWJpK2qjVJ2dxXgCZnDZg="}, "tenantName": "tenant--781047271"}}
I want to the url'value and body's value http://172.16.100.162:35357/v2.0/tokens,{"auth": {"token": {"id": "MIIDLgYJKoZIhvcNAQcCoIIDHzCCAxsCAQExCTAHBgUrDgMCGjCCAYQGCSqGSIb3DQEHAaCCAXUEggFxeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMS0yMlQwNTo1MDowNy42NDg5NjIiLCAiZXhwaXJlcyI6ICIyMDE1LTAxLTIyVDA2OjUwOjA3WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJhdWRpdF9pZHMiOiBbIkpIZ0U0eDgwVFJXSkJORjJFUjdXV3ciXX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFtdLCAidXNlciI6IHsidXNlcm5hbWUiOiAidXNlci0tOTk2NDI1ODA5IiwgInJvbGVzX2xpbmtzIjogW10sICJpZCI6ICI4OGQwNGVkZmU0YWE0MmEyYWUzZWQxZjAyNzVmYWQ3NCIsICJyb2xlcyI6IFtdLCAibmFtZSI6ICJ1c2VyLS05OTY0MjU4MDkifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFtdfX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBAAjoxz4e-hnwHy45cd+o3tgQI1SdvidiOIfRrDAg5hMc0Fn9pGxnt-fYmZIBRH9b0LMjkjJa32OO2M0xmlcwCmaALsMMpBk5ouaECzNEJNGb2UyFW6Lpi5r5seM5HBO40brE0muMraOnzoRqkmGijEXf0RDn84iFrX40pvwo-htACNsB9fm1BkqUg8A+ANOJNHRGnqY80fIj+ipp5-53drN0VxbakHZvYJHAut5GsOdK-+TThj3fvbDA1fM-wa-SmZNV7xl-X8F9NChbe7VV3AFdE4XQHpdFZr+c4ZEDGlcq6VVRyD0OpeM2Nt9GbN8gevNWJpK2qjVJ2dxXgCZnDZg="}, "tenantName": "tenant--1886860973"}}
]]></system-out></testcase></testsuite>

若有不足之处,欢迎批评指正!

相关链接:http://www.oschina.net/question/129540_146999

http://docs.openstack.org/developer/tempest/configuration.html

OpenStack平台功能性测试工具Tempest安装的更多相关文章

  1. Linux压力测试工具Tsung安装、使用和图形报表生成

    简介 Tsung 是一个压力测试工具,可以测试包括HTTP, WebDAV, PostgreSQL, MySQL, LDAP, and XMPP/Jabber等服务器.针对 HTTP 测试,Tsung ...

  2. python的web压力测试工具-pylot安装使用

    http://blog.csdn.net/chenggong2dm/article/details/10106517 pylot是python编写的一款web压力测试工具.使用比较简单.而且测试结果相 ...

  3. 网站压力测试工具webbench 安装与使用

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好用,安装使用也特别方便,并且非常小. 主要是 -t 参数用着比较爽,下面参考了张宴的文章 ...

  4. CentOS压力测试工具Tsung安装和图形报表生成Tsung安装配置

    Tsung 是一个压力测试工具,可以测试包括HTTP, WebDAV, PostgreSQL, MySQL, LDAP, and XMPP/Jabber等服务器.针对 HTTP 测试,Tsung 支持 ...

  5. Linux:linux服务器稳定性压力测试工具stress安装与使用

    stress是一个linux下的压力测试工具,专门为那些想要测试自己的系统,完全高负荷和监督这些设备运行的用户. 1. stress1.0.4下载地址 下载:https://fossies.org/l ...

  6. PICT测试工具的安装及使用

    PICT工具就是在微软公司出品一款成对组合的命令行生成工具,现在已经对外提供,可以在互联网上下载到 .PICT 可以有效地按照两两测试的原理,进行测试用例设计.在使用PICT时,需要输入与测试用例相关 ...

  7. windows下Jmeter压力测试工具的安装

    JMeter是Apache软件基金会的产品,用于对静态的和动态的资源(文件,Servlet,Perl脚本,Java 对象,数据库和查询,FTP服务器等等)的性能进行测试.是一款很方便的测试软件. 系统 ...

  8. laravel的测试工具debug安装:

    在项目根目录执行: composer require barryvdh/laravel-debugbar --dev

  9. 测试工具APPScan安装与使用教程

随机推荐

  1. msf记录

    生成backdoor msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.187.133 LPORT=6666 -f exe >/ ...

  2. Linux递归压缩图片脚本

    1 压缩图片 使用ImageMagick的convert命令进行压缩图片,一般只需要一个指定压缩质量的参数,比如: convert -quality 75 1.jpg 1_compress.jpg 可 ...

  3. selenium启动IE失败,并报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones

    1.selenium去启动IE时,报错: Started InternetExplorerDriver server (32-bit)2.50.0.0Listening on port 24641On ...

  4. 如何查看显著性SNP在数据中的频率?

    我们做完GWAS的关联分析后需要查看显著性SNP在我们数据中的频率分布情况.这时候我们需要用到plink和我们做关系分析所用的二进制文件datas. 第一步,我们用R语言读取分析结果,即*.assoc ...

  5. 使用yamllint 检查yaml语法

    安装node 之后npm install -g yaml-lint 使用方法 yamllint confluence.yaml

  6. 也谈如何写一个Webserver(-)

    关于如何写一个Webserver,很多大咖都发表过类似的文章.趁着这个五一假期,我也来凑个份子. 我写Webserver的原因,还得从如何将http协议传送的消息解析说起.当时,我只是想了解一下htt ...

  7. 【死磕JVM】看完这篇我也会排查JVM内存过高了 就是玩儿!

    前言 CPU 是时分的,操作系统里面有很多线程,每个线程的运行时间由CPU决定,CPU会分给每一个线程一个时间片,时间片是一个很短的时间长度,如果在时间片内,线程一直占有,就是100%,我们应该意识到 ...

  8. Thinkphp树形菜单相关方法

    1 <?php 2 3 /** 4 * Menu(菜单管理) 5 */ 6 namespace Admin\Controller; 7 use Common\Controller\Adminba ...

  9. 【Vue】Vue学习(四)-状态管理中心Vuex的简单使用

    一.vuex的简介 Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式.Vuex背后的基本思想,就是前面所说的单向数据流.图4就是Vuex实现单向数据流的示意图.    Store     ...

  10. hdu4421 2-sat(枚举二进制每一位)

    题意:       给你一个数组b[][],在给你一些关系,问是否可以找到一个满足限制的a[], 关系如下(图片): 思路:       说到限制,而且还是两个两个之间的限制,那么很容易想到2-sat ...