Thanks to
Saltconf 18 - Automated Testing for SaltStack Environments - Ethan Moore
How do you ensure your Salt states work?
Ensuring your Salt states work now and in the future
Demo
state.show_sls
state.apply mock=True
state.apply test=True
salt-call state.show_sls <slsname>
salt-call state.apply mock=True <slsname>
state.apply
salt-call state.apply test=True <slsname>
Building a test suite with pytest and testinfra
salt-call
Demo - Gitlab cli Demo - Gitlab web Demo - Github cli Demo - Github web
Demo - cli Demo - web