-
Notifications
You must be signed in to change notification settings - Fork 9
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
"Could not set 'directory' on ensure: Permission denied" errors with rspec-puppet > 1.0.1 + puppet 3.7.3 future parser #15
Comments
I just realized this may be an id10t error. I noticed that the
|
OK - don't know where my mind was yesterday... Switching to my fork of Sorry for the noise... However, there's now a new error that occurs with and without the future parser enabled. It looks like a problem with test dir path construction.
|
Those errors are puzzling. It seems r-p-a hits them because it's actually applying a catalog, which rspec-puppet doesn't do. This triggers a new code path inside Puppet to initialise settings... /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/gems/puppet-3.7.3/lib/puppet/settings.rb:999:in `block in use' /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/gems/puppet-3.7.3/lib/puppet/resource/catalog.rb:181:in `apply' /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/gems/puppet-3.7.3/lib/puppet/settings.rb:989:in `use' /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/gems/puppet-3.7.3/lib/puppet/util/storage.rb:45:in `load' /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/gems/puppet-3.7.3/lib/puppet/resource/catalog.rb:163:in `apply' /home/dcleal/.rvm/gems/ruby-2.0.0-p353@tmp/bundler/gems/rspec-puppet-augeas-6152e283a65f/lib/rspec-puppet-augeas/fixtures.rb:47:in `apply'
|
I suspect this might be related to puppetlabs/puppet#3114 but I haven't had the chance to investigate (holiday weekend in the US). |
This patch bumps the version of rspec-puppet to 2.0.0. A new major version is warranted because of the following changes noted by Joshua Hoblitt. There were several small bits of breakage and most (all?) of my modules required forward porting work. Some tests still had include_class, which I believe was long deprecated anyways. * I ended up pinning the version of rspec-core as gem 'rspec-core', '~> 2.0' to silence rspec 3 warnings. It would be nice if a new release set this requirement it it's gemspec. * It looks like libdir handling changes broke rspec-puppet-augeas domcleal/rspec-puppet-augeas#15 * All instances of verify_contents(subject, ...) broke as subject has been removed and replaced with catalogue. #235 * The construct I had been using to check for exceptions in negative tests broke. expect { should }.to raise_error(...) had to be replaced with should raise_error(...) The last 2-3 are definitely breaking changes from 1.0.0 and I believe this warrants a major version bump. Otherwise, I expect 'rspec-puppet', '~> 1.0' will still break a number of module's tests.
Yep, puppet is not consistent about handling a list of libdirs. I posted to puppet-dev about this. And this issue shows that if you ever do set libdir to multiple directories, and actually try to "use" settings, like when running |
Puppet will try and ensure the confdir (which rspec-puppet has defaulting to /etc/puppet) exists when applying a catalog. Set it to a temporary dir to prevent internal file management. rodjek/rspec-puppet#237 has more discussion. Fixes #14, #15
I've pushed a fix for the permission error (which is the same as #14 I reckon) to the 'future' branch, which I'll merge to master as soon as the rspec-puppet 2.0.0 gem is pushed and do a 0.4.0 release. That should get most things running again. Once @joshcooper's LOAD_PATH fix is also merged and released in rspec-puppet, then it'll fix the multi-libdir case too (as in your mdadm module). |
0.4.0's released now which should fix the permissions problem, just leaving the multi-libdir case as the rspec-puppet PR's still open. |
I think this is real progress, I'm down to errors which I assume are bubbling up from trying to write to /dev/null.
|
I get the same failure with @joshcooper 's rspec-puppet PR. Eg.
It looks like PUP-3336 was merged into master but not stable. @joshcooper - is there any hope of that getting back merged for 3.7.x? |
@jhoblitt I'm not sure we can backport PUP-3336 to 3.7.x. It changes how puppet interprets its The error Ideally when puppet is running as non-root, it would only attempt to manage the mode of its internal settings, and not owner & group (so it wouldn't require a user & group provider). |
@joshcooper I suspected that would be the concern but isn't libdir handling already a regression in 3.x? I don't see how rspec-puppet could be changed to work with both 3.7.x and 4.x without modifications on the puppet side. The spec tests do indeed pass as root. Ps - bundler gives this nice warning...
|
It is broken if you specify multiple directories in libdir and then try to run puppet, e.g. For the 3.x vs 4.x question, I think rodjek/rspec-puppet#237 should work for both. As in, so long as every module's lib dir is in the ruby $LOAD_PATH, then all versions of puppet can load transitive dependencies for custom types, providers, etc. |
As a bit of a workaround running the tests with fakeroot seems to work fine for me.
|
I made a big push yesterday to add the future parser to the travis matrix of all of my published puppet forge modules and discovered that the two modules that use
rspec-puppet-augeas
fail under the future parser with error messages like:Evaluation Error: Use of 'import' has been discontinued in favor of a manifest directory
.Direct links to travis runs for both modules with future parser errors:
https://travis-ci.org/jhoblitt/puppet-mdadm/builds/41427168
https://travis-ci.org/jhoblitt/puppet-autofsck/builds/41423244
Example (truncated) rspec errors with future parser enabled:
The text was updated successfully, but these errors were encountered: