-
Notifications
You must be signed in to change notification settings - Fork 33
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
rspec mock systemd process on docker #128
Conversation
d8e39a2
to
85f095d
Compare
spec/spec_helper.rb
Outdated
| c.before do | ||
| # select the systemd service provider even when on docker | ||
| # https://tickets.puppetlabs.com/browse/PUP-11167 | ||
| if defined?(facts) and %w[Archlinux RedHat].include?(facts[:os]['family']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why limit to to those two OSes? shouldn't we do it on all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking someone might add slackware at some future date and then you might get the wrong service provider.
Archlinux, RedHat is everything in metadata.yml today so for sure not against changing.
On docker rspec the service provider is autodetected as redhat rather than systemd. https://tickets.puppetlabs.com/browse/PUP-11167 That causes ``` error during compilation: Parameter enable failed on Service[firewalld]: Provider redhat must have features 'maskable' to set 'enable' to 'mask' (file: /builds/ai/it-puppet-module-nftables/code/spec/fixtures/modules/nftables/manifests/init.pp, line: 186) ``` mock the systemd process so that the systemd provider is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Won't merge, though. Waiting for @bastelfreak's pending comment.
Pull Request (PR) description
On docker rspec the service provider is autodetected as redhat
rather than systemd.
https://tickets.puppetlabs.com/browse/PUP-11167
That causes
mock the systemd process so that the systemd provider is used.
Also migrate existing mocks away from deprecated mocha.