File tree 6 files changed +98
-4
lines changed
6 files changed +98
-4
lines changed Original file line number Diff line number Diff line change 1
1
* .swp
2
2
pkg /
3
3
Gemfile.lock
4
+ .rspec_system
5
+ spec /fixtures
Original file line number Diff line number Diff line change
1
+ ---
2
+ default_set : ' centos-64-x64'
3
+ sets :
4
+ ' centos-59-x64 ' :
5
+ nodes :
6
+ " main.foo.vm " :
7
+ prefab : ' centos-59-x64'
8
+ ' centos-64-x64 ' :
9
+ nodes :
10
+ " main.foo.vm " :
11
+ prefab : ' centos-64-x64'
12
+ ' fedora-18-x64 ' :
13
+ nodes :
14
+ " main.foo.vm " :
15
+ prefab : ' fedora-18-x64'
16
+ ' debian-607-x64 ' :
17
+ nodes :
18
+ " main.foo.vm " :
19
+ prefab : ' debian-607-x64'
20
+ ' debian-70rc1-x64 ' :
21
+ nodes :
22
+ " main.foo.vm " :
23
+ prefab : ' debian-70rc1-x64'
24
+ ' ubuntu-server-10044-x64 ' :
25
+ nodes :
26
+ " main.foo.vm " :
27
+ prefab : ' ubuntu-server-10044-x64'
28
+ ' ubuntu-server-12042-x64 ' :
29
+ nodes :
30
+ " main.foo.vm " :
31
+ prefab : ' ubuntu-server-12042-x64'
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
group :development , :test do
4
- gem 'rake' , :require => false
5
- gem 'rspec-puppet' , :require => false
6
- gem 'puppetlabs_spec_helper' , :require => false
7
- gem 'puppet-lint' , :require => false
4
+ gem 'rake' , :require => false
5
+ gem 'rspec-puppet' , :require => false
6
+ gem 'puppetlabs_spec_helper' , :require => false
7
+ gem 'rspec-system' , :require => false
8
+ gem 'rspec-system-puppet' , :require => false
9
+ gem 'rspec-system-serverspec' , :require => false
10
+ gem 'serverspec' , :require => false
11
+ gem 'puppet-lint' , :require => false
8
12
end
9
13
10
14
if puppetversion = ENV [ 'PUPPET_GEM_VERSION' ]
Original file line number Diff line number Diff line change 1
1
require 'puppetlabs_spec_helper/rake_tasks'
2
+ require 'rspec-system/rake_task'
Original file line number Diff line number Diff line change
1
+ require 'rspec-system/spec_helper'
2
+ require 'rspec-system-puppet/helpers'
3
+ require 'rspec-system-serverspec/helpers'
4
+
5
+ include RSpecSystemPuppet ::Helpers
6
+
7
+ include Serverspec ::Helper ::RSpecSystem
8
+ include Serverspec ::Helper ::DetectOS
9
+
10
+ RSpec . configure do |c |
11
+ # Project root
12
+ proj_root = File . expand_path ( File . join ( File . dirname ( __FILE__ ) , '..' ) )
13
+
14
+ # Enable colour
15
+ c . tty = true
16
+
17
+ c . include RSpecSystemPuppet ::Helpers
18
+
19
+ # This is where we 'setup' the nodes before running our tests
20
+ c . before :suite do
21
+ # Install puppet
22
+ puppet_install
23
+
24
+ # Install modules and dependencies
25
+ puppet_module_install ( :source => proj_root , :module_name => 'mysql' )
26
+ shell ( 'puppet module install puppetlabs-stdlib' )
27
+ end
28
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper_system'
2
+
3
+ describe 'mysql class' do
4
+ describe 'running puppet code' do
5
+ # Using puppet_apply as a helper
6
+ it 'should work with no errors' do
7
+ pp = <<-EOS
8
+ class { 'mysql': }
9
+ EOS
10
+
11
+ # Run it twice and test for idempotency
12
+ puppet_apply ( pp ) do |r |
13
+ r . exit_code . should_not == 1
14
+ r . refresh
15
+ r . exit_code . should be_zero
16
+ end
17
+ end
18
+ end
19
+
20
+ describe package ( 'mysql' ) do
21
+ it { should be_installed }
22
+ end
23
+
24
+ describe service ( 'mysqld' ) do
25
+ it { should_not be_running }
26
+ it { should_not be_enabled }
27
+ end
28
+ end
You can’t perform that action at this time.
0 commit comments