testfm是一个测试套件,用于练习foreman维护工具。
testfm的Python项目详细描述
TestFM是一个基于pytest-ansible的测试套件,它使用foreman维护工具
快速启动
以下只是testfm的简要设置指南。 运行测试一节提供了更全面的使用指南 测试调频。
testfm需要对被测服务器系统的ssh访问,而这个ssh访问 由pytest ansible实现。
获取源代码并安装依赖项:
git clone https://github.com/SatelliteQE/testfm.git pip3 install -r requirements.txt
就这样!你现在可以开始测试工头维修。 但是,在继续之前,您还需要做一些其他事情:
- 确保将ssh密钥复制到测试系统。
- 确保工头维护安装在工头/卫星服务器上。
运行测试
在运行任何测试之前,必须将foreman或satellite主机名添加到 testfm/inventory文件(首先从“testfm/inventory.sample”复制)。
完成后,您可以使用pytest运行测试
pytest --ansible-host-pattern satellite --ansible-user=root --ansible-inventory testfm/inventory tests/
可以运行特定的测试子集:
pytest --ansible-host-pattern satellite --ansible-user=root --ansible-inventory testfm/inventory tests/test_case.py pytest --ansible-host-pattern satellite --ansible-user=root --ansible-inventory testfm/inventory tests/test_case.py::test_case_name
想做贡献吗?
感谢您考虑为testfm做贡献!如果你有 有问题或顾虑,请随时与团队联系。
推荐
- 按字母顺序导入模块。
- 每个方法和函数都有一个格式正确的docstring。
为了确保您能够通过travis ci构建, 建议您在 testfm目录
flake8
flake8将确保您所做的更改不违反pep8 标准。如果命令没有输出,那么您已经通过了。如果不是,那么 处理任何建议的更正。
如果你有很棒的东西,请提交一个拉请求无论如何!
许可
testfm在gnu通用公共许可v3.0下获得许可。