summaryrefslogtreecommitdiff
path: root/test/drb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 09:53:52 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 09:53:52 +0000
commit49ce3ca3742e09c3ce1e5e9a12d9e30a504d711e (patch)
tree487fa26d1df71011f2eb8bf3839f9b317fee2908 /test/drb
parent0fc3ae4a75ecaed825a2a70294e4a36b993707a7 (diff)
Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixError
This is because it would be a user error because a pattern containing a slash shouldn't be a host name pattern but an IP address pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb')
-rw-r--r--test/drb/test_acl.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/drb/test_acl.rb b/test/drb/test_acl.rb
index 6ac89b156b..436ee92207 100644
--- a/test/drb/test_acl.rb
+++ b/test/drb/test_acl.rb
@@ -66,9 +66,9 @@ class ACLEntryTest < Test::Unit::TestCase
assert_not_operator(a, :match, @hosts['localhost'])
assert_operator(a, :match, @hosts['yum'])
- a = ACL::ACLEntry.new('192.168.0.1/255.255.0.255')
+ a = ACL::ACLEntry.new('192.168.1.0/255.255.255.0')
assert_not_operator(a, :match, @hosts['localhost'])
- assert_not_operator(a, :match, @hosts['yum'])
+ assert_operator(a, :match, @hosts['yum'])
assert_operator(a, :match, @hosts['x68k'])
a = ACL::ACLEntry.new('192.168.1.0/24')
@@ -81,10 +81,14 @@ class ACLEntryTest < Test::Unit::TestCase
assert_not_operator(a, :match, @hosts['yum'])
assert_not_operator(a, :match, @hosts['x68k'])
- a = ACL::ACLEntry.new('127.0.0.1/255.0.0.255')
+ a = ACL::ACLEntry.new('127.0.0.0/255.0.0.0')
assert_operator(a, :match, @hosts['localhost'])
assert_not_operator(a, :match, @hosts['yum'])
assert_not_operator(a, :match, @hosts['x68k'])
+
+ assert_raise(IPAddr::InvalidPrefixError) {
+ ACL::ACLEntry.new('192.168.0.0/33')
+ }
end
def test_name
@@ -136,10 +140,12 @@ class ACLListTest < Test::Unit::TestCase
end
def test_1
- a = build(%w(192.0.0.1/255.0.0.255 yum.*.jp))
- assert_operator(a, :match, @hosts['yum'])
+ a = build(%w(192.168.1.0/255.255.255.252 yum.*.jp))
assert_operator(a, :match, @hosts['x68k'])
- assert_not_operator(a, :match, @hosts['lc630'])
+ assert_operator(a, :match, @hosts['lc630'])
+ assert_operator(a, :match, @hosts['lib30'])
+ assert_not_operator(a, :match, @hosts['ns00'])
+ assert_operator(a, :match, @hosts['yum'])
end
def test_2