teuthology 是一个用python写的用于Ceph功能性验证的自动化集成测试框架。teuthology 的工作方式主要通过控制远程主机(通常是虚拟机)验证Ceph的功能,测试用例包含在
ceph-qa-suite中,大多是yaml风格的测试脚本。关于teuthology的介绍(
here)和安装部署(
here)在这篇blog中说明的很详细,本文重点关注teuthology的执行流程及部分代码分析。
Teuthology framework 的工作流程大致是这样的,首先通过scheduler节点生成需要测试suite的jobs,放到Beanstalk队列中,然后由worker节点从队列中取出任务,并在slave nodes上去执行。
scheduler生成jobs流程
teuthology 生成关于具体test suites的jobs是通过teuthology-suite命令执行的,一般在 ./teuthology/virtualenv/bin/ 目录下面,该目录下还包括其他跟teuthology相关的command:
teuthology
- Run individual jobsteuthology-coverage
- Analyze code coverage via lcovteuthology-kill
- Kill running jobs or entire runsteuthology-lock
- Lock, unlock, and update status of machinesteuthology-ls
- List job results by examining an archive directoryteuthology-openstack
- Use OpenStack backend (wrapper aroundteuthology-suite
)teuthology-nuke
- Attempt to return a machine to a pristine stateteuthology-queue
- List, or delete, jobs in the queueteuthology-report
- Submit test results to a web service (we use paddles)teuthology-results
- Examing a finished run and email resultsteuthology-schedule
- Schedule a single jobteuthology-suite
- Schedule a full run based on a suite (see suites in