目前Tempest没有打成包,需要用源码方式安装
# git clone https://github.com/openstack/tempest.git
# cd tempest # echo "discover>=0.4.0" >> requirements.txt
# yum install gcc libxslt-devel ibevent-devel openssl-devel libffi-devel python-devel python-pip python-virtualenv # pip install pbr
# python setup.py install
# cp etc/tempest.conf.sample etc/tempest.conf
这边配置项视需要测试的项目会有不同,可以参考redhat相应文档或者OpenStack官网进行配置。
本文以一次配置为例说明
# egrep -v ‘^#|^$‘ etc/tempest.conf [DEFAULT] lock_path=keystone [auth] [baremetal] [boto] [cli] [compute] [compute-feature-enabled] [dashboard] [data_processing] [data_processing-feature-enabled] [database] [debug] [identity] endpoint_type=publicURL catalog_type=identity uri = http://controller:5000/v2.0 uri_v3 = http://controller:5000/v3.0 auth_version = v2 username = admin tenant_name = admin admin_role = admin password = admin admin_username = admin admin_tenant_name = admin admin_password = admin [identity-feature-enabled] api_v2 = true [image] [image-feature-enabled] [input-scenario] [messaging] [negative] [network] [network-feature-enabled] [object-storage] [object-storage-feature-enabled] [orchestration] [oslo_concurrency] [scenario] [service_available] [stress] [telemetry] [volume] [volume-feature-enabled]
可以通过脚本(testr)或者nosetests来运行测试。
可以直接运行Tempest目录下的脚本(-V是用虚拟环境运行):
# ./run_tempest.sh -V
# yum install python-nose-exclude # pip install junitxml
测试v2接口的tokens
# nosetests tempest/api/identity/admin/v2/test_tokens.py --with-xunit --xunit-file=/root/keystone_test_tokens.xml
上述的目录或文件按实际测试需求去添加。 --with-xunit --xunit-file两个参数是指将结果以xml格式输出到指定文件。
本文出自 “EinstCrazy” 博客,请务必保留此出处http://einst.blog.51cto.com/9493625/1623376
原文:http://einst.blog.51cto.com/9493625/1623376