saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.16k stars 5.48k forks source link

testinfra module to verify state #30973

Closed ssplatt closed 6 years ago

ssplatt commented 8 years ago

I've noticed that salt doesn't have any verification module. For instance, if you are writing your formulas and testing them using kitchen, you can verify the state with serverspec. There is a similar project written in python called 'testinfra' (https://github.com/philpep/testinfra). So the idea would be to apply state with state.highstate and then verify the state with testinfra (or similar). I'm also thinking the definition of the tests required per machine would be in a similar form as the state and pillar definitions, so you could define global definitions and then merge them with specific tests per machine or group.

are there any plans to create a testing/verification/auditing framework similar to serverspec or testinfra?

jfindlay commented 8 years ago

@ssplatt, thanks for mentioning testinfra. It looks like a very interesting project. We have plans to build testing into the salt state compiler itself. Some steps in this process are already done, such as state.show_* and state.apply mock=True, but it is always welcome to receive additional thoughts and ideas on what else can/should be done. @whiteinge, @s0undt3ch, @gravyboat, and probably others may be interested in such a discussion.

ssplatt commented 7 years ago

i know there is some code already in the official codebase, but i just remembered I made this issue and then made my own module https://github.com/ssplatt/saltstack-infratest-module. It's not all encompassing but does work.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

mchugh19 commented 6 years ago

This request can likely be closed with the addition of the saltcheck module.

stale[bot] commented 6 years ago

Thank you for updating this issue. It is no longer marked as stale.

rallytime commented 6 years ago

@mchugh19 Yeah I think so.

@ssplatt What do you say?

ssplatt commented 6 years ago

I don't know what that is but sure