问题导读:
1、openstack的Tempest是什么
2、该怎么配置
Tempest是随openstack开发的测试套件,能够对openstack各个service和api进行全面测试。Tempest项目发布在openstack的github上,和openstack代码有相同的分支,用户可以根据自己的openstack环境clone相应的分支测试当前openstack环境。本文针对essex分支的tempest配置进行说明。
事实上,在tempest的配置文件里,已经对各个变量进行了尽可能详尽的说明,本文对相关配置内容进行进一步的说明,方便openstack入门者尽快入手openstack QA测试。
首先,在tempest/etc目录下,将原始配置文件进行拷贝:
#cp tempest.conf.sample tempest.conf
用编辑器打开tempest.conf进行设定,红色字体部分为特殊说明。
========================================BEGIN ====================================
[identity]
: identity部分是关于keystone相关部分的设定,这部分如无特殊设定,使用缺省值就可以了
# This section contains configurationoptions that a variety of Tempest # test clients use when authenticating withdifferent user/tenant # combinations
# Set to True if your test environment'sKeystone authentication service should # be accessed over HTTPS use_ssl = False # This is the main host address of theauthentication service API host = 127.0.0.1
:因为我们一般在controller node上进行tempest测试,所以设定为127.0.0.1
# Port that the authentication service APIis running on port = 5000 # Version of the authentication service API(a string) api_version = v2.0 # Path to the authentication service tokensresource (do not modify unless you # have a custom authentication API and arenot using Keystone) path = tokens # Should typically be left as keystoneunless you have a non-Keystone # authentication API service strategy = keystone
[compute]
:这部分是关于nova service的设定
# This section contains configurationoptions used when executing tests # against the OpenStack Compute API.
# This should be the username of a userWITHOUT administrative privileges username = demo # The above non-administrative user'spassword password = password # The above non-administrative user'stenant name tenant_name = demo
:以上这三组数据是一个普通用户(非管理员用户)的相关信息,分别为用户名,密码,tenant名。可以单独为
:tempest建立这个用户:
:# keystone tenant-create --name demo --enabled true --description"Description of demo"
:# keystone user-create --name demo --tenant_id <ID of tenant'demo'> --pass password
: --email <mail of used>--enable true
# This should be the username of analternate user WITHOUT # administrative privileges alt_username = demo_alt # The above non-administrative user'spassword alt_password = password # The above non-administrative user'stenant name alt_tenant_name = demo_alt
:以上这三组数据是另外一个普通用户(非管理员用户)的相关信息,可以仿照第一组用户的说明创建
# Reference data for tests. The ref andref_alt should be # distinct images/flavors. image_ref =783b3a98-06c8-4557-a6d4-aa15ed6213a8 image_ref_alt =5bd6d058-72fb-405c-a8df-c5fca3875425
:这两组数据是glance服务里面的两个image的ID,通过 # glance image-list命令可以取得所有的image id,
:如果需要可以专门上传两个image供tempest使用。
flavor_ref = 1
flavor_ref_alt = 2
:这两组数据是tempest创建instance测试用例使用的flavor id参数。通过 # nova flavor-list命令
:可以看到当前openstack环境的所有flavor,默认情况下,openstack会创建5个flavor, 这里的1和2
:分别代表的是m1.tiny和m1.small。
# Number of seconds to wait while loopingto check the status of an # instance or volume that is building. build_interval = 10
:这个参数是tempest测试用例里用于监测相关操作是否完成的监测间隔,包括创建instance, volume等,如果
:没有特殊要求,使用缺省值就可以了,这里是10s。
# Number of seconds to time out on waitingfor an instance or volume # to build or reach an expected status build_timeout = 1800
:这个参数是监测相关操作是否完成的超时时间这里说的相关操作主要是instance的创建,volume的创建等,
:缺省值是600s,需要根据测试环境的性能进行适当调整。
:注意如果超时一旦发生,测试用例会返回错误,但相关的操作却会仍然继续进行,而tempest将不会对该
:操作进行clean处理,所以如果超时时间过短,会引起一些系统资源无法自动清除,例如instance,volume等。
:所以这个超时时间最好给出一定的裕量。
# The type of endpoint for a Compute APIservice. Unless you have a
# custom Keystone service catalogimplementation, you probably want to leave # this value as "compute" catalog_type = compute
# Does the Compute API support creation ofimages? create_image_enabled = true
# For resize to work with libvirt/kvm, oneof the following must be true: # Single node:allow_resize_to_same_host=True must be set in nova.conf # Cluster: the 'nova' user must have scpaccess between cluster nodes resize_available = true
:设置是否允许resize instance。注意如果是多个compute node,需要各个node之间能够无密码ssh访问。
:因为在有多个compute node时,在resize的过程中可能会将一个instance从一个compute node迁移到
:另一个compute node上(由nova schedule决定),而nova用户无密码访问就是为了把instance的数据
:从一个node scp到另一个node上。
# Level to log Compute API request/responsedetails. log_level = ERROR
[image]
:这部分是关于glance的配置部分,比较简单
# This section contains configurationoptions used when executing tests # against the OpenStack Images API
# This should be the username of a userWITHOUT administrative privileges username = demo # The above non-administrative user'spassword password = password # The above non-administrative user'stenant name tenant_name = demo
:可以与compute部分的非管理用户相同
[compute-admin]
: nova admin用户设定部分
# This section contains configurationoptions for an administrative # user of the Compute API. These optionsare used in tests that stress # the admin-only parts of the Compute API
# This should be the username of a userWITH administrative privileges username = admin # The above administrative user's password password = password # The above administrative user's tenantname tenant_name = admin
:管理员admin用户相关信息
========================================END==================================
|