All Projects → pytest-dev → Pytest Testinfra

pytest-dev / Pytest Testinfra

Licence: apache-2.0
With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to Pytest Testinfra

Goss
Quick and Easy server testing/validation
Stars: ✭ 4,550 (+128.99%)
Mutual labels:  infrastructure-as-code, devops, devops-tools, nagios, testing-tools, tdd, tdd-utilities
Serverfarmer
Manage multiple servers with different operating systems, configurations, requirements etc. for many separate customers in an outsourcing model.
Stars: ✭ 122 (-93.86%)
Mutual labels:  ansible, puppet, chef, devops, devops-tools
Psrule
Validate infrastructure as code (IaC) and objects using PowerShell rules.
Stars: ✭ 107 (-94.61%)
Mutual labels:  infrastructure-as-code, devops, devops-tools, testing-tools
Rundeck
Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
Stars: ✭ 4,426 (+122.75%)
Mutual labels:  ansible, devops, devops-tools
Salt Scanner
Linux vulnerability scanner based on Salt Open and Vulners audit API, with Slack notifications and JIRA integration
Stars: ✭ 261 (-86.86%)
Mutual labels:  saltstack, devops, devops-tools
Tads Boilerplate
Terraform + Ansible + Docker Swarm boilerplate = DevOps on 🔥🔥🔥 | Infrastructure as Code
Stars: ✭ 424 (-78.66%)
Mutual labels:  ansible, infrastructure-as-code, devops
Ansible Meta Dynamic Inventory
Naming is hard. This wrapper script allows you to use set notation with dynamic host groups.
Stars: ✭ 24 (-98.79%)
Mutual labels:  ansible, devops, devops-tools
Terracognita
Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration
Stars: ✭ 452 (-77.25%)
Mutual labels:  infrastructure-as-code, devops, devops-tools
Kitchen In Travis
Chef cookbook example to run test-kitchen inside Travis CI.
Stars: ✭ 36 (-98.19%)
Mutual labels:  chef, devops, tdd
Terraboard
🌍 📋 A web dashboard to inspect Terraform States
Stars: ✭ 1,192 (-40.01%)
Mutual labels:  infrastructure-as-code, devops, devops-tools
Cintodeutilidadesdocker
My Docker templates repository 🐳 ☁️ 🐳
Stars: ✭ 74 (-96.28%)
Mutual labels:  infrastructure-as-code, devops, devops-tools
Azure
Azure-related repository
Stars: ✭ 78 (-96.07%)
Mutual labels:  ansible, devops, devops-tools
Opendevops
CODO是一款为用户提供企业多混合云、一站式DevOps、自动化运维、完全开源的云管理平台、自动化运维平台
Stars: ✭ 2,990 (+50.48%)
Mutual labels:  ansible, saltstack, devops
Inspec
InSpec: Auditing and Testing Framework
Stars: ✭ 2,450 (+23.3%)
Mutual labels:  devops, tdd, tdd-utilities
Catapult
💥 Catapult is a DevOps website management platform for development teams.
Stars: ✭ 64 (-96.78%)
Mutual labels:  infrastructure-as-code, devops, devops-tools
Ansible Podman Collections
Repository for Ansible content that can include playbooks, roles, modules, and plugins for use with the Podman tool
Stars: ✭ 89 (-95.52%)
Mutual labels:  ansible, devops, devops-tools
Oneview Ansible
Ansible Modules and Sample Playbooks for HPE OneView
Stars: ✭ 96 (-95.17%)
Mutual labels:  ansible, infrastructure-as-code, devops
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-94.21%)
Mutual labels:  devops, devops-tools
5minutes
First 5 minutes on new servers. Secure your servers with single command - Ansible playbook
Stars: ✭ 111 (-94.41%)
Mutual labels:  ansible, devops
Terrascan
Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure.
Stars: ✭ 2,687 (+35.23%)
Mutual labels:  infrastructure-as-code, devops

Testinfra test your infrastructure

Latest documentation: https://testinfra.readthedocs.io/en/latest

About

With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on.

Testinfra aims to be a Serverspec equivalent in python and is written as a plugin to the powerful Pytest test engine

License

Apache License 2.0

The logo is licensed under the Creative Commons NoDerivatives 4.0 License If you have some other use in mind, contact us.

Quick start

Install testinfra using pip:

$ pip install pytest-testinfra

# or install the devel version
$ pip install 'git+https://github.com/pytest-dev/pytest-testinfra@master#egg=pytest-testinfra'

Write your first tests file to test_myinfra.py:

def test_passwd_file(host):
    passwd = host.file("/etc/passwd")
    assert passwd.contains("root")
    assert passwd.user == "root"
    assert passwd.group == "root"
    assert passwd.mode == 0o644


def test_nginx_is_installed(host):
    nginx = host.package("nginx")
    assert nginx.is_installed
    assert nginx.version.startswith("1.2")


def test_nginx_running_and_enabled(host):
    nginx = host.service("nginx")
    assert nginx.is_running
    assert nginx.is_enabled

And run it:

$ py.test -v test_myinfra.py


====================== test session starts ======================
platform linux -- Python 2.7.3 -- py-1.4.26 -- pytest-2.6.4
plugins: testinfra
collected 3 items

test_myinfra.py::test_passwd_file[local] PASSED
test_myinfra.py::test_nginx_is_installed[local] PASSED
test_myinfra.py::test_nginx_running_and_enabled[local] PASSED

=================== 3 passed in 0.66 seconds ====================
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].