Apparently the mail server does not accept ".patch" attachments...
Attaching again in ".txt"
rabih
On Mon, Jun 6, 2016 at 6:43 PM, Rabih M <[email protected]> wrote:
> Hello,
>
> I made a small patch to fix some minor bugs in the dispatcher unit-tests
> concerning ipv6. (patch attached)
> But i have one remaining unit-test that fails "system_tests_policy". This
> is because tests/policy-1/policy-safari.json
> and tests/policy-1/policy-boardwalk.json have has "::1" in the localhost
> field.
> I can't find a way to tell the test to ignore this value if the machine is
> in ipv4 mode and to keep it in case we have both...
>
> Anybody has an idea?
>
> Thanks,
> Rabih
>
> On Fri, Jun 3, 2016 at 8:14 PM, Ganesh Murthy <[email protected]> wrote:
>
>> Hi Rabih,
>> We actually looked into that. Chuck Rolke already raised a JIRA for
>> that - https://issues.apache.org/jira/browse/DISPATCH-216
>>
>> We thought we could rely on Python's socket.has_ipv6 to turn off the test
>> but it turned out that socket.has_ipv6 is a constant (please read comments
>> in the above JIRA).
>>
>> I have not found a way in Python or in cmake to accurately find out if a
>> machine has IPv6 turned off.
>>
>> I would love to hear if anybody has any ideas.
>>
>> Thanks.
>>
>> ----- Original Message -----
>> > From: "Rabih M" <[email protected]>
>> > To: [email protected]
>> > Sent: Friday, June 3, 2016 1:09:52 PM
>> > Subject: [Dispatcher] system_tests_protocol_family test fails if no
>> ipv6 is supported
>> >
>> > Hello,
>> >
>> > Is there any way to make system_tests_protocol_family test pass if the
>> > machine does not support ipv6? is there a way cmake can detect that?
>> >
>> > Thanks,
>> > R
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
diff --git a/python/qpid_dispatch_internal/policy/policy_local.py
b/python/qpid_dispatch_internal/policy/policy_local.py
index cb62896..73eb8c5 100644
--- a/python/qpid_dispatch_internal/policy/policy_local.py
+++ b/python/qpid_dispatch_internal/policy/policy_local.py
@@ -730,7 +730,10 @@ class PolicyLocal(object):
Test function to load a policy.
@return:
"""
- ruleset_str = '["policyAccessRuleset", {"applicationName":
"photoserver","maxConnections": 50,"maxConnPerUser": 5,"maxConnPerHost":
20,"userGroups": {"anonymous": "anonymous","users": "u1,
u2","paidsubscribers": "p1, p2","test": "zeke, ynot","admin":
"alice, bob","superuser": "ellen"},"ingressHostGroups": {"Ten18":
"10.18.0.0-10.18.255.255","EllensWS": "72.135.2.9","TheLabs":
"10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255","localhost":
"127.0.0.1, ::1","TheWorld": "*"},"ingressPolicies": {"anonymous":
"TheWorld","users": "TheWorld","paidsubscribers": "TheWorld","test":
"TheLabs","admin": "Ten18, TheLabs, localhost","superuser":
"EllensWS, localhost"},"connectionAllowDefault": true,'
+ if HostAddr.has_ipv6():
+ ruleset_str = '["policyAccessRuleset", {"applicationName":
"photoserver","maxConnections": 50,"maxConnPerUser": 5,"maxConnPerHost":
20,"userGroups": {"anonymous": "anonymous","users": "u1,
u2","paidsubscribers": "p1, p2","test": "zeke, ynot","admin":
"alice, bob","superuser": "ellen"},"ingressHostGroups": {"Ten18":
"10.18.0.0-10.18.255.255","EllensWS": "72.135.2.9","TheLabs":
"10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255","localhost":
"127.0.0.1, ::1","TheWorld": "*"},"ingressPolicies": {"anonymous":
"TheWorld","users": "TheWorld","paidsubscribers": "TheWorld","test":
"TheLabs","admin": "Ten18, TheLabs, localhost","superuser":
"EllensWS, localhost"},"connectionAllowDefault": true,'
+ else:
+ ruleset_str = '["policyAccessRuleset", {"applicationName":
"photoserver","maxConnections": 50,"maxConnPerUser": 5,"maxConnPerHost":
20,"userGroups": {"anonymous": "anonymous","users": "u1,
u2","paidsubscribers": "p1, p2","test": "zeke, ynot","admin":
"alice, bob","superuser": "ellen"},"ingressHostGroups": {"Ten18":
"10.18.0.0-10.18.255.255","EllensWS": "72.135.2.9","TheLabs":
"10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255","localhost":
"127.0.0.1","TheWorld": "*"},"ingressPolicies": {"anonymous":
"TheWorld","users": "TheWorld","paidsubscribers": "TheWorld","test":
"TheLabs","admin": "Ten18, TheLabs, localhost","superuser":
"EllensWS, localhost"},"connectionAllowDefault": true,'
ruleset_str += '"settings": {'
ruleset_str += '"anonymous": {"maxFrameSize":
111111,"maxMessageSize": 111111,"maxSessionWindow": 111111,"maxSessions":
1,"maxSenders": 11,"maxReceivers":
11,"allowDynamicSrc": false,"allowAnonymousSender": false,"sources":
"public", "targets": ""},'
ruleset_str += '"users": {"maxFrameSize":
222222,"maxMessageSize": 222222,"maxSessionWindow": 222222,"maxSessions":
2,"maxSenders": 22,"maxReceivers":
22,"allowDynamicSrc": false,"allowAnonymousSender": false,"sources":
"public, private", "targets": "public"},'
diff --git a/python/qpid_dispatch_internal/policy/policy_util.py
b/python/qpid_dispatch_internal/policy/policy_util.py
index 1cb09d3..5e1848a 100644
--- a/python/qpid_dispatch_internal/policy/policy_util.py
+++ b/python/qpid_dispatch_internal/policy/policy_util.py
@@ -116,7 +116,8 @@ class HostAddr(object):
Raises a PolicyError on validation error in constructor.
"""
- def has_ipv6(self):
+ @staticmethod
+ def has_ipv6():
return socket.has_ipv6
def __init__(self, hostspec, separator=","):
diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py
index c2359f2..26c3fe8 100644
--- a/tests/router_policy_test.py
+++ b/tests/router_policy_test.py
@@ -61,7 +61,7 @@ class PolicyHostAddrTest(TestCase):
self.check_hostaddr_match(bbb, "1.1.2.0", False)
def test_policy_hostaddr_ipv6(self):
- if not HostAddr.has_ipv6:
+ if not HostAddr.has_ipv6():
self.skipTest("System IPv6 support is not available")
# Create simple host and range
aaa = HostAddr("::1")
@@ -88,7 +88,7 @@ class PolicyHostAddrTest(TestCase):
def test_policy_hostaddr_ipv6_wildcard(self):
- if not HostAddr.has_ipv6:
+ if not HostAddr.has_ipv6():
self.skipTest("System IPv6 support is not available")
aaa = HostAddr("*")
self.check_hostaddr_match(aaa,"::0")
@@ -101,7 +101,7 @@ class PolicyHostAddrTest(TestCase):
self.expect_deny( "9.9.9.9,8.8.8.8", "a > b")
def test_policy_malformed_hostaddr_ipv6(self):
- if not HostAddr.has_ipv6:
+ if not HostAddr.has_ipv6():
self.skipTest("System IPv6 support is not available")
self.expect_deny( "1::2::3", "Name or service not known")
self.expect_deny( "::1,::2,::3", "arg count")
diff --git a/tests/system_tests_protocol_family.py
b/tests/system_tests_protocol_family.py
index 4b46eed..676bf47 100644
--- a/tests/system_tests_protocol_family.py
+++ b/tests/system_tests_protocol_family.py
@@ -21,6 +21,7 @@ import unittest
from time import sleep
from proton import Message
from system_test import TestCase, Qdrouterd, main_module
+from qpid_dispatch_internal.policy.policy_util import HostAddr
try:
from proton import MODIFIED
@@ -37,6 +38,8 @@ class ProtocolFamilyTest(TestCase):
other on ports using the assigned protocol family.
"""
super(ProtocolFamilyTest, cls).setUpClass()
+ if not HostAddr.has_ipv6():
+ return
def router(name, connection):
@@ -110,6 +113,8 @@ class ProtocolFamilyTest(TestCase):
# If this test has started executing, it means that the setUpClass() has
successfully executed which means that
# the routers were able to communicate with each other successfully using
the specified protocol family.
def test_simple_pre_settled(self):
+ if not HostAddr.has_ipv6():
+ self.skipTest("System IPv6 support is not available")
addr = self.routers[0].addresses[4]+"/test/1"
M1 = self.messenger()
M2 = self.messenger()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]