forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redhat-openstack#23 from CyBeRoni/master
Really make $ensure variable
- Loading branch information
Showing
16 changed files
with
114 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fixtures: | ||
repositories: | ||
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false | ||
|
||
if puppetversion = ENV['PUPPET_VERSION'] | ||
gem 'puppet', puppetversion, :require => false | ||
|
||
if puppetversion[0].chr.to_i < 3 | ||
gem 'hiera-puppet', :require => false | ||
end | ||
|
||
else | ||
gem 'puppet', :require => false | ||
end | ||
|
||
# vim:ft=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: ruby | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.3 | ||
script: 'rake spec' | ||
env: | ||
- PUPPET_VERSION="~> 2.7.0" | ||
- PUPPET_VERSION="3.3" | ||
gemfile: .gemfile | ||
branches: | ||
only: | ||
- master | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'rake' | ||
require 'puppetlabs_spec_helper/rake_tasks' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec_helper' | ||
|
||
describe 'ssh::client', :type => 'class' do | ||
context "On Debian with no other parameters" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:interfaces => 'eth0', | ||
:ipaddress_eth0 => '192.168.1.1' | ||
} | ||
end | ||
it { | ||
should contain_package('openssh-client').with(:ensure => 'present') | ||
} | ||
end | ||
context "On Debian with custom ensure" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:interfaces => 'eth0', | ||
:ipaddress_eth0 => '192.168.1.1' | ||
} | ||
end | ||
let :params do | ||
{ | ||
:ensure => 'latest' | ||
} | ||
end | ||
it { | ||
should contain_package('openssh-client').with(:ensure => 'latest') | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec_helper' | ||
|
||
describe 'ssh::server', :type => 'class' do | ||
context "On Debian with no other parameters" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:interfaces => 'eth0', | ||
:ipaddress_eth0 => '192.168.1.1' | ||
} | ||
end | ||
it { | ||
should contain_package('openssh-server').with(:ensure => 'present') | ||
} | ||
end | ||
context "On Debian with custom ensure" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:interfaces => 'eth0', | ||
:ipaddress_eth0 => '192.168.1.1' | ||
} | ||
end | ||
let :params do | ||
{ | ||
:ensure => 'latest' | ||
} | ||
end | ||
it { | ||
should contain_package('openssh-server').with(:ensure => 'latest') | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,2 @@ | ||
require 'pathname' | ||
dir = Pathname.new(__FILE__).parent | ||
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') | ||
|
||
require 'mocha' | ||
require 'puppet' | ||
gem 'rspec', '=1.2.9' | ||
require 'spec/autorun' | ||
|
||
Spec::Runner.configure do |config| | ||
config.mock_with :mocha | ||
end | ||
|
||
# We need this because the RAL uses 'should' as a method. This | ||
# allows us the same behaviour but with a different method name. | ||
class Object | ||
alias :must :should | ||
end | ||
require 'rspec-puppet' | ||
require 'puppetlabs_spec_helper/module_spec_helper' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include ssh | ||
class {"::ssh::server": } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ssh::server |