test infrastructure with serverspec, inspec, or pytest

Here’s a simple hello world pytest example to run on a centos box:

$ cat test_sample.py
import commands
status, outputx = commands.getstatusoutput("yum info tree | grep '^Repo' | grep -o 'installed'")
def test_answer():
    assert outputx == 'installed'