enable basic testing
adds the first unit test and the required peripheral config files for rspec-puppet.
This commit is contained in:
parent
9ef62597c8
commit
75d0fbe037
3
.fixtures.yml
Normal file
3
.fixtures.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fixtures:
|
||||||
|
symlinks:
|
||||||
|
"vswitch": "#{source_dir}"
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.swp
|
||||||
|
spec/fixtures/modules/*
|
||||||
|
spec/fixtures/manifests/*
|
13
Puppetfile
Normal file
13
Puppetfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
source :rubygems
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
gem 'puppetlabs_spec_helper', :require => false
|
||||||
|
end
|
||||||
|
|
||||||
|
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||||
|
gem 'puppet', puppetversion, :require => false
|
||||||
|
else
|
||||||
|
gem 'puppet', :require => false
|
||||||
|
end
|
||||||
|
|
||||||
|
# vim:ft=ruby
|
1
Rakefile
Normal file
1
Rakefile
Normal file
@ -0,0 +1 @@
|
|||||||
|
require 'puppetlabs_spec_helper/rake_tasks'
|
27
spec/classes/vswitch_ovs_spec.rb
Normal file
27
spec/classes/vswitch_ovs_spec.rb
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'vswitch::ovs' do
|
||||||
|
|
||||||
|
context 'on redhat with default parameters' do
|
||||||
|
|
||||||
|
let :facts do
|
||||||
|
{:osfamily => 'Redhat'}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should contain the correct package and service' do
|
||||||
|
|
||||||
|
should contain_service('openvswitch').with(
|
||||||
|
:ensure => true,
|
||||||
|
:enable => true,
|
||||||
|
:name => 'openvswitch'
|
||||||
|
)
|
||||||
|
|
||||||
|
should contain_package('openvswitch').with(
|
||||||
|
:name => 'openvswitch',
|
||||||
|
:ensure => 'present',
|
||||||
|
:before => 'Service[openvswitch]'
|
||||||
|
)
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
1
spec/spec_helper.rb
Normal file
1
spec/spec_helper.rb
Normal file
@ -0,0 +1 @@
|
|||||||
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
Loading…
x
Reference in New Issue
Block a user