Issue #17488 has been updated by Jeff McCune. Status changed from Tests Insufficient to Needs Decision Assignee changed from Jeff McCune to Lubomir Rintel
Lubomir, I'm assigning this ticket over to you. As I commented in the pull request, I think we have all the code and tests we need, the last action is for you to decide if you'd like to use my commit as an example and add the tests to your own pull request, or merge your pull request as-is and layer my example tests on top. Either way, we have tests, so we're good. Once you decide I'll go ahead and merge this in. If you have any questions about the example tests I provided please let me know and I'll be happy to explain what I did and why I did it. Cheers, -Jeff ---------------------------------------- Bug #17488: Puppet needlessly crashes when run unptivileged even with --noop https://projects.puppetlabs.com/issues/17488#change-76243 Author: Lubomir Rintel Status: Needs Decision Priority: Normal Assignee: Lubomir Rintel Category: user Target version: 2.7.x Affected Puppet version: 2.7.18 Keywords: Branch: https://github.com/puppetlabs/puppet/pull/1269 I'm mostly opening this to satisfy comments in [pull request 1022](https://github.com/puppetlabs/puppet/pull/1022) even though I believe the commit and pull comments were sufficiently descriptive. Will open a new pull request, since the old one was closed due to my unresponsiveness. Repeating them here: ### Problem scope I often run puppet --noop unprivileged to conduct a basic sanity check of the recipes (such as checking for duplicate definitions or syntax errors). These changesets fix unnecessary abort that cause puppet to stop way too early. ### First fix Capture access violations for selinux context of file resources and deal with them gracefully without aborting the run. A simple reproducer of the problem (abort), to be run unprivileged: <pre> puppet apply --execute "file { '/root/chuj': ensure => absent; }" </pre> ### Second fix Don't abort while checking managedhome on nonexistent user provider. The user resource itself should fail itself and this prevents falling back to that. Simple test case (unprivileged): <pre> before$ puppet apply --execute 'user { "kokot": managehome => true }' Parameter managehome failed: Validate method failed for class managehome: undefined method `manages_homedir?' for NilClass:Class </pre> <pre> after$ puppet apply --execute 'user { "kokot": managehome => true }' err: Could not find a suitable provider for user notice: Finished catalog run in 0.10 seconds </pre> ### Test suite Unfortunately I can not write tests for this; since I could not get Puppet test suite pass sufficiently well on my laptop and I have no idea how is it supposed to work, let alone testing for fixes for issues that exhibit different behaviour when run privileged. I would be very thankful if anyone could assist. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
