This repository has been archived by the owner on Jun 11, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jerger
committed
Feb 5, 2013
1 parent
f8a8bda
commit e7191c2
Showing
4 changed files
with
55 additions
and
2 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,9 @@ | ||
require 'rake' | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:test) do |t| | ||
t.rspec_opts = ["--format", "doc", "--color"] | ||
t.pattern = 'spec/*/*_spec.rb' | ||
end | ||
|
||
task :default => :test |
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 |
---|---|---|
|
@@ -58,7 +58,5 @@ | |
enable => $enable, | ||
enable_v6 => $enable_v6, | ||
} | ||
|
||
} | ||
|
||
} |
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,24 @@ | ||
require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}" | ||
|
||
describe 'firewall' do | ||
let(:title) { 'firewall1' } | ||
let(:node) { 'firewall.example42.com' } | ||
let(:facts) { { :operatingsystem => 'ubuntu', :osver_maj => 12 } } | ||
|
||
describe 'Test firewall with http rule' do | ||
let(:params) { | ||
{ 'port' => '80', | ||
'protocol' => 'tcp', | ||
'enable_v6' => true, | ||
} | ||
} | ||
|
||
it { should contain_iptables__rule( "firewall1" ).with( | ||
'port' => '80', | ||
'protocol' => 'tcp', | ||
'enable_v6' => true, | ||
'source' => '', | ||
'destination' => '', | ||
) } | ||
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,22 @@ | ||
require 'puppet' | ||
require 'rspec-puppet' | ||
require 'tmpdir' | ||
|
||
RSpec.configure do |c| | ||
c.before :each do | ||
# Create a temporary puppet confdir area and temporary site.pp so | ||
# when rspec-puppet runs we don't get a puppet error. | ||
@puppetdir = Dir.mktmpdir("iptables") | ||
manifestdir = File.join(@puppetdir, "manifests") | ||
Dir.mkdir(manifestdir) | ||
FileUtils.touch(File.join(manifestdir, "site.pp")) | ||
Puppet[:confdir] = @puppetdir | ||
end | ||
|
||
c.after :each do | ||
FileUtils.rm_rf(Dir.glob('/tmp/iptables20*') , :secure => true) | ||
end | ||
|
||
c.module_path = File.join(File.dirname(__FILE__), '../../') | ||
end | ||
|