summaryrefslogtreecommitdiffstats
path: root/spec/unit/network
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-06-02 15:56:22 -0700
committerMax Martin <max@puppetlabs.com>2011-06-02 15:56:22 -0700
commit4801e10c81264b20c2d35b0d44c10cfb0668d1b9 (patch)
tree3e3024bbd4a46a3ab2af5bf29ec2f3b30db270d7 /spec/unit/network
parent520cbc0292ec0cf75b6871bb0a4bc12bce506bb0 (diff)
parent4ad88017d3b8b8000325f5165520a6c21b48c469 (diff)
Merge branch '2.7.x'
* 2.7.x: (40 commits) (#7746) Fix bootstrap issues from #7717 fix. (#7683) Use ronn, when available, to render the output. (#7683) Add a 'man' face and subcommand to Puppet. maint: remove obsolete work-around code from help face. (#7699) Don't duplicate inherited action names on faces. (#7177) Deprecate implicit 'puppet apply' for 2.7.0 (#7717) Layout cleanup for subcommand extraction. #7211: Test unknown options don't shadow unknown actions. #7211: nasty logic error with global Face options taking arguments. #7211: more helpful error messages in various cases. maint: Fix order dependent test failure (#5966) Add support for hostname regular expressions in auth.conf (#7708) Delete extended documentation from configuration reference (#7707) Document signals in puppet agent and puppet master help add puppet master polling step for ticket 7117 (#5318) Always notice changes to manifests when compiling. (#5318) Always notice changes to manifests when compiling. (#7557) Remove Faces Application maint: Fix order dependent spec failure for face indirection (#7690) Don't blow up when listing terminuses available for faces ... Conflicts (resolved manually): acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb
Diffstat (limited to 'spec/unit/network')
-rwxr-xr-xspec/unit/network/authstore_spec.rb40
1 files changed, 36 insertions, 4 deletions
diff --git a/spec/unit/network/authstore_spec.rb b/spec/unit/network/authstore_spec.rb
index d62c8abaa..32ce1930f 100755
--- a/spec/unit/network/authstore_spec.rb
+++ b/spec/unit/network/authstore_spec.rb
@@ -4,11 +4,12 @@ require 'spec_helper'
require 'puppet/network/authconfig'
describe Puppet::Network::AuthStore do
- describe "when checking if the acl has some entries" do
- before :each do
- @authstore = Puppet::Network::AuthStore.new
- end
+ before :each do
+ @authstore = Puppet::Network::AuthStore.new
+ @authstore.reset_interpolation
+ end
+ describe "when checking if the acl has some entries" do
it "should be empty if no ACE have been entered" do
@authstore.should be_empty
end
@@ -31,6 +32,37 @@ describe Puppet::Network::AuthStore do
@authstore.should_not be_empty
end
end
+
+ describe "when checking global allow" do
+ it "should not be enabled by default" do
+ @authstore.should_not be_globalallow
+ @authstore.should_not be_allowed('foo.bar.com', '192.168.1.1')
+ end
+
+ it "should always allow when enabled" do
+ @authstore.allow('*')
+
+ @authstore.should be_globalallow
+ @authstore.should be_allowed('foo.bar.com', '192.168.1.1')
+ end
+ end
+
+ describe "when checking a regex type of allow" do
+ before :each do
+ @authstore.allow('/^(test-)?host[0-9]+\.other-domain\.(com|org|net)$|some-domain\.com/')
+ @ip = '192.168.1.1'
+ end
+ ['host5.other-domain.com', 'test-host12.other-domain.net', 'foo.some-domain.com'].each { |name|
+ it "should allow the host #{name}" do
+ @authstore.should be_allowed(name, @ip)
+ end
+ }
+ ['host0.some-other-domain.com',''].each { |name|
+ it "should not allow the host #{name}" do
+ @authstore.should_not be_allowed(name, @ip)
+ end
+ }
+ end
end
describe Puppet::Network::AuthStore::Declaration do