qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject [qpid-dispatch] branch master updated: DISPATCH-1277 - Defaulted the policy max-frame-size default to 16384 to comply with the maxFrameSize default in vhostUserGroupSettings
Date Tue, 05 Mar 2019 20:08:27 GMT
This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 055ac6b  DISPATCH-1277 - Defaulted the policy max-frame-size default to 16384 to
comply with the maxFrameSize default in vhostUserGroupSettings
055ac6b is described below

commit 055ac6b05086cd12e843c25ff691271047da5a4c
Author: Ganesh Murthy <gmurthy@redhat.com>
AuthorDate: Tue Mar 5 15:08:01 2019 -0500

    DISPATCH-1277 - Defaulted the policy max-frame-size default to 16384 to comply with the
maxFrameSize default in vhostUserGroupSettings
---
 .../qpid_dispatch_internal/policy/policy_local.py  |  3 +-
 tests/one-router-policy/default.json               | 35 ++++++++++++++++++++++
 tests/system_tests_one_router.py                   | 11 +++++--
 3 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/python/qpid_dispatch_internal/policy/policy_local.py b/python/qpid_dispatch_internal/policy/policy_local.py
index b62e8d4..4191db5 100644
--- a/python/qpid_dispatch_internal/policy/policy_local.py
+++ b/python/qpid_dispatch_internal/policy/policy_local.py
@@ -238,7 +238,8 @@ class PolicyCompiler(object):
         # rulesets may not come through standard config so make nice defaults
         policy_out[PolicyKeys.KW_USERS] = ''
         policy_out[PolicyKeys.KW_REMOTE_HOSTS] = ''
-        policy_out[PolicyKeys.KW_MAX_FRAME_SIZE] = 2147483647
+        # DISPATCH-1277 - KW_MAX_FRAME_SIZE must be defaulted to 16384 not 2147483647
+        policy_out[PolicyKeys.KW_MAX_FRAME_SIZE] = 16384
         policy_out[PolicyKeys.KW_MAX_MESSAGE_SIZE] = 0
         policy_out[PolicyKeys.KW_MAX_SESSION_WINDOW] = 2147483647
         policy_out[PolicyKeys.KW_MAX_SESSIONS] = 65536
diff --git a/tests/one-router-policy/default.json b/tests/one-router-policy/default.json
new file mode 100644
index 0000000..155dd68
--- /dev/null
+++ b/tests/one-router-policy/default.json
@@ -0,0 +1,35 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License
+##
+[
+    ["vhost", {
+        "hostname": "$default",
+        "allowUnknownUser": true,
+        "groups" : {
+                "$default": {
+                    "remoteHosts": "*",
+                    "allowDynamicSource": true,
+                    "allowAnonymousSender": true,
+		    "allowAdminStatusUpdate": true,
+		    "targets": "*",
+		    "sources": "*"
+                }
+             }
+         }
+    ]
+]
diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index 3c828d5..7b587d2 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -24,11 +24,12 @@ from __future__ import print_function
 
 import unittest2 as unittest
 from proton import Condition, Message, Delivery, Url, symbol, Timeout
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, DIR
 from proton.handlers import MessagingHandler, TransactionHandler
 from proton.reactor import Container, AtMostOnce, AtLeastOnce, DynamicNodeProperties, LinkOption,
ApplicationEvent, EventInjector
 from proton.utils import BlockingConnection, SyncRequestResponse
 from qpid_dispatch.management.client import Node
+import os, json
 
 CONNECTION_PROPERTIES_UNICODE_STRING = {u'connection': u'properties', u'int_property': 6451}
 CONNECTION_PROPERTIES_SYMBOL = dict()
@@ -59,9 +60,12 @@ class OneRouterTest(TestCase):
         """Start a router and a messenger"""
         super(OneRouterTest, cls).setUpClass()
         name = "test-router"
+        policy_config_path = os.path.join(DIR, 'one-router-policy')
         OneRouterTest.listen_port = cls.tester.get_port()
         config = Qdrouterd.Config([
             ('router', {'mode': 'standalone', 'id': 'QDR', 'allowUnsettledMulticast': 'yes'}),
+            ('policy', {'policyDir': policy_config_path,
+                        'enableVhostPolicy': 'true'}),
 
             # Setting the stripAnnotations to 'no' so that the existing tests will work.
             # Setting stripAnnotations to no will not strip the annotations and any tests
that were already in this file
@@ -115,7 +119,9 @@ class OneRouterTest(TestCase):
         test.run ( )
         self.assertEqual ( None, test.error )
 
-
+    # DISPATCH-1277. This test will fail with a policy but without the fix in policy_local.py
+    # In other words, if the max-frame-size was 2147483647 and not 16384, this
+    # test would fail.
     def test_04_disposition_returns_to_closed_connection ( self ) :
         addr = self.address + '/closest/' + str(OneRouterTest.closest_count)
         OneRouterTest.closest_count += 1
@@ -992,7 +998,6 @@ class PreSettled ( MessagingHandler ) :
     def on_start ( self, event ):
         self.send_conn = event.container.connect ( self.addr )
         self.recv_conn = event.container.connect ( self.addr )
-
         self.sender   = event.container.create_sender   ( self.send_conn, self.addr )
         self.receiver = event.container.create_receiver ( self.send_conn, self.addr )
         self.receiver.flow ( self.n_messages )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message