First off, I would like to apologize for the intrusion of my user based 
questions to this list.

I have asked in the user mailing list and the user IRC channel and not been 
able to find a solution. It was recommended to me in the IRC channel that I 
ask here.

I am trying to write some spec tests for some hiera (0.3.0) enabled modules 
on a puppet 2.7.17 install running on Ubuntu 12.04 (32bit 'server') , and I 
am using both puppetlabs_spec_helper and puppet-rspec.

My .fixtures.yml:


fixtures:
  repositories:
    stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
    hiera-puppet: https://github.com/puppetlabs/hiera-puppet.git
  symlinks:
    mongodb: "#{source_dir}"


My spec/classes/mongodb_spec.rb: 


require 'spec_helper'

describe 'mongodb', :type => 'class' do

  context "On an Ubuntu install, admin and single user" do
    let :facts do
      {
        :osfamily => 'Debian',
        :operatingsystem => 'Ubuntu',
        :operatingsystemrelease => '12.04'
      }
    end

    it {
      should contain_user('XXXX').with( { 'uid' => '***' } )
      should contain_group('XXXX').with( { 'gid' => '***' } )
      should contain_package('mongodb').with( { 'name' => 'mongodb' } )
      should contain_service('mongodb').with( { 'name' => 'mongodb' } )
    }
  end
end
When I run the test:

# rake spec
/usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color
F

Failures:

  1) mongodb On an Ubuntu install, admin and single user
     Failure/Error: should contain_user('XXXX').with( { 'uid' => '***' } )
     LoadError:
       no such file to load -- hiera_puppet
     # 
./spec/fixtures/modules/hiera-puppet/lib/puppet/parser/functions/hiera.rb:3:in 
`function_hiera'
     # ./spec/classes/mongodb_spec.rb:15

Finished in 0.05415 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/classes/mongodb_spec.rb:14 # mongodb On an Ubuntu install, admin 
and single user
rake aborted!
/usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color failed

Tasks: TOP => spec_standalone
(See full trace by running task with --trace)


Someone suggested that I symlink to my existing hiera-puppet install, and so I 
changed my .fixtures.yml to:

fixtures:
  symlinks:
    mongodb: "#{source_dir}"
    hiera-puppet: "/etc/puppet/modules/hiera-puppet"
    stdlib: "/etc/puppet/modules/stdlib"


And when I ran the test I got the following error:

# rake spec
/usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color
Mocha deprecation warning: Test::Unit or MiniTest must be loaded *before* Mocha.
Mocha deprecation warning: If you're integrating with another test library, you 
should probably require 'mocha_standalone' instead of 'mocha'
F

Failures:

  1) mongodb On an Ubuntu install, admin and single user
     Failure/Error: should contain_user('mongodb').with( { 'uid' => '510' } )
     Puppet::Error:
       Hiera config file /dev/null/hiera.yaml not readable at 
/etc/puppet/environments/test/modules/mongodb/spec/fixtures/modules/mongodb/manifests/init.pp:68
 on node puppet-master-local.oreillyauto.com
     # ./spec/classes/mongodb_spec.rb:15

Finished in 0.10304 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/classes/mongodb_spec.rb:14 # mongodb On an Ubuntu install, admin 
and single user
rake aborted!
/usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color failed

Tasks: TOP => spec_standalone
(See full trace by running task with --trace)

--------

If someone could offer any advice, suggestions or additional documentation, 
I would greatly appreciate it, and again, I apologize for the intrusion.

Thank you for your time and work on this project.
--Lee

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-dev/-/0mC8ptuR5hUJ.
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-dev?hl=en.

Reply via email to