Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock up exported resources from PuppetDB #741

Open
kg4zow opened this issue Feb 8, 2019 · 0 comments
Open

Mock up exported resources from PuppetDB #741

kg4zow opened this issue Feb 8, 2019 · 0 comments

Comments

@kg4zow
Copy link

kg4zow commented Feb 8, 2019

Is there a way to mock up resources which would have been exported to PuppetDB by other nodes, so that the "collecting" of those resources can be tested? https://pastebin.com/USd0BinG illustrates what I'm trying to do.

In the real world, the target machines (the ones which are being monitored by nagios) export the tests they need done, and the nagios server collects them to build its nagios config files.

I am able to test that the target machines are exporting their resources using tests like:

it { expect(exported_resources).to contain_nagios_host( 'thisbox.domain.xyz' ) }

However, I haven't been able to find a way to test the "collecting" part of it, other than just throwing the exported resources (without @@) into a :pre_condition... which doesn't really test the "collecting" functionality, it just tests for typos between the :pre_condition and the it{} blocks in the test.

If there's not already a way to do this, please consider this a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant