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 0e03aea DISPATCH-1323 - Deprecate addr and externalAddr attributes of autoLink entity. Add address and externalAddress instead. This closes #504. 0e03aea is described below commit 0e03aea5cd7a3be06922541e7ef4a2b87a8beaee Author: Ganesh Murthy <gmur...@apache.org> AuthorDate: Thu May 9 14:33:23 2019 -0400 DISPATCH-1323 - Deprecate addr and externalAddr attributes of autoLink entity. Add address and externalAddress instead. This closes #504. --- docs/books/old-user-guide/auto_links.adoc | 50 +++++++++++----------- docs/books/user-guide/configuration-reference.adoc | 3 +- docs/books/user-guide/logging.adoc | 4 +- docs/books/user-guide/reliability.adoc | 24 +++++------ docs/books/user-guide/routing.adoc | 20 ++++----- python/qpid_dispatch/management/qdrouter.json | 6 ++- src/router_config.c | 18 ++++---- src/router_core/agent_config_auto_link.c | 43 +++++++++++++------ src/router_core/agent_config_auto_link.h | 2 +- tests/system_tests_autolinks.py | 30 ++++++------- tests/system_tests_deprecated.py | 11 ++++- tests/system_tests_distribution.py | 20 ++++----- tests/system_tests_edge_router.py | 8 ++-- tests/system_tests_global_delivery_counts.py | 8 ++-- tests/system_tests_link_routes.py | 2 +- tests/system_tests_multi_tenancy.py | 8 ++-- tests/system_tests_policy.py | 8 ++-- tests/system_tests_qdmanage.py | 2 +- tools/qdstat.in | 6 +-- 19 files changed, 152 insertions(+), 121 deletions(-) diff --git a/docs/books/old-user-guide/auto_links.adoc b/docs/books/old-user-guide/auto_links.adoc index 5ef8bc7..2ee2bab 100644 --- a/docs/books/old-user-guide/auto_links.adoc +++ b/docs/books/old-user-guide/auto_links.adoc @@ -64,26 +64,26 @@ address { } autoLink { - addr: queue.first - dir: in + address: queue.first + direction: in connection: broker } autoLink { - addr: queue.first - dir: out + address: queue.first + direction: out connection: broker } autoLink { - addr: queue.second - dir: in + address: queue.second + direction: in connection: broker } autoLink { - addr: queue.second - dir: out + address: queue.second + direction: out connection: broker } ---- @@ -212,26 +212,26 @@ address { } autoLink { - addr: queue.first - dir: in + address: queue.first + direction: in connection: broker1 } autoLink { - addr: queue.first - dir: out + address: queue.first + direction: out connection: broker1 } autoLink { - addr: queue.first - dir: in + address: queue.first + direction: in connection: broker2 } autoLink { - addr: queue.first - dir: out + address: queue.first + direction: out connection: broker2 } ---- @@ -252,8 +252,8 @@ using `qdmanage`: ---- qdmanage create --type org.apache.qpid.dispatch.connector host=<host> port=<port> name=broker3 -qdmanage create --type org.apache.qpid.dispatch.router.config.autoLink addr=queue.first dir=in connection=broker3 -qdmanage create --type org.apache.qpid.dispatch.router.config.autoLink addr=queue.first dir=out connection=broker3 +qdmanage create --type org.apache.qpid.dispatch.router.config.autoLink address=queue.first direction=in connection=broker3 +qdmanage create --type org.apache.qpid.dispatch.router.config.autoLink address=queue.first direction=out connection=broker3 ---- [[address-renaming]] @@ -263,7 +263,7 @@ Using a Different External Address on an Auto-Link Sometimes, greater flexibility is needed with regard to the addressing of a waypoint. For example, the above sharded-queue example requires that the two instances of the queue have the same name/address. -Auto-links can be configured with an independent +externalAddr+ that +Auto-links can be configured with an independent +externalAddress+ that allows the waypoint to have a different address than that which is used by the senders and receivers. @@ -284,16 +284,16 @@ address { } autoLink { - addr: queue.first - externalAddr: broker_queue - dir: in + address: queue.first + externalAddress: broker_queue + direction: in connection: broker } autoLink { - addr: queue.first - externalAddr: broker_queue - dir: out + address: queue.first + externalAddress: broker_queue + direction: out connection: broker } diff --git a/docs/books/user-guide/configuration-reference.adoc b/docs/books/user-guide/configuration-reference.adoc index d713b28..c25cd2c 100644 --- a/docs/books/user-guide/configuration-reference.adoc +++ b/docs/books/user-guide/configuration-reference.adoc @@ -185,11 +185,12 @@ Entity type for link-route configuration. This is used to identify remote contai Entity type for configuring auto-links. Auto-links are links whose lifecycle is managed by the router. These are typically used to attach to waypoints on remote containers (brokers, and so on.). -* *_addr_* (string, required) : The address of the provisioned object. +* *_address_* (string, required) : The address of the provisioned object. * *_direction_* (One of [`in`, `out`], required) : The direction of the link to be created. In means into the router, out means out of the router. * *_phase_* (integer) : The address phase for this link. Defaults to `0` for `out` links and `1` for `in` links. * *_containerId_* (string) : ContainerID for the target container. * *_connection_* (string) : The name from a connector or listener. +* *_externalAddress_* (string) : An alternate address of the node on the remote container. This is used if the node has a different address than the address used internally by the router to route deliveries. ==== console diff --git a/docs/books/user-guide/logging.adoc b/docs/books/user-guide/logging.adoc index 6742bc0..f6befba 100644 --- a/docs/books/user-guide/logging.adoc +++ b/docs/books/user-guide/logging.adoc @@ -192,8 +192,8 @@ Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAddressEntity(dis Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAddressEntity(distribution=balanced, identity=router.config.address/1, name=router.config.address/1, prefix=my_queue_wp, type=org.apache.qpid.dispatch.router.config.address, waypoint=True) Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigLinkrouteEntity(connection=BROKER, direction=in, distribution=linkBalanced, identity=router.config.linkRoute/0, name=router.config.linkRoute/0, prefix=my_queue, type=org.apache.qpid.dispatch.router.config.linkRoute) Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigLinkrouteEntity(connection=BROKER, direction=out, distribution=linkBalanced, identity=router.config.linkRoute/1, name=router.config.linkRoute/1, prefix=my_queue, type=org.apache.qpid.dispatch.router.config.linkRoute) -Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAutolinkEntity(addr=my_queue_wp, connection=BROKER, direction=in, identity=router.config.autoLink/0, name=router.config.autoLink/0, type=org.apache.qpid.dispatch.router.config.autoLink) -Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAutolinkEntity(addr=my_queue_wp, connection=BROKER, direction=out, identity=router.config.autoLink/1, name=router.config.autoLink/1, type=org.apache.qpid.dispatch.router.config.autoLink) +Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAutolinkEntity(address=my_queue_wp, connection=BROKER, direction=in, identity=router.config.autoLink/0, name=router.config.autoLink/0, type=org.apache.qpid.dispatch.router.config.autoLink) +Tue Jun 7 15:07:32 2016 AGENT (debug) Add entity: RouterConfigAutolinkEntity(address=my_queue_wp, connection=BROKER, direction=out, identity=router.config.autoLink/1, name=router.config.autoLink/1, type=org.apache.qpid.dispatch.router.config.autoLink) ---- === The `CONTAINER` Logging Module diff --git a/docs/books/user-guide/reliability.adoc b/docs/books/user-guide/reliability.adoc index 2826c55..414c77e 100644 --- a/docs/books/user-guide/reliability.adoc +++ b/docs/books/user-guide/reliability.adoc @@ -282,13 +282,13 @@ address { } autoLink { - addr: my_queue + address: my_queue connection: BROKER direction: in } autoLink { - addr: my_queue + address: my_queue connection: BROKER direction: out } @@ -411,8 +411,8 @@ $ sudo qdmanage -b localhost:6002 create --stdin [ { "type":"connector", "name":"BROKER", "port":5672, "role":"route-container" }, { "type":"address", "prefix":"my_queue", "waypoint":"yes" }, -{ "type":"autoLink", "addr":"my_queue", "connection":"BROKER", "direction":"in" }, -{ "type":"autoLink", "addr":"my_queue", "connection":"BROKER", "direction":"out" } +{ "type":"autoLink", "address":"my_queue", "connection":"BROKER", "direction":"in" }, +{ "type":"autoLink", "address":"my_queue", "connection":"BROKER", "direction":"out" } ] [ { @@ -442,7 +442,7 @@ $ sudo qdmanage -b localhost:6002 create --stdin "egressPhase": 0 }, { - "addr": "my_queue", + "address": "my_queue", "name": null, "linkRef": null, "type": "org.apache.qpid.dispatch.router.config.autoLink", @@ -451,12 +451,12 @@ $ sudo qdmanage -b localhost:6002 create --stdin "direction": "in", "phase": 1, "lastError": null, - "externalAddr": null, + "externalAddress": null, "identity": "8", "containerId": null }, { - "addr": "my_queue", + "address": "my_queue", "name": null, "linkRef": null, "type": "org.apache.qpid.dispatch.router.config.autoLink", @@ -465,7 +465,7 @@ $ sudo qdmanage -b localhost:6002 create --stdin "direction": "out", "phase": 0, "lastError": null, - "externalAddr": null, + "externalAddress": null, "identity": "9", "containerId": null } @@ -611,25 +611,25 @@ address { } autoLink { - addr: my_queue + address: my_queue connection: BROKER1 direction: in } autoLink { - addr: my_queue + address: my_queue connection: BROKER1 direction: out } autoLink { - addr: my_queue + address: my_queue connection: BROKER2 direction: in } autoLink { - addr: my_queue + address: my_queue connection: BROKER2 direction: out } diff --git a/docs/books/user-guide/routing.adoc b/docs/books/user-guide/routing.adoc index 508153f..22533da 100644 --- a/docs/books/user-guide/routing.adoc +++ b/docs/books/user-guide/routing.adoc @@ -481,15 +481,15 @@ For information about additional attributes, see link:{qdrouterdConfManPageUrl}# [options="nowrap",subs="+quotes"] ---- autoLink { - addr: _ADDRESS_ + address: _ADDRESS_ connection: _CONNECTOR_NAME_ direction: out ... } ---- -`addr`:: The address of the broker queue. When the autolink is created, it will be attached to this address. -`externalAddr`:: An optional alternate address for the broker queue. You use an external address if the broker queue should have a different address than that which the sender uses. In this scenario, senders send messages to the `addr` address, and then the router routes them to the broker queue represented by the `externalAddr` address. +`address`:: The address of the broker queue. When the autolink is created, it will be attached to this address. +`externalAddress`:: An optional alternate address for the broker queue. You use an external address if the broker queue should have a different address than that which the sender uses. In this scenario, senders send messages to the `addr` address, and then the router routes them to the broker queue represented by the `externalAddress` address. `connection` | `containerID`:: How the router should connect to the broker. You can specify either an outgoing connection (`connection`) or the container ID of the broker (`containerID`). `direction`:: Set this attribute to `out` to specify that this autolink can send messages from the router to the broker. @@ -502,15 +502,15 @@ For information about additional attributes, see link:{qdrouterdConfManPageUrl}# [options="nowrap",subs="+quotes"] ---- autoLink { - addr: _ADDRESS_ + address: _ADDRESS_ connection: _CONNECTOR_NAME_ direction: in ... } ---- -`addr`:: The address of the broker queue. When the autolink is created, it will be attached to this address. -`externalAddr`:: An optional alternate address for the broker queue. You use an external address if the broker queue should have a different address than that which the receiver uses. In this scenario, receivers receive messages from the `addr` address, and the router retrieves them from the broker queue represented by the `externalAddr` address. +`address`:: The address of the broker queue. When the autolink is created, it will be attached to this address. +`externalAddress`:: An optional alternate address for the broker queue. You use an external address if the broker queue should have a different address than that which the receiver uses. In this scenario, receivers receive messages from the `addr` address, and the router retrieves them from the broker queue represented by the `externalAddress` address. `connection` | `containerID`:: How the router should connect to the broker. You can specify either an outgoing connection (`connection`) or the container ID of the broker (`containerID`). `direction`:: Set this attribute to `in` to specify that this autolink can receive messages from the broker to the router. @@ -539,25 +539,25 @@ address { // <2> } autoLink { // <3> - addr: queue.first + address: queue.first direction: in connection: broker } autoLink { // <4> - addr: queue.first + address: queue.first direction: out connection: broker } autoLink { // <5> - addr: queue.second + address: queue.second direction: in connection: broker } autoLink { // <6> - addr: queue.second + address: queue.second direction: out connection: broker } diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json index 195350e..0df3a06 100644 --- a/python/qpid_dispatch/management/qdrouter.json +++ b/python/qpid_dispatch/management/qdrouter.json @@ -1239,9 +1239,10 @@ "extends": "configurationEntity", "operations": ["CREATE", "DELETE"], "attributes": { - "addr": { + "address": { "type": "string", "description": "The address of the provisioned object", + "deprecationName": "addr", "create": true, "required": true }, @@ -1270,9 +1271,10 @@ "create": true, "required": false }, - "externalAddr": { + "externalAddress": { "type": "string", "description": "If present, an alternate address of the node on the remote container. This is used if the node has a different address than the address used internally by the router to route deliveries.", + "deprecationName": "externalAddr", "create": true, "required": false }, diff --git a/src/router_config.c b/src/router_config.c index 87df3ed..adb46ba 100644 --- a/src/router_config.c +++ b/src/router_config.c @@ -256,13 +256,13 @@ qd_error_t qd_router_configure_auto_link(qd_router_t *router, qd_entity_t *entit char *ext_addr = 0; do { - name = qd_entity_opt_string(entity, "name", 0); QD_ERROR_BREAK(); - addr = qd_entity_get_string(entity, "addr"); QD_ERROR_BREAK(); - dir = qd_entity_get_string(entity, "direction"); QD_ERROR_BREAK(); - container = qd_entity_opt_string(entity, "containerId", 0); QD_ERROR_BREAK(); - c_name = qd_entity_opt_string(entity, "connection", 0); QD_ERROR_BREAK(); - ext_addr = qd_entity_opt_string(entity, "externalAddr", 0); QD_ERROR_BREAK(); - long phase = qd_entity_opt_long(entity, "phase", -1); QD_ERROR_BREAK(); + name = qd_entity_opt_string(entity, "name", 0); QD_ERROR_BREAK(); + addr = qd_entity_get_string(entity, "address"); QD_ERROR_BREAK(); + dir = qd_entity_get_string(entity, "direction"); QD_ERROR_BREAK(); + container = qd_entity_opt_string(entity, "containerId", 0); QD_ERROR_BREAK(); + c_name = qd_entity_opt_string(entity, "connection", 0); QD_ERROR_BREAK(); + ext_addr = qd_entity_opt_string(entity, "externalAddress", 0); QD_ERROR_BREAK(); + long phase = qd_entity_opt_long(entity, "phase", -1); QD_ERROR_BREAK(); // // Formulate this configuration as a route and create it through the core management API. @@ -276,7 +276,7 @@ qd_error_t qd_router_configure_auto_link(qd_router_t *router, qd_entity_t *entit } if (addr) { - qd_compose_insert_string(body, "addr"); + qd_compose_insert_string(body, "address"); qd_compose_insert_string(body, addr); } @@ -301,7 +301,7 @@ qd_error_t qd_router_configure_auto_link(qd_router_t *router, qd_entity_t *entit } if (ext_addr) { - qd_compose_insert_string(body, "externalAddr"); + qd_compose_insert_string(body, "externalAddress"); qd_compose_insert_string(body, ext_addr); } diff --git a/src/router_core/agent_config_auto_link.c b/src/router_core/agent_config_auto_link.c index b0f7fec..b381adf 100644 --- a/src/router_core/agent_config_auto_link.c +++ b/src/router_core/agent_config_auto_link.c @@ -26,27 +26,31 @@ #define QDR_CONFIG_AUTO_LINK_NAME 0 #define QDR_CONFIG_AUTO_LINK_IDENTITY 1 #define QDR_CONFIG_AUTO_LINK_TYPE 2 -#define QDR_CONFIG_AUTO_LINK_ADDR 3 -#define QDR_CONFIG_AUTO_LINK_DIRECTION 4 -#define QDR_CONFIG_AUTO_LINK_DIR 5 -#define QDR_CONFIG_AUTO_LINK_PHASE 6 -#define QDR_CONFIG_AUTO_LINK_CONNECTION 7 -#define QDR_CONFIG_AUTO_LINK_CONTAINER_ID 8 -#define QDR_CONFIG_AUTO_LINK_EXT_ADDR 9 -#define QDR_CONFIG_AUTO_LINK_LINK_REF 10 -#define QDR_CONFIG_AUTO_LINK_OPER_STATUS 11 -#define QDR_CONFIG_AUTO_LINK_LAST_ERROR 12 +#define QDR_CONFIG_AUTO_LINK_ADDRESS 3 +#define QDR_CONFIG_AUTO_LINK_ADDR 4 +#define QDR_CONFIG_AUTO_LINK_DIRECTION 5 +#define QDR_CONFIG_AUTO_LINK_DIR 6 +#define QDR_CONFIG_AUTO_LINK_PHASE 7 +#define QDR_CONFIG_AUTO_LINK_CONNECTION 8 +#define QDR_CONFIG_AUTO_LINK_CONTAINER_ID 9 +#define QDR_CONFIG_AUTO_LINK_EXT_ADDRESS 10 +#define QDR_CONFIG_AUTO_LINK_EXT_ADDR 11 +#define QDR_CONFIG_AUTO_LINK_LINK_REF 12 +#define QDR_CONFIG_AUTO_LINK_OPER_STATUS 13 +#define QDR_CONFIG_AUTO_LINK_LAST_ERROR 14 const char *qdr_config_auto_link_columns[] = {"name", "identity", "type", + "address", "addr", "direction", "dir", "phase", "connection", "containerId", + "externalAddress", "externalAddr", "linkRef", "operStatus", @@ -82,6 +86,7 @@ static void qdr_config_auto_link_insert_column_CT(qdr_auto_link_t *al, int col, break; case QDR_CONFIG_AUTO_LINK_ADDR: + case QDR_CONFIG_AUTO_LINK_ADDRESS: key = (const char*) qd_hash_key_by_handle(al->addr->hash_handle); if (key && key[0] == 'M') qd_compose_insert_string(body, &key[2]); @@ -119,6 +124,7 @@ static void qdr_config_auto_link_insert_column_CT(qdr_auto_link_t *al, int col, break; case QDR_CONFIG_AUTO_LINK_EXT_ADDR: + case QDR_CONFIG_AUTO_LINK_EXT_ADDRESS: if (al->external_addr) qd_compose_insert_string(body, al->external_addr); else @@ -370,7 +376,12 @@ void qdra_config_auto_link_create_CT(qdr_core_t *core, // // Extract the fields from the request // - qd_parsed_field_t *addr_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_ADDR]); + qd_parsed_field_t *addr_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_ADDRESS]); + if (!addr_field) { + addr_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_ADDR]); + if (addr_field) + qd_log(core->agent_log, QD_LOG_WARNING, "The 'addr' attribute of autoLink has been deprecated. Use 'address' instead"); + } qd_parsed_field_t *dir_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_DIRECTION]); if (! dir_field) { dir_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_DIR]); @@ -380,7 +391,15 @@ void qdra_config_auto_link_create_CT(qdr_core_t *core, qd_parsed_field_t *phase_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_PHASE]); qd_parsed_field_t *connection_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_CONNECTION]); qd_parsed_field_t *container_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_CONTAINER_ID]); - qd_parsed_field_t *external_addr = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_EXT_ADDR]); + + + qd_parsed_field_t *external_addr = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_EXT_ADDRESS]); + if (!external_addr) { + external_addr = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_EXT_ADDR]); + if (external_addr) + qd_log(core->agent_log, QD_LOG_WARNING, "The 'externalAddr' attribute of autoLink has been deprecated. Use 'externalAddress' instead"); + } + if (connection_field && container_field) { query->status = QD_AMQP_BAD_REQUEST; diff --git a/src/router_core/agent_config_auto_link.h b/src/router_core/agent_config_auto_link.h index f01b471..6ff9438 100644 --- a/src/router_core/agent_config_auto_link.h +++ b/src/router_core/agent_config_auto_link.h @@ -32,7 +32,7 @@ void qdra_config_auto_link_get_CT(qdr_core_t *core, qd_iterator_t *identity, qdr_query_t *query, const char *qdr_config_auto_link_columns[]); -#define QDR_CONFIG_AUTO_LINK_COLUMN_COUNT 13 +#define QDR_CONFIG_AUTO_LINK_COLUMN_COUNT 15 const char *qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_COLUMN_COUNT + 1]; diff --git a/tests/system_tests_autolinks.py b/tests/system_tests_autolinks.py index 0dd9c10..c687a75 100644 --- a/tests/system_tests_autolinks.py +++ b/tests/system_tests_autolinks.py @@ -108,9 +108,9 @@ class DetachAfterAttachTest(TestCase): ('listener', {'role': 'route-container', 'name': 'myListener', 'port': cls.tester.get_port()}), - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), ]) @@ -167,9 +167,9 @@ class AutoLinkRetryTest(TestCase): 'port': cls.inter_router_port}), ('autoLink', {'connection': 'connectorToB', - 'addr': 'examples', 'direction': 'in'}), + 'address': 'examples', 'direction': 'in'}), ('autoLink', {'connection': 'connectorToB', - 'addr': 'examples', 'direction': 'out'}), + 'address': 'examples', 'direction': 'out'}), ]) def __init__(self, test_method): @@ -270,8 +270,8 @@ class WaypointReceiverPhaseTest(TestCase): ('router', {'mode': 'interior', 'id': 'A'}), ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port()}), ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': cls.inter_router_port}), - ('autoLink', {'addr': '0.0.0.0/queue.ext', 'direction': 'in', 'externalAddr': 'EXT'}), - ('autoLink', {'addr': '0.0.0.0/queue.ext', 'direction': 'out', 'externalAddr': 'EXT'}), + ('autoLink', {'address': '0.0.0.0/queue.ext', 'direction': 'in', 'externalAddress': 'EXT'}), + ('autoLink', {'address': '0.0.0.0/queue.ext', 'direction': 'out', 'externalAddress': 'EXT'}), ('address', {'prefix': '0.0.0.0/queue', 'waypoint': 'yes'}), ]) @@ -392,27 +392,27 @@ class AutolinkTest(TestCase): # # Create a pair of default auto-links for 'node.1' # - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), # # Create a pair of auto-links on non-default phases for container-to-container transfers # - ('autoLink', {'addr': 'xfer.2', 'containerId': 'container.2', 'direction': 'in', 'phase': '4'}), - ('autoLink', {'addr': 'xfer.2', 'containerId': 'container.3', 'direction': 'out', 'phase': '4'}), + ('autoLink', {'address': 'xfer.2', 'containerId': 'container.2', 'direction': 'in', 'phase': '4'}), + ('autoLink', {'address': 'xfer.2', 'containerId': 'container.3', 'direction': 'out', 'phase': '4'}), # # Create a pair of auto-links with a different external address # Leave the direction as dir to test backward compatibility. # - ('autoLink', {'addr': 'node.2', 'externalAddr': 'ext.2', 'containerId': 'container.4', 'dir': 'in'}), - ('autoLink', {'addr': 'node.2', 'externalAddr': 'ext.2', 'containerId': 'container.4', 'dir': 'out'}), + ('autoLink', {'address': 'node.2', 'externalAddress': 'ext.2', 'containerId': 'container.4', 'dir': 'in'}), + ('autoLink', {'address': 'node.2', 'externalAddress': 'ext.2', 'containerId': 'container.4', 'dir': 'out'}), # # Note here that the connection is set to a previously declared 'myListener' # - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), ]) @@ -1078,7 +1078,7 @@ class ManageAutolinksTest(MessagingHandler): 'name': 'AL.%d' % self.n_created } body = {'direction': 'out', 'containerId': 'container.new', - 'addr': 'node.%d' % self.n_created } + 'address': 'node.%d' % self.n_created } msg = Message(properties=props, body=body, reply_to=self.reply_to) self.agent.send(msg) self.n_created += 1 diff --git a/tests/system_tests_deprecated.py b/tests/system_tests_deprecated.py index 6d5e9ed..b973566 100644 --- a/tests/system_tests_deprecated.py +++ b/tests/system_tests_deprecated.py @@ -69,15 +69,19 @@ class RouterTestDeprecatedLAutoLink(TestCase): name = "test-autolink" + config = Qdrouterd.Config([ ('router', {'mode': 'standalone', 'id': 'QDR.B'}), # We are trying to declare a link route with both 'dir' and 'direction' attributes. # The router must not start in this case. + ('autoLink', {'externalAddr': 'node.100', 'addr': 'node.10', + 'containerId': 'container.1', + 'direction': 'out'}), ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'dir': 'in', 'direction': 'in'}), ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), + ('listener', {'port': cls.tester.get_port()}), ]) - cls.router = cls.tester.qdrouterd(name, config, wait=False, perform_teardown=False) # Try connecting for 4 seconds. If unable to connect, just move on. @@ -93,6 +97,11 @@ class RouterTestDeprecatedLAutoLink(TestCase): "org.apache.qpid.dispatch.router.config.autoLink: Both 'dir' and 'direction' cannot be specified for entity 'autoLink'" in s] self.assertTrue(len(search_lines) > 0) + external_addr_search_lines = [s for s in log_lines if + "Attribute 'externalAddr' of entity 'autoLink' has been deprecated. Use 'externalAddress' instead" in s] + self.assertTrue(len(external_addr_search_lines) > 0) + + diff --git a/tests/system_tests_distribution.py b/tests/system_tests_distribution.py index 0b48d26..0442095 100644 --- a/tests/system_tests_distribution.py +++ b/tests/system_tests_distribution.py @@ -187,13 +187,13 @@ class DistributionTests ( TestCase ): } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_1 + '.waypoint', + { 'address': cls.waypoint_prefix_1 + '.waypoint', 'containerId': cls.container_ids[1], 'direction': 'in' } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_1 + '.waypoint', + { 'address': cls.waypoint_prefix_1 + '.waypoint', 'containerId': cls.container_ids[1], 'direction': 'out' } @@ -231,14 +231,14 @@ class DistributionTests ( TestCase ): # Waypoint 1 configuration -------------------------- ( 'autoLink', - { 'addr': cls.waypoint_prefix_2 + '.waypoint', + { 'address': cls.waypoint_prefix_2 + '.waypoint', 'phase' : 0, 'containerId': cls.container_ids[2], 'direction': 'out' # out-of-router } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_2 + '.waypoint', + { 'address': cls.waypoint_prefix_2 + '.waypoint', 'phase' : 1, 'containerId': cls.container_ids[2], 'direction': 'in' # into-router @@ -247,14 +247,14 @@ class DistributionTests ( TestCase ): # Waypoint 2 configuration -------------------------- ( 'autoLink', - { 'addr': cls.waypoint_prefix_2 + '.waypoint', + { 'address': cls.waypoint_prefix_2 + '.waypoint', 'phase' : 1, # out-of-router 'containerId': cls.container_ids[2], 'direction': 'out' } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_2 + '.waypoint', + { 'address': cls.waypoint_prefix_2 + '.waypoint', 'phase' : 2, # into-router 'containerId': cls.container_ids[2], 'direction': 'in' @@ -282,13 +282,13 @@ class DistributionTests ( TestCase ): # Waypoint 1 configuration ---------------------- ( 'autoLink', - { 'addr': cls.waypoint_prefix_3 + '.waypoint', + { 'address': cls.waypoint_prefix_3 + '.waypoint', 'containerId': cls.container_ids[3], 'direction': 'in' } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_3 + '.waypoint', + { 'address': cls.waypoint_prefix_3 + '.waypoint', 'containerId': cls.container_ids[3], 'direction': 'out' } @@ -296,13 +296,13 @@ class DistributionTests ( TestCase ): # Waypoint 2 configuration ---------------------- ( 'autoLink', - { 'addr': cls.waypoint_prefix_3 + '.waypoint', + { 'address': cls.waypoint_prefix_3 + '.waypoint', 'containerId': cls.container_ids[3], 'direction': 'in' } ), ( 'autoLink', - { 'addr': cls.waypoint_prefix_3 + '.waypoint', + { 'address': cls.waypoint_prefix_3 + '.waypoint', 'containerId': cls.container_ids[3], 'direction': 'out' } diff --git a/tests/system_tests_edge_router.py b/tests/system_tests_edge_router.py index 113c790..4c38316 100644 --- a/tests/system_tests_edge_router.py +++ b/tests/system_tests_edge_router.py @@ -68,8 +68,8 @@ class EdgeRouterTest(TestCase): ('listener', {'port': cls.tester.get_port(), 'stripAnnotations': 'no', 'role': 'route-container'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'in', 'containerId': 'LRC'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'out', 'containerId': 'LRC'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), ('address', {'prefix': 'closest', 'distribution': 'closest'}), ('address', {'prefix': 'spread', 'distribution': 'balanced'}), ('address', {'prefix': 'multicast', 'distribution': 'multicast'}), @@ -255,8 +255,8 @@ class RouterTest(TestCase): ('listener', {'port': cls.tester.get_port(), 'stripAnnotations': 'no', 'role': 'route-container'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'in', 'containerId': 'LRC'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'out', 'containerId': 'LRC'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), ('address', {'prefix': 'closest', 'distribution': 'closest'}), ('address', {'prefix': 'spread', 'distribution': 'balanced'}), ('address', {'prefix': 'multicast', 'distribution': 'multicast'}), diff --git a/tests/system_tests_global_delivery_counts.py b/tests/system_tests_global_delivery_counts.py index 8ab93ac..ff6475a 100644 --- a/tests/system_tests_global_delivery_counts.py +++ b/tests/system_tests_global_delivery_counts.py @@ -404,8 +404,8 @@ class RouteContainerEgressCount(TestCase): # # Note here that the connection is set to a previously declared 'myListener' # - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), ]) cls.router = cls.tester.qdrouterd(name="A", config=config, wait=True) @@ -445,8 +445,8 @@ class RouteContainerIngressCount(TestCase): # # Note here that the connection is set to a previously declared 'myListener' # - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), - ('autoLink', {'addr': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'in'}), + ('autoLink', {'address': 'myListener.1', 'connection': 'myListener', 'direction': 'out'}), ]) cls.router = cls.tester.qdrouterd(name="A", config=config, wait=True) diff --git a/tests/system_tests_link_routes.py b/tests/system_tests_link_routes.py index 2e5e6b0..1c59d9a 100644 --- a/tests/system_tests_link_routes.py +++ b/tests/system_tests_link_routes.py @@ -249,7 +249,7 @@ class LinkRouteTest(TestCase): self.assertTrue(exception_occurred) - cmd = 'CREATE --type=autoLink addr=127.0.0.1 direction=in connection=routerC' + cmd = 'CREATE --type=autoLink address=127.0.0.1 direction=in connection=routerC' out = self.run_qdmanage(cmd=cmd, address=self.routers[1].addresses[0]) identity = out[out.find("identity") + 12: out.find("identity") + 14] diff --git a/tests/system_tests_multi_tenancy.py b/tests/system_tests_multi_tenancy.py index b3da142..52e5d81 100644 --- a/tests/system_tests_multi_tenancy.py +++ b/tests/system_tests_multi_tenancy.py @@ -49,10 +49,10 @@ class RouterTest(TestCase): ('listener', {'port': cls.tester.get_port(), 'stripAnnotations': 'no', 'role': 'route-container'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'in', 'containerId': 'LRC'}), ('linkRoute', {'prefix': '0.0.0.0/link', 'direction': 'out', 'containerId': 'LRC'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), - ('autoLink', {'addr': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), - ('autoLink', {'addr': '0.0.0.0/queue.ext', 'containerId': 'ALCE', 'direction': 'in', 'externalAddr': 'EXT'}), - ('autoLink', {'addr': '0.0.0.0/queue.ext', 'containerId': 'ALCE', 'direction': 'out', 'externalAddr': 'EXT'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'in'}), + ('autoLink', {'address': '0.0.0.0/queue.waypoint', 'containerId': 'ALC', 'direction': 'out'}), + ('autoLink', {'address': '0.0.0.0/queue.ext', 'containerId': 'ALCE', 'direction': 'in', 'externalAddress': 'EXT'}), + ('autoLink', {'address': '0.0.0.0/queue.ext', 'containerId': 'ALCE', 'direction': 'out', 'externalAddress': 'EXT'}), ('address', {'prefix': 'closest', 'distribution': 'closest'}), ('address', {'prefix': 'spread', 'distribution': 'balanced'}), ('address', {'prefix': 'multicast', 'distribution': 'multicast'}), diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py index 1a260e8..422c8f4 100644 --- a/tests/system_tests_policy.py +++ b/tests/system_tests_policy.py @@ -1428,8 +1428,8 @@ class ConnectorPolicySrcTgt(TestCase): # Set up the prefix 'node' as a prefix for waypoint addresses ('address', {'prefix': 'node', 'waypoint': 'yes'}), # Create a pair of default auto-links for 'node.1' - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), ('vhost', { 'hostname': 'test', 'groups': [( @@ -1525,8 +1525,8 @@ class ConnectorPolicyNSndrRcvr(TestCase): # Set up the prefix 'node' as a prefix for waypoint addresses ('address', {'prefix': 'node', 'waypoint': 'yes'}), # Create a pair of default auto-links for 'node.1' - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), - ('autoLink', {'addr': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'in'}), + ('autoLink', {'address': 'node.1', 'containerId': 'container.1', 'direction': 'out'}), ('vhost', { 'hostname': 'test', 'groups': [( diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py index 2c0c450..57932af 100644 --- a/tests/system_tests_qdmanage.py +++ b/tests/system_tests_qdmanage.py @@ -61,7 +61,7 @@ class QdmanageTest(TestCase): ('connector', {'role': 'inter-router', 'port': cls.inter_router_port}), ('address', {'name': 'test-address', 'prefix': 'abcd', 'distribution': 'multicast'}), ('linkRoute', {'name': 'test-link-route', 'prefix': 'xyz', 'direction': 'in'}), - ('autoLink', {'name': 'test-auto-link', 'addr': 'mnop', 'direction': 'out'}), + ('autoLink', {'name': 'test-auto-link', 'address': 'mnop', 'direction': 'out'}), ('listener', {'port': cls.tester.get_port(), 'sslProfile': 'server-ssl'}), ('address', {'name': 'pattern-address', 'pattern': 'a/*/b/#/c', 'distribution': 'closest'}) ]) diff --git a/tools/qdstat.in b/tools/qdstat.in index 2f1a604..e0ec094 100755 --- a/tools/qdstat.in +++ b/tools/qdstat.in @@ -553,16 +553,16 @@ class BusManager(Node): heads.append(Header("status")) heads.append(Header("lastErr")) rows = [] - cols = ('addr', 'direction', 'phase', 'externalAddr', 'linkRef', 'operStatus', 'lastError') + cols = ('address', 'direction', 'phase', 'externalAddress', 'linkRef', 'operStatus', 'lastError') objects = self.query('org.apache.qpid.dispatch.router.config.autoLink', cols, limit=self.opts.limit) for al in objects: row = [] - row.append(al.addr) + row.append(al.address) row.append(al.direction) row.append(al.phase) - row.append(al.externalAddr) + row.append(al.externalAddress) row.append(al.linkRef) row.append(al.operStatus) row.append(al.lastError) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org