The community's testing tools for OpenStack platform functionality are Tempest and performance tested using rally.
1. What is Tempest
Tempest
Test set for ├──API # API
├──CLI # OpenStack Command-line tool test set
├──common # Some common tools classes and functions
├──scenario # Testing common scenarios for OpenStack, including basic boot VMS, Mount Volumn and network configurations, etc.
├──services # Tempest's own implementation of the OpenStack API client is implemented to keep bugs hidden in the official implementation of the client.
├──stress # Stress test set, using multiprocessing to initiate multiple processes to initiate requests to openstack at the same time.
├──thirdparty # EC2-compliant API test set
├──whitebox # white Box test set, primarily for DB operations, then initiates the request, and then the results are compared
2, Tempest is written by nose, Python language, using TestTools and testresources a few test tools library
3. Tempest.test.basetestcase,basetestcase Declaration Config property, read configuration file
4. Tempest.test.TestCase declares many tool functions for calling
5. Each test can test JSON format and XML format separately
2, Installation Tempest
# #下载源码
git clone https:
# # #查看python版本
Python--version
# # #如若是2.6 execute as follows, 2.7 not required
wget Https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gztar ZXVF UNITTEST2-0.5.1.TAR.GZCD Unittest2-0.5.1python setup.py Install
# # #查看xslt Whether the-config command exists
[Email protected] ~]# Whereis Xslt-configxslt-config:/usr/bin/xslt-config (Representative presence)
# # #如果没有执行安装命令
[[Email protected] ~] #yum Install Libxslt-devel
# # #检查是否有gcc环境, no install
[[Email protected] ~] #yum Install gcc-c++
# # #安装一些相关的包
[[Email protected] ~] #yum install libevent-devel openssl-devel libffi-devel python-devel
[[Email protected] ~]#/usr/bin/easy_install pip
# # #进入tempest目录进行安装 (No virtual machine environment installed)
[[Email protected] ~] #python setup.py Install
(optional) # # #如果不想将tempest安装在真实环境中那么执行如下命令
[[Email protected] ~] #pip-U virtualenv
[[Email protected] ~] #virtualenv. venv
[Email protected] ~]#. . venv/bin/activate
[[Email protected] ~] #python setup.py Install
# # #安装junitxml, is the test report output to XML format
[[email protected]] #pip install Junitxml
# # # #由于Tempest used in the Icehouse period is a bug ,thebug is as follows:
# # #在added under /root/tempest/tempest/openstack/common/log.py file
650) this.width=650; "src=" Http://image.mamicode.com/info/201503/20181003172758699337.png "style=" border:0px; "/ >
Note: This bug has been fixed during the Juno version and can be skipped.
# # #修改tempest. conf file, note that when creating an extranet, do not share, or you will get an error when testing to start a virtual machine and conduct a network test
CP Etc/tempest.conf.sample etc/tempest.conf
[[email protected] etc]# = =/usr/bincatalog_type===53f6877e-2f46-43e3-93b7-7e22786cacb2flavor_ref = 1
= = ./= 7e4b08b4-d7a1-4eff-- = 7e4b08b4-d7a1-4eff--=== =-====-feature-= = = = = = = = http:login_url = http:============= http:uri_v3 = .=-feature-= = === http:region =-feature-= =
public_router_id = Ac4a4d9b-27c7-492b-824a-ae384710ab2aregion =regiononetenant_network_cidr = 10.100.0.0/16tenant_ network_mask_bits = 28tenant_networks_reachable = true[network-feature-enabled][ object-storage][object-storage-feature-enabled][orchestration][scenario][service_available] (Configure which modules need to be tested here) ceilometer = falsecinder = trueglance = trueheat = falsehorizon = trueironic = falseneutron = truenova = truesahara = falseswift = falsetrove = falsezaqar = false[stress][telemetry][volume][ volume-feature-enabled]multi_backend =true (back-end storage for test cinder has multiple backend)
# # #修改好配置文件之后, test (take token in test Keystone for example)
[Email protected] 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
[[email protected] ~]# 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": " Miidlgyjkozihvcnaqccoiidhzccaxscaqexctahbgurdgmcgjccayqgcsqgsib3dqehaaccaxueggfxeyjhy2nlc3mioib7inrva2vuijogeyjpc3n1zwrfy Xqioiaimjaxns0wms0ymlqwnto1mdowny42ndg5njiilcaizxhwaxjlcyi6iciymde1ltaxltiyvda2ojuwoja3wiisicjpzci6icjwbgfjzwhvbgrlciisic Jhdwrpdf9pzhmioibbikpiz0u0edgwvfjxskjorjjfujdxv3cixx0sicjzzxj2awnlq2f0ywxvzyi6iftdlcaidxnlcii6ihsidxnlcm5hbwuioiaidxnlci0 Totk2ndi1oda5iiwginjvbgvzx2xpbmtzijogw10sicjpzci6ici4ogqwngvkzmu0ywe0mmeyywuzzwqxzjaynzvmywq3ncisicjyb2xlcyi6iftdlcaibmft Zsi6icj1c2vyls05oty0mju4mdkifswgim1ldgfkyxrhijogeyjpc19hzg1pbii6idasicjyb2xlcyi6iftdfx19myibgtccax0caqewxdbxmqswcqydvqqgewjv Uzeomawga1uecawfvw5zzxqxdjambgnvbacmbvvuc2v0mq4wdaydvqqkdavvbnnlddeymbyga1ueawwpd3d3lmv4yw1wbguuy29tagebmacgbssoawiama0gc Sqgsib3dqebaquabiibaajoxz4e-hnwhy45cd+ O3tgqi1sdvidioifrrdag5hmc0fn9pgxnt-fymzibrh9b0lmjkjja32oo2m0xmlcwcmaalsmmpbk5ouaecznejngb2uyfw6lpi5r5sem5hbo40bre0mumraon zorqkmgijexf0rdn84ifrx40pvwo-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": " Miidlgyjkozihvcnaqccoiidhzccaxscaqexctahbgurdgmcgjccayqgcsqgsib3dqehaaccaxueggfxeyjhy2nlc3mioib7inrva2vuijogeyjpc3n1zwrfy Xqioiaimjaxns0wms0ymlqwnto1mdowny42ndg5njiilcaizxhwaxjlcyi6iciYmde1ltaxltiyvda2ojuwoja3wiisicjpzci6icjwbgfjzwhvbgrlciisicjhdwrpdf9pzhmioibbikpiz0u0edgwvfjxskjorjjfujdxv3cixx0sicjzzxj2 Awnlq2f0ywxvzyi6iftdlcaidxnlcii6ihsidxnlcm5hbwuioiaidxnlci0totk2ndi1oda5iiwginjvbgvzx2xpbmtzijogw10sicjpzci6ici4ogqwngvkz Mu0ywe0mmeyywuzzwqxzjaynzvmywq3ncisicjyb2xlcyi6iftdlcaibmftzsi6icj1c2vyls05oty0mju4mdkifswgim1ldgfkyxrhijogeyjpc19hzg1pbi I6idasicjyb2xlcyi6iftdfx19myibgtccax0caqewxdbxmqswcqydvqqgewjvuzeomawga1uecawfvw5zzxqxdjambgnvbacmbvvuc2v0mq4wdaydvqqkdav Vbnnlddeymbyga1ueawwpd3d3lmv4yw1wbguuy29tagebmacgbssoawiama0gcsqgsib3dqebaquabiibaajoxz4e-hnwhy45cd+ O3tgqi1sdvidioifrrdag5hmc0fn9pgxnt-fymzibrh9b0lmjkjja32oo2m0xmlcwcmaalsmmpbk5ouaecznejngb2uyfw6lpi5r5sem5hbo40bre0mumraon zorqkmgijexf0rdn84ifrx40pvwo-htacnsb9fm1bkqug8a+anojnhrgnqy80fij+ipp5-53drn0vxbakhzvyjhaut5gsodk-+ Tthj3fvbda1fm-wa-smznv7xl-x8f9nchbe7vv3afde4xqhpdfzr+c4zedglcq6vvryd0opem2nt9gbn8gevnwjpk2qjvj2dxxgczndzg= "}, "Tenantname": "tenant--1886860973"}}]]></system-out></testcase></testsuite>
If there are shortcomings, please criticize!
RELATED Links: http://www.oschina.net/question/129540_146999
This article is from the "Regenerating cells" blog, so be sure to keep this source http://wangtianfa.blog.51cto.com/5281093/1621797
OpenStack Platform Functional Testing Tool Tempest installation