Hello Ganesh,
I tested your pull request and it doesn't seem that the error message you check for in "is_ipv6_enabled" is correct. In my case, Exception e is (print "---->%s: %s" %(type(e), str(e))): "<class 'socket.error'>: getsockaddrarg: bad family" I have attached the log of all the tests. This way you can see what is happening. I think there are multiple errors being shown. I am also attaching the patch which I had used to disable IPv6 brutally (Of course it is not a patch to be accepted but just to show you what we had to do to ignore the errors). Regards, Adel ________________________________ From: Ganesh Murthy <gmur...@redhat.com> Sent: Tuesday, January 31, 2017 8:24:12 PM To: users@qpid.apache.org Subject: Fwd: [GitHub] qpid-dispatch pull request #140: DISPATCH-216 - Added code to skip system_te... Hi Adel, Can you please apply this pull request in your environment and let me know if the system_tests_protocol_family.py tests are skipped. Thanks. ----- Forwarded Message ----- From: "ganeshmurthy" <g...@git.apache.org> To: d...@qpid.apache.org Sent: Tuesday, January 31, 2017 2:19:38 PM Subject: [GitHub] qpid-dispatch pull request #140: DISPATCH-216 - Added code to skip system_te... GitHub user ganeshmurthy opened a pull request: https://github.com/apache/qpid-dispatch/pull/140 DISPATCH-216 - Added code to skip system_tests_protocol_family.py if … …IPv6 is turned off You can merge this pull request into a Git repository by running: $ git pull https://github.com/ganeshmurthy/qpid-dispatch DISPATCH-216 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-dispatch/pull/140.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #140 ---- commit a0b16449e7fd257b2abee347ae211ab6a33bc53c Author: Ganesh Murthy <gmur...@redhat.com> Date: 2017-01-31T19:18:10Z DISPATCH-216 - Added code to skip system_tests_protocol_family.py if IPv6 is turned off ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org
test 12 Start 12: router_policy_test 12: Test command: /python278/bin/python "/build-dir/qpid-dispatch/tests/run.py" "-m" "unittest" "-v" "router_policy_test" 12: Test timeout computed to be: 1500 12: Run python module 'unittest': PolicyError: u'Policy \'photoserver\' is invalid: Policy vhost \'photoserver\' user group \'superuser\' option \'remoteHosts\' connectionOption \'::1\' failed to translate: \'\'HostStruct: \\\'::1\\\' failed to resolve: \\\'"HostStruct: \\\'::1\\\' did not resolve to one of the supported address family"\\\'\'\'.' 12: Traceback (most recent call last): 12: File "/build-dir/qpid-dispatch/tests/run.py", line 148, in <module> 12: runpy.run_module(sys.argv[0], alter_sys=True, run_name="__main__") 12: File "/python278/lib/python2.7/runpy.py", line 176, in run_module 12: fname, loader, pkg_name) 12: File "/python278/lib/python2.7/runpy.py", line 82, in _run_module_code 12: mod_name, mod_fname, mod_loader, pkg_name) 12: File "/python278/lib/python2.7/runpy.py", line 72, in _run_code 12: exec code in run_globals 12: File "/python278/lib/python2.7/unittest/__main__.py", line 12, in <module> 12: main(module=None) 12: File "/python278/lib/python2.7/unittest/main.py", line 94, in __init__ 12: self.parseArgs(argv) 12: File "/python278/lib/python2.7/unittest/main.py", line 149, in parseArgs 12: self.createTests() 12: File "/python278/lib/python2.7/unittest/main.py", line 158, in createTests 12: self.module) 12: File "/python278/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames 12: suites = [self.loadTestsFromName(name, module) for name in names] 12: File "/python278/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName 12: module = __import__('.'.join(parts_copy)) 12: File "/qpid-dispatch-0.7.0/tests/router_policy_test.py", line 140, in <module> 12: class PolicyFile(TestCase): 12: File "/qpid-dispatch-0.7.0/tests/router_policy_test.py", line 144, in PolicyFile 12: policy.test_load_config() 12: File "/qpid-dispatch-0.7.0/python/qpid_dispatch_internal/policy/policy_local.py", line 712, in test_load_config 12: self.create_ruleset(ruleset[1]) 12: File "/qpid-dispatch-0.7.0/python/qpid_dispatch_internal/policy/policy_local.py", line 493, in create_ruleset 12: raise PolicyError("Policy '%s' is invalid: %s" % (name, diag[0])) 12: qpid_dispatch_internal.policy.policy_util.PolicyError: u'Policy \'photoserver\' is invalid: Policy vhost \'photoserver\' user group \'superuser\' option \'remoteHosts\' connectionOption \'::1\' failed to translate: \'\'HostStruct: \\\'::1\\\' failed to resolve: \\\'"HostStruct: \\\'::1\\\' did not resolve to one of the supported address family"\\\'\'\'.' 12/26 Test #12: router_policy_test ...............***Failed 0.10 sec test 18 Start 18: system_tests_policy 18: Test command: /python278/bin/python "/build-dir/qpid-dispatch/tests/run.py" "-m" "unittest" "-v" "system_tests_policy" 18: Test timeout computed to be: 1500 18: test_verify_maximum_connections (system_tests_policy.AbsoluteConnectionCountLimit) ... ok 18: ERROR 18: test_verify_n_receivers (system_tests_policy.SenderReceiverLimits) ... ok 18: test_verify_n_senders (system_tests_policy.SenderReceiverLimits) ... ok 18: 18: ====================================================================== 18: ERROR: setUpClass (system_tests_policy.LoadPolicyFromFolder) 18: ---------------------------------------------------------------------- 18: Traceback (most recent call last): 18: File "/qpid-dispatch-0.7.0/tests/system_tests_policy.py", line 88, in setUpClass 18: cls.router = cls.tester.qdrouterd('conn-limit-router', config, wait=True) 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 591, in qdrouterd 18: return self.cleanup(Qdrouterd(*args, **kwargs)) 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 357, in __init__ 18: self.wait_ready() 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 486, in wait_ready 18: self.wait_ports(**retry_kwargs) 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 471, in wait_ports 18: wait_ports(self.ports_family, **retry_kwargs) 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 194, in wait_ports 18: wait_port(port=port, protocol_family=protocol_family, **retry_kwargs) 18: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 186, in wait_port 18: raise Exception("wait_port timeout on host %s port %s: %s"%(host, port, e)) 18: Exception: wait_port timeout on host 127.0.0.1 port 26869: [Errno 146] Connection refused 18: 18: ---------------------------------------------------------------------- 18: Ran 3 tests in 60.425s 18: 18: FAILED (errors=1) 18/26 Test #18: system_tests_policy ..............***Failed 60.53 sec test 19 Start 19: system_tests_protocol_family 19: Test command: /python278/bin/python "/build-dir/qpid-dispatch/tests/run.py" "-m" "unittest" "-v" "system_tests_protocol_family" 19: Test timeout computed to be: 1500 19: ERROR 19: 19: ====================================================================== 19: ERROR: setUpClass (system_tests_protocol_family.ProtocolFamilyTest) 19: ---------------------------------------------------------------------- 19: Traceback (most recent call last): 19: File "/qpid-dispatch-0.7.0/tests/system_tests_protocol_family.py", line 80, in setUpClass 19: inter_router_port = cls.tester.get_port(protocol_family='IPv6') 19: File "/qpid-dispatch-0.7.0/tests/system_test.py", line 616, in get_port 19: raise Exception("No available ports in range %s", cls.port_range) 19: Exception: ('No available ports in range %s', (20000, 30000)) 19: 19: ---------------------------------------------------------------------- 19: Ran 0 tests in 0.137s 19: 19: FAILED (errors=1) 19/26 Test #19: system_tests_protocol_family .....***Failed 0.23 sec test 20 Start 20: system_tests_qdmanage 88% tests passed, 3 tests failed out of 26 Total Test time (real) = 208.62 sec The following tests FAILED: 12 - router_policy_test (Failed) 18 - system_tests_policy (Failed) 19 - system_tests_protocol_family (Failed)
From d9052690a8519830e7aa9bdeb1c4b00d3b2e8db8 Mon Sep 17 00:00:00 2001 From: aboutros <adel.bout...@murex.com> Date: Thu, 26 Jan 2017 09:09:35 +0100 Subject: [PATCH] Remove IPv6 support --- python/qpid_dispatch_internal/policy/policy_local.py | 8 ++++++-- python/qpid_dispatch_internal/policy/policy_util.py | 3 ++- tests/policy-1/policy-boardwalk.json | 2 +- tests/policy-1/policy-safari.json | 2 +- tests/policy-2/test-router-with-policy.json.in | 4 ++-- tests/router_policy_test.py | 6 +++--- tests/system_tests_protocol_family.py | 6 ++++++ 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/python/qpid_dispatch_internal/policy/policy_local.py b/python/qpid_dispatch_internal/policy/policy_local.py index 8da5402..3cce82f 100644 --- a/python/qpid_dispatch_internal/policy/policy_local.py +++ b/python/qpid_dispatch_internal/policy/policy_local.py @@ -702,8 +702,12 @@ class PolicyLocal(object): ruleset_str += '"users": { "users": "u1, u2", "remoteHosts": "*", "maxFrameSize": 222222, "maxMessageSize": 222222, "maxSessionWindow": 222222, "maxSessions": 2, "maxSenders": 22, "maxReceivers": 22, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private", "targets": "public" },' ruleset_str += '"paidsubscribers": { "users": "p1, p2", "remoteHosts": "*", "maxFrameSize": 333333, "maxMessageSize": 333333, "maxSessionWindow": 333333, "maxSessions": 3, "maxSenders": 33, "maxReceivers": 33, "allowDynamicSource": true, "allowAnonymousSender": false, "sources": "public, private", "targets": "public, private" },' ruleset_str += '"test": { "users": "zeke, ynot", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255", "maxFrameSize": 444444, "maxMessageSize": 444444, "maxSessionWindow": 444444, "maxSessions": 4, "maxSenders": 44, "maxReceivers": 44, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "private", "targets": "private" },' - ruleset_str += '"admin": { "users": "alice, bob", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1, ::1", "maxFrameSize": 555555, "maxMessageSize": 555555, "maxSessionWindow": 555555, "maxSessions": 5, "maxSenders": 55, "maxReceivers": 55, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "public, private, management", "targets": "public, private, management" },' - ruleset_str += '"superuser": { "users": "ellen", "remoteHosts": "72.135.2.9, 127.0.0.1, ::1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, "maxSessions": 6, "maxSenders": 66, "maxReceivers": 66, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private, management, root", "targets": "public, private, management, root" },' + if HostAddr.has_ipv6(): + ruleset_str += '"admin": { "users": "alice, bob", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1, ::1", "maxFrameSize": 555555, "maxMessageSize": 555555, "maxSessionWindow": 555555, "maxSessions": 5, "maxSenders": 55, "maxReceivers": 55, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "public, private, management", "targets": "public, private, management" },' + ruleset_str += '"superuser": { "users": "ellen", "remoteHosts": "72.135.2.9, 127.0.0.1, ::1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, "maxSessions": 6, "maxSenders": 66, "maxReceivers": 66, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private, management, root", "targets": "public, private, management, root" },' + else: + ruleset_str += '"admin": { "users": "alice, bob", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1", "maxFrameSize": 555555, "maxMessageSize": 555555, "maxSessionWindow": 555555, "maxSessions": 5, "maxSenders": 55, "maxReceivers": 55, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "public, private, management", "targets": "public, private, management" },' + ruleset_str += '"superuser": { "users": "ellen", "remoteHosts": "72.135.2.9, 127.0.0.1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, "maxSessions": 6, "maxSenders": 66, "maxReceivers": 66, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private, management, root", "targets": "public, private, management, root" },' ruleset_str += '"$default": { "remoteHosts": "*", "maxFrameSize": 222222, "maxMessageSize": 222222, "maxSessionWindow": 222222, "maxSessions": 2, "maxSenders": 22, "maxReceivers": 22, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private", "targets": "public" }' ruleset_str += '}}]' diff --git a/python/qpid_dispatch_internal/policy/policy_util.py b/python/qpid_dispatch_internal/policy/policy_util.py index a955808..a1fa35c 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/policy-1/policy-boardwalk.json b/tests/policy-1/policy-boardwalk.json index 0961402..0cac3c7 100644 --- a/tests/policy-1/policy-boardwalk.json +++ b/tests/policy-1/policy-boardwalk.json @@ -57,7 +57,7 @@ }, "superuser": { "users": "ellen", - "remoteHosts": "127.0.0.1, ::1, 72.135.2.9", + "remoteHosts": "127.0.0.1, 72.135.2.9", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, diff --git a/tests/policy-1/policy-safari.json b/tests/policy-1/policy-safari.json index 107d35f..03bb77a 100644 --- a/tests/policy-1/policy-safari.json +++ b/tests/policy-1/policy-safari.json @@ -56,7 +56,7 @@ }, "guides": { "users": "kata, hapa", - "remoteHosts": "72.135.2.9, 10.48.0.0-10.48.255.255, 192.168.0.0-192.168.255.255, 127.0.0.1, ::1", + "remoteHosts": "72.135.2.9, 10.48.0.0-10.48.255.255, 192.168.0.0-192.168.255.255, 127.0.0.1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, diff --git a/tests/policy-2/test-router-with-policy.json.in b/tests/policy-2/test-router-with-policy.json.in index c4de9f9..5f2532e 100644 --- a/tests/policy-2/test-router-with-policy.json.in +++ b/tests/policy-2/test-router-with-policy.json.in @@ -94,7 +94,7 @@ }, "admin" : { "users": "alice, bob", - "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1, ::1", + "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1", "maxFrameSize": 555555, "maxMessageSize": 555555, "maxSessionWindow": 555555, @@ -108,7 +108,7 @@ }, "superuser" : { "users": "ellen", - "remoteHosts": "72.135.2.9, 127.0.0.1, ::1", + "remoteHosts": "72.135.2.9, 127.0.0.1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py index af19277..3450f49 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 20822c1..b5a6007 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): @@ -105,6 +108,9 @@ 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() -- 2.7.0.windows.1
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org