如果在本机上已经安装了openstack,则在本机已有
/etc/kolla/admin-openrc.sh
文件;如果在本机上没有安装openstack,则需要自行创建一个admin-openrc.sh文件并修改其配置(主要包括已有openstack系统的登录用户名,密码,鉴权url等)
admin-openrc.sh文件内容如下:
# Ansible managed
# Clear any old environment that may conflict.
for key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=MA1R3w5lWjxSBO8Y8nM2AKKZFiVldfXS2fzEdG7j
export OS_AUTH_URL=http://100.10.10.142:35357/v3
export OS_INTERFACE=internal
export OS_ENDPOINT_TYPE=internalURL
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne
export OS_AUTH_PLUGIN=password
当正确配置好 admin-openrc.sh 这个脚本后,开始执行脚本,加载openstack的环境变量:
source /etc/kolla/admin-openrc.sh
重新创建数据库
rally db recreate
创建deployment
方式1:通过临时环境变量创建
# cd /etc/kolla/nova-api
rally deployment create --fromenv --name=openstack
方式2:通过existing.json配置文件创建,existing
rally deployment create --fromenv --name=tempest_api
查看所有的deployment列表
rally deployment list # 关注deployment的name
查看已经创建的deployment详情
rally deployment show tempest_api
检查deployment各项服务是否正常
rally deployment check
注意:中途如果退出了openstack环境,需要再次使用该环境
rally deployment use tempest_api
声明rally项目的python虚拟环境
source /rally_env/bin/activate
生成静态html的报告
rally task report 6c390b83-2427-4336-9da7-333982076295 --html-static --out output.html
rally verify create-verifier --type tempest --name tempest5 --source /berlin/git_res/tempest --system-wide
rally verify list-plugins
查看所有的plugin查看tempest verifier是否创建成功
(venv) [root@controller etc]# rally verify list-verifiers
+--------------------------------------+----------+---------+-----------+---------------------+---------------------+-----------+---------+-------------+--------+
| UUID | Name | Type | Platform | Created at | Updated at | Status | Version | System-wide | Active |
+--------------------------------------+----------+---------+-----------+---------------------+---------------------+-----------+---------+-------------+--------+
| f169b8b2-1799-47bb-a86c-c2cce45ea612 | tempest5 | tempest | openstack | 2022-08-05T08:19:24 | 2022-08-05T08:19:25 | installed | 29.2.0 | True | |
| 51e4903f-dca4-4ca5-ac4b-72a2d0b7fdef | tempest6 | tempest | openstack | 2022-08-05T09:07:21 | 2022-08-05T09:07:22 | installed | baolin | True | :-) |
+--------------------------------------+----------+---------+-----------+---------------------+---------------------+-----------+---------+-------------+--------+
tempest verifier创建完成后会在\root\.rally\verification
创建一个以该verifier的uuid构成的verification,如verifier-51e4903f-dca4-4ca5-ac4b-72a2d0b7fdef
该verfication中实际上包含了创建源中的最新版本或指定版本(如果不指定version就是最新版本), 最终使用rally执行测试用例的时候实际上执行的就是该verfication中的代码
rally verify start --id 51e4903f-dca4-4ca5-ac4b-72a2d0b7fdef --pattern tempest.api.compute.compute_resource_pool --deployment-id 052367ee-5597-492f-a84e-30dbcb521652
模块.
的方式确定要测试那个模块模块.
的方式确定要测试那个模块rally task report --uuid 6c390b83-2427-4336-9da7-333982076295 --type html-static --out output.html
参数说明:
rally verify list
来查看所有的验证器