Unit tests for Foreman trainings

Hi! I’m just doing a Foreman training and created several labs for the participants (e.g. creating content views, registering hosts, etc.).
I was just wondering whether there is a decent way to check whether everything was done right after completing the lab. I’m already serving example solutions for the labs that are executing hammer commands to fulfill the lab’s goals (another way would be leveraging the foreman_ansible ansible modules).

For other projects I’m already using unit test frameworks such as InSpec or RSpec but these tools don’t have pre-built modules for Foreman, so I would have to implement all the API calls and so on by me own (which would be very time consuming).

Do you know whether there is a decent way to simply check Foreman object states?

Expected outcome:
Having a unit test tool with Foreman/Katello module support.

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Other relevant data:

I am not sure, but @ekohl can answer how fare his work on smoker is, so you could perhaps use it to test from UI perspective.

You probably know about our training and me doing it, so if you want to share experiences reach out for me.

1 Like

It sounds like you just want to seed an installation with a certain config. Have you considered https://github.com/theforeman/foreman-ansible-modules to do this? Ansible should have a check mode and that should show diffs. If not, I think it’s a good use case and I’m sure the maintainers would like to support that.