On Wed, Jun 26, 2013 at 7:23 PM, Amos Shapira <amos.shap...@gmail.com>wrote:
> I'm writing my first puppet function rspec test and am having a problem > which I don't see how to solve. > > The function (and the test) involve access to files through the File > Server. In order for the function (and the test) to work I need to pass > "--fileserverconf=fileserver.conf" parameter to Puppet. > > So far I haven't found a way to do that. > > If I understand the rspec-puppet source at > https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet.rbcorrectly > then the list of parameters I can pass is limited to the ones > mentioned in lines 16-22. Am I right? > > Does anyone know how can I pass other parameters, or otherwise affect > Puppet's configuration to set this value? > Oddly enough, you can't depend on rspec-puppet to configure the settings for spec test. For example, puppetlab's spec helper configures the modulepath [1] to include spec/fixtures/modules, but this does not seem to configure Puppet[:modulepath] setting. For whatever reason, puppet loads the modules correctly from spec/fixtures/modules, but when you debug the spec test, it appears to set the module path to: (rdb:1) p Puppet[:modulepath] "/dev/null/modules:/usr/share/puppet/modules" You can do what Wolf suggested. File server conf is somewhat inconsistent, since the setting is actually: Puppet[:fileserverconfig]. HTH, Nan 1. https://github.com/puppetlabs/puppetlabs_spec_helper/blob/master/lib/puppetlabs_spec_helper/module_spec_helper.rb#L21-L24 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.