diff --git a/.github/scripts/Dockerfile b/.github/scripts/Dockerfile index bd436777c..5e0b75e8d 100644 --- a/.github/scripts/Dockerfile +++ b/.github/scripts/Dockerfile @@ -51,13 +51,13 @@ WORKDIR / COPY --from=builder /qpid-proton-image.tar.gz /skupper-router-image.tar.gz / RUN tar zxpf qpid-proton-image.tar.gz && tar zxpf skupper-router-image.tar.gz && rm -f /qpid-proton-image.tar.gz /skupper-router-image.tar.gz -WORKDIR /home/qdrouterd/etc -WORKDIR /home/qdrouterd/bin -COPY ./scripts/* /home/qdrouterd/bin/ +WORKDIR /home/skrouterd/etc +WORKDIR /home/skrouterd/bin +COPY ./scripts/* /home/skrouterd/bin/ ARG version=latest ENV VERSION=${version} -ENV QDROUTERD_HOME=/home/qdrouterd +ENV QDROUTERD_HOME=/home/skrouterd EXPOSE 5672 55672 5671 -CMD ["/home/qdrouterd/bin/launch.sh"] +CMD ["/home/skrouterd/bin/launch.sh"] diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7235fc678..411aac8ec 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -526,7 +526,7 @@ jobs: - name: Create Build and Install directories run: mkdir -p "${DispatchBuildDir}" "{InstallPrefix}" - - name: qpid-dispatch cmake configure + - name: skupper-router cmake configure working-directory: ${{env.DispatchBuildDir}} run: > cmake "${{github.workspace}}" \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 034a26fa3..d0aee429b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ ## cmake_minimum_required(VERSION 3.20) -project(qpid-dispatch C CXX) +project(skupper-router C CXX) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -115,14 +115,14 @@ if (NOT DEFINED LIB_SUFFIX) endif() set(INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory") -set(QPID_DISPATCH_HOME "lib/qpid-dispatch" CACHE PATH "Private Dispatch library directory") +set(QPID_DISPATCH_HOME "lib/skupper-router" CACHE PATH "Private Skupper library directory") set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library object file directory") set(SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc CACHE PATH "Documentation directory") -set(QD_DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/qpid-dispatch CACHE PATH "Qpid Dispatch documentation directory") +set(QD_DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/skupper-router CACHE PATH "Skupper Router documentation directory") set(MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory") set(QPID_DISPATCH_HOME_INSTALLED ${CMAKE_INSTALL_PREFIX}/${QPID_DISPATCH_HOME}) -set(QPID_DISPATCH_HTML_DIR ${CMAKE_INSTALL_PREFIX}/share/qpid-dispatch/html CACHE PATH "Qpid Dispatch HTML directory") +set(QPID_DISPATCH_HTML_DIR ${CMAKE_INSTALL_PREFIX}/share/skupper-router/html CACHE PATH "Skupper Router HTML directory") set(RUN ${Python_EXECUTABLE} ${CMAKE_BINARY_DIR}/run.py) @@ -135,7 +135,7 @@ if(NOT DEFINED SYSCONF_INSTALL_DIR) endif() endif() -set(QPID_DISPATCH_CONFDIR ${SYSCONF_INSTALL_DIR}/qpid-dispatch) +set(QPID_DISPATCH_CONFDIR ${SYSCONF_INSTALL_DIR}/skupper-router) # Set up runtime checks (valgrind, sanitizers etc.) include(cmake/RuntimeChecks.cmake) @@ -197,20 +197,17 @@ if (CMAKE_BUILD_TYPE MATCHES "Coverage") endif(CMAKE_BUILD_TYPE MATCHES "Coverage") ## -## Header file installation +## configuration/html file installation ## -file(GLOB headers "include/qpid/dispatch/*.h") -install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/qpid/dispatch) -install(FILES include/qpid/dispatch.h DESTINATION ${INCLUDE_INSTALL_DIR}/qpid) -install(FILES etc/qdrouterd.conf DESTINATION ${SYSCONF_INSTALL_DIR}/qpid-dispatch) -install(FILES etc/sasl2/qdrouterd.conf DESTINATION ${SYSCONF_INSTALL_DIR}/sasl2) +install(FILES etc/skrouterd.conf DESTINATION ${SYSCONF_INSTALL_DIR}/skupper-router) +install(FILES etc/sasl2/skrouterd.conf DESTINATION ${SYSCONF_INSTALL_DIR}/sasl2) install(FILES share/index.html DESTINATION ${QPID_DISPATCH_HTML_DIR}) # Tools install(PROGRAMS - ${CMAKE_CURRENT_SOURCE_DIR}/tools/qdstat - ${CMAKE_CURRENT_SOURCE_DIR}/tools/qdmanage + ${CMAKE_CURRENT_SOURCE_DIR}/tools/skstat + ${CMAKE_CURRENT_SOURCE_DIR}/tools/skmanage DESTINATION bin) # Doc files @@ -223,7 +220,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.py.in ${CMAKE_CURRENT_BINARY_DIR} configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.py.in ${CMAKE_CURRENT_BINARY_DIR}/tests/run.py) execute_process(COMMAND ${RUN} --sh OUTPUT_FILE config.sh) -add_subdirectory(src) # Build src first so other subdirs can use qpid-dispatch library +add_subdirectory(src) # Build src first so other subdirs can use library if (NOT UNITTEST_MISSING) file(GLOB SCRAPER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/tools/scraper/*.py) diff --git a/bin/export.sh b/bin/export.sh index 539af9027..2b6f93d24 100755 --- a/bin/export.sh +++ b/bin/export.sh @@ -23,13 +23,13 @@ # run this script like this - # Before executing this script, change directory to the folder in which this file is located, for example. -# 1. cd /home/jdoe/qpid-dispatch/bin +# 1. cd /home/jdoe/skupper-router/bin # Run the script like so - # 2. ./export.sh # (Example : ./export.sh /home/jdoe/ 1.5.1 # (/home/jdoe is the folder you want the tar.gz file to be put - specify the full path) # 1.5.1 is the tag name -# A file named qpid-dispatch-.tar.gz will be created at +# A file named skupper-router-.tar.gz will be created at # Simply running ./export.sh will put the tar.gz file in the current folder and use the very latest createed tag @@ -90,8 +90,8 @@ echo Working Directory=${WORKDIR} cd ${SRC} MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S') VERSION=$(git show tags/${TAG}:VERSION.txt) - ARCHIVE=$DIR/qpid-dispatch-${VERSION}.tar.gz - PREFIX=qpid-dispatch-${VERSION} + ARCHIVE=$DIR/skupper-router-${VERSION}.tar.gz + PREFIX=skupper-router-${VERSION} [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR} git archive --format=tar --prefix=${PREFIX}/ tags/${TAG} \ | tar -x -C ${WORKDIR} diff --git a/bin/grinder b/bin/grinder index e6db5fadf..5165eaa4a 100755 --- a/bin/grinder +++ b/bin/grinder @@ -292,7 +292,7 @@ def parse_error(error_xml): " to handle it" % kind) -def parse_xml_file(filename, exe_name='qdrouterd'): +def parse_xml_file(filename, exe_name='skrouterd'): """ Parse out errors from a valgrind output xml file """ diff --git a/bin/test.sh b/bin/test.sh index f0fd69b3a..769add772 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -40,4 +40,4 @@ make -j4 ctest -VV ${DISPATCH_CTEST_EXTRA_ARGS} # Run system tests on the install. make install -python $INSTALL_DIR/lib/qpid-dispatch/tests/run_system_tests.py +python $INSTALL_DIR/lib/skupper-router/tests/run_system_tests.py diff --git a/dockerfiles/Dockerfile-centos7 b/dockerfiles/Dockerfile-centos7 index 3ddc8006e..f89a94ff1 100644 --- a/dockerfiles/Dockerfile-centos7 +++ b/dockerfiles/Dockerfile-centos7 @@ -63,6 +63,6 @@ RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make install # Uncomment the following line if you would like to run all the dispatch unit tests and system tests. # RUN ctest -VV -# Start the dispatch router -#ENTRYPOINT ["qdrouterd"] +# Start the skupper router +#ENTRYPOINT ["skrouterd"] CMD ["/bin/bash"] diff --git a/dockerfiles/Dockerfile-fedora b/dockerfiles/Dockerfile-fedora index 6af7335ee..8688333a5 100644 --- a/dockerfiles/Dockerfile-fedora +++ b/dockerfiles/Dockerfile-fedora @@ -52,6 +52,6 @@ RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make install # Uncomment the following line if you would like to run all the dispatch unit tests and system tests. # RUN ctest -VV -# Start the dispatch router -ENTRYPOINT ["qdrouterd"] +# Start the skupper router +ENTRYPOINT ["skrouterd"] #CMD ["/bin/bash"] diff --git a/dockerfiles/Dockerfile-ubuntu b/dockerfiles/Dockerfile-ubuntu index 26eef7894..f66725167 100644 --- a/dockerfiles/Dockerfile-ubuntu +++ b/dockerfiles/Dockerfile-ubuntu @@ -49,6 +49,6 @@ ENV PYTHONPATH=/usr/lib/python2.7/site-packages WORKDIR /qpid-dispatch -# Start the dispatch router -ENTRYPOINT ["qdrouterd"] +# Start the skupper router +ENTRYPOINT ["skrouterd"] #CMD ["/bin/bash"] diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt index 876c51153..d1415e369 100644 --- a/docs/man/CMakeLists.txt +++ b/docs/man/CMakeLists.txt @@ -21,8 +21,8 @@ set (src ${CMAKE_CURRENT_SOURCE_DIR}) set (bin ${CMAKE_CURRENT_BINARY_DIR}) set (tools ${CMAKE_SOURCE_DIR}/tools) -set (schema ../../python/qpid_dispatch/management/qdrouter.json) -set (py_management ../../python/qpid_dispatch_internal/management) +set (schema ../../python/skupper_router/management/skrouter.json) +set (py_management ../../python/skupper_router_internal/management) set (schema_deps ${schema} ${py_management}/schema_doc.py ${py_management}/schema.py) # Flags for doc tools, based on cmake options @@ -47,7 +47,7 @@ macro (schema_gen script output) list (APPEND generated_txt "${output}") endmacro () -schema_gen (${src}/qdrouterd.conf.5.py ${bin}/qdrouterd.conf.5.adoc) +schema_gen (${src}/skrouterd.conf.5.py ${bin}/skrouterd.conf.5.adoc) # Generate asciidoc .adoc from --help output for man pages macro (help2txt program) @@ -61,9 +61,9 @@ macro (help2txt program) list (APPEND generated_txt "${output}") endmacro () -help2txt (${CMAKE_BINARY_DIR}/router/qdrouterd) -help2txt (${tools}/qdmanage) -help2txt (${tools}/qdstat) +help2txt (${CMAKE_BINARY_DIR}/router/skrouterd) +help2txt (${tools}/skmanage) +help2txt (${tools}/skstat) add_custom_target (doc_gen DEPENDS ${generated_txt}) @@ -74,7 +74,7 @@ if (ASCIIDOC_EXE) # Generate HTML file (GLOB_RECURSE adoc_files *.adoc) - foreach (source ${src}/qdmanage.8 ${src}/qdrouterd.8 ${src}/qdstat.8 ${bin}/qdrouterd.conf.5) + foreach (source ${src}/skmanage.8 ${src}/skrouterd.8 ${src}/skstat.8 ${bin}/skrouterd.conf.5) get_filename_component (name ${source} NAME) string(FIND ${name} "." dot) if (dot GREATER 0) @@ -98,7 +98,7 @@ if (ASCIIDOC_EXE) find_program(A2X_EXE a2x DOC DOC "Generate Unix man pages") if (A2X_EXE) # Generate man pages. - foreach (source ${src}/qdmanage.8 ${src}/qdrouterd.8 ${src}/qdstat.8 ${bin}/qdrouterd.conf.5) + foreach (source ${src}/skmanage.8 ${src}/skrouterd.8 ${src}/skstat.8 ${bin}/skrouterd.conf.5) get_filename_component (name ${source} NAME) string(REGEX REPLACE ".*\\.([0-9])$" "\\1" section ${source}) # Man section number set (output ${bin}/${name}) diff --git a/docs/man/qdmanage.8.adoc b/docs/man/skmanage.8.adoc similarity index 81% rename from docs/man/qdmanage.8.adoc rename to docs/man/skmanage.8.adoc index 11503a418..2884628f0 100644 --- a/docs/man/qdmanage.8.adoc +++ b/docs/man/skmanage.8.adoc @@ -17,30 +17,30 @@ specific language governing permissions and limitations under the License //// -qdmanage(8) +skmanage(8) ========== :doctype: manpage NAME ---- -qdmanage - management client to control or query qdrouterd(8) +skmanage - management client to control or query skupper-router SYNOPSIS -------- -*qdmanage* ['OPTIONS'] 'OPERATION' ['ARGUMENTS'] +*skmanage* ['OPTIONS'] 'OPERATION' ['ARGUMENTS'] DESCRIPTION ----------- -An AMQP management client for use with the Dispatch router daemon -('qdrouterd'). Sends AMQP management operations requests and prints +An AMQP management client for use with the skupper-router daemon +('skrouterd'). Sends AMQP management operations requests and prints the response in JSON format. This is a generic AMQP management tool and can be used with any AMQP endpoint that follows the AMQP Management -specification, not just with 'qdrouterd'. +specification, not just with 'skrouterd'. OPTIONS ------- -include::{generated_man}/qdmanage_help.adoc[] +include::{generated_man}/skmanage_help.adoc[] OPERATIONS ---------- @@ -99,9 +99,9 @@ OPERATIONS FILES ----- -{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/qdrouter.json:: - Management schema for 'qdrouterd'. -{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/qdrouter.json.readme.txt:: +{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/skrouter.json:: + Management schema for 'skrouterd'. +{CMAKE_INSTALL_PREFIX}/{QD_DOC_INSTALL_DIR}/skrouter.json.readme.txt:: Explanation of the management schema. EXAMPLES @@ -109,31 +109,31 @@ EXAMPLES .Show the logging configuration: -------------------------------------------------------------- -qdmanage query --type=log +skmanage query --type=log -------------------------------------------------------------- .Enable debug and higher log messages by default: -------------------------------------------------------------- -qdmanage update name=log/DEFAULT enable=debug+ +skmanage update name=log/DEFAULT enable=debug+ -------------------------------------------------------------- .Enable trace log messages only for the MESSAGE module, and direct MESSAGE logs to the file _test.log_: -------------------------------------------------------------- -qdmanage update name=log/MESSAGE enable=trace output=test.log +skmanage update name=log/MESSAGE enable=trace output=test.log -------------------------------------------------------------- .Set MESSAGE logging back to the default: ------------------------------------------------ -qdmanage update name=log/MESSAGE enable=default +skmanage update name=log/MESSAGE enable=default ------------------------------------------------ .Disable MESSAGE logging: --------------------------------------------- -qdmanage update name=log/MESSAGE enable=none +skmanage update name=log/MESSAGE enable=none --------------------------------------------- SEE ALSO ---------- -'qdrouterd(8)', 'qdstat(8)', 'qdrouterd.conf(5)' +'skrouterd(8)', 'skstat(8)', 'skrouterd.conf(5)' -http://qpid.apache.org/components/dispatch-router +https://github.com/skupperproject/skupper-router diff --git a/docs/man/qdrouterd.8.adoc b/docs/man/skrouterd.8.adoc similarity index 75% rename from docs/man/qdrouterd.8.adoc rename to docs/man/skrouterd.8.adoc index ae2c2a231..1dfc1850f 100644 --- a/docs/man/qdrouterd.8.adoc +++ b/docs/man/skrouterd.8.adoc @@ -17,38 +17,38 @@ specific language governing permissions and limitations under the License //// -qdrouterd(8) +skrouterd(8) =========== :doctype: manpage NAME ---- -qdrouterd - routes AMQP messages. +skrouterd - routes AMQP messages. SYNOPSIS -------- -*qdrouterd* ['OPTIONS'] +*skrouterd* ['OPTIONS'] DESCRIPTION ----------- -The Qpid Dispatch router ('qdrouterd') is a network daemon that directs +The skupper router ('skrouterd') is a network daemon that directs AMQP 1.0 messages between endpoints, such as messaging clients and servers. OPTIONS ------- -include::{generated_man}/qdrouterd_help.adoc[] +include::{generated_man}/skrouterd_help.adoc[] FILES ----- -{SYSCONF_INSTALL_DIR}/qdrouterd.conf:: +{SYSCONF_INSTALL_DIR}/skrouterd.conf:: Configuration file. SEE ALSO -------- -'qdrouterd.conf(5)', 'qdstat(8)', 'qdmanage(8)' +'skrouterd.conf(5)', 'skstat(8)', 'skmanage(8)' -http://qpid.apache.org/components/dispatch-router +https://github.com/skupperproject/skupper-router diff --git a/docs/man/qdrouterd.conf.5.py b/docs/man/skrouterd.conf.5.py similarity index 86% rename from docs/man/qdrouterd.conf.5.py rename to docs/man/skrouterd.conf.5.py index 6af8bed7e..7fde90b1f 100644 --- a/docs/man/qdrouterd.conf.5.py +++ b/docs/man/skrouterd.conf.5.py @@ -18,7 +18,7 @@ # """ -Generate the qdrouterd.conf. man page from the qdrouterd management schema. +Generate the skrouterd.conf. man page from the skrouterd management schema. """ from __future__ import unicode_literals @@ -27,11 +27,11 @@ from __future__ import print_function import sys -from qpid_dispatch_internal.management.qdrouter import QdSchema -from qpid_dispatch_internal.management.schema_doc import SchemaWriter +from skupper_router_internal.management.qdrouter import QdSchema +from skupper_router_internal.management.schema_doc import SchemaWriter -CONNECTOR = 'org.apache.qpid.dispatch.connector' -LISTENER = 'org.apache.qpid.dispatch.listener' +CONNECTOR = 'io.skupper.router.connector' +LISTENER = 'io.skupper.router.listener' # avoid writing these config entity types to the man file, they are not allowed # in the configuration file and are only supported at run time via management @@ -54,18 +54,18 @@ def attribute_type(self, attr, holder): def man_page(self): self.writeln(r""" -qdrouterd.conf(5) +skrouterd.conf(5) ================= :doctype: manpage NAME ---- -qdrouterd.conf - configuration file for the dispatch router. +skrouterd.conf - configuration file for the Skupper Router. SYNOPSIS -------- -Provides the initial configuration when 'qdrouterd(8)' starts. The configuration -of a running router can be modified using 'qdmanage(8)'. +Provides the initial configuration when 'skrouterd(8)' starts. The configuration +of a running router can be modified using 'skmanage(8)'. DESCRIPTION @@ -151,9 +151,9 @@ def man_page(self): SEE ALSO -------- -*qdrouterd(8)*, *qdmanage(8)* +*skrouterd(8)*, *skmanage(8)* -http://qpid.apache.org/components/dispatch-router +https://github.com/skupperproject/skupper-router """) diff --git a/docs/man/qdstat.8.adoc b/docs/man/skstat.8.adoc similarity index 97% rename from docs/man/qdstat.8.adoc rename to docs/man/skstat.8.adoc index fb57f70de..5f00239f2 100644 --- a/docs/man/qdstat.8.adoc +++ b/docs/man/skstat.8.adoc @@ -17,35 +17,37 @@ specific language governing permissions and limitations under the License //// -qdstat(8) +skstat(8) ========= :doctype: manpage NAME ---- -qdstat - show status and statistics for a running 'qdrouterd' +skstat - show status and statistics for a running skupper-router SYNOPSIS -------- -*qdstat* ['OPTIONS'] +*skstat* ['OPTIONS'] DESCRIPTION ----------- -An AMQP monitoring tool that shows status information about networks of Dispatch routers. It can display connections, network nodes and links, policy, and router stats such as memory use. +An AMQP monitoring tool that shows status information about networks +of skupper routers ('skrouterd'). It can display connections, network +nodes and links, policy, and router stats such as memory use. OPTIONS ------- -include::{generated_man}/qdstat_help.adoc[] +include::{generated_man}/skstat_help.adoc[] OUTPUT COLUMNS -------------- -qdstat -g +skstat -g ~~~~~~~~~ Version:: -The version of Dispatch Router. +The version of Skupper Router. Mode:: The router's operating mode: @@ -127,7 +129,7 @@ The number of deliveries this router has received from AMQP route containers. Deliveries to Route Container:: The number of deliveries this router has sent to AMQP route containers. -qdstat -c +skstat -c ~~~~~~~~~ id:: The connection's unique identifier. @@ -166,7 +168,7 @@ uptime:: Time this connection has been up. Displayed in the days:hours:minutes:seconds format. -qdstat -l +skstat -l ~~~~~~~~~ type:: The type of link: @@ -269,7 +271,7 @@ The operational status of the link (with -v option only): name:: The link name (only shown if the -v option is provided). -qdstat -n +skstat -n ~~~~~~~~~ router-id:: @@ -290,7 +292,7 @@ The list of neighbor routers (the router's link-state). This field is available valid-origins:: The list of origin routers for which the best path to the listed router passes through this router (available only with the -v option). -qdstat -e +skstat -e ~~~~~~~~~ id:: @@ -316,7 +318,7 @@ The authentication method and user ID of the connection's authenticated user. tenant:: If the connection is to a listener using multi-tenancy, this column displays the tenant namespace for the connection. -qdstat -a +skstat -a ~~~~~~~~~ class:: @@ -367,7 +369,7 @@ The number of deliveries for this address that were delivered to an in-process c from-proc:: The number of deliveries for this address that were received from an in-process producer. -qdstat --linkroutes +skstat --linkroutes ~~~~~~~~~~~~~~~~~~~ prefix:: @@ -384,7 +386,7 @@ The operational status of the link route: - 'active' - The route is actively routing attaches (it is ready for use). - 'inactive' - The route is inactive, because no local destination is connected. -qdstat --autolinks +skstat --autolinks ~~~~~~~~~~~~~~~~~~ addr:: The auto link's address. @@ -412,7 +414,7 @@ The operational status of this auto link: lastErr:: The description of the last attach failure that occurred on this auto link. -qdstat --policy +skstat --policy ~~~~~~~~~~~~~~~ Maximum Concurrent Connections:: @@ -457,7 +459,7 @@ Count of all maxMessageSize policy denials summed across all vhosts. Total Denials:: Count of all policy denials for any reason summed across all vhosts. -qdstat --vhosts +skstat --vhosts ~~~~~~~~~~~~~~~ hostname:: @@ -487,7 +489,7 @@ connect to the vhost. Unknown users are assigned to the '$default' user group an groups:: Count of usergroups defined for this vhost. -qdstat --vhoststats +skstat --vhoststats ~~~~~~~~~~~~~~~~~~~ Vhost Stats table @@ -527,7 +529,7 @@ Authenticated user name remote hosts:: List of remote hosts from which this user has connected to this vhost. -qdstat --vhostgroups +skstat --vhostgroups ~~~~~~~~~~~~~~~~~~~~ Table of settings for all vhosts and groups. @@ -693,6 +695,6 @@ the same time. SEE ALSO -------- -'qdrouterd(8)', 'qdmanage(8)', 'qdrouterd.conf(5)' +'skrouterd(8)', 'skmanage(8)', 'skrouterd.conf(5)' -http://qpid.apache.org/components/dispatch-router +https://github.com/skupperproject/skupper-router diff --git a/etc/fedora/qdrouterd b/etc/fedora/skrouterd similarity index 86% rename from etc/fedora/qdrouterd rename to etc/fedora/skrouterd index d7d568a98..b25ed00da 100644 --- a/etc/fedora/qdrouterd +++ b/etc/fedora/skrouterd @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License # -# /etc/rc.d/init.d/qdrouterd +# /etc/rc.d/init.d/skrouterd # # Startup script for the Qpid Router. # @@ -31,22 +31,22 @@ . /etc/rc.d/init.d/functions ### BEGIN INIT INFO -# Provides: qdrouterd +# Provides: skrouterd # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: start or stop qdrouterd -# Description: Qpid Router is an intermediary for AMQP messaging. +# Short-Description: start or stop skrouterd +# Description: skupper-router is an intermediary for skupper messaging. ### END INIT INFO -prog=qdrouterd +prog=skrouterd exe=/usr/sbin/$prog # Configurable variables, can be set in /etc/sysconfig/$prog -USER=qdrouterd -CONFIG=/etc/qpid-dispatch/qdrouterd.conf -RUNDIR=/var/run/qpid-dispatch +USER=skrouterd +CONFIG=/etc/skupper-router/skrouterd.conf +RUNDIR=/var/run/skupper-router if [ -f /etc/sysconfig/$prog ]; then . /etc/sysconfig/$prog @@ -61,14 +61,14 @@ if [[ !(-x $exe) ]]; then fi start() { - echo -n "Starting qdrouterd services: " + echo -n "Starting skrouterd services: " daemon --check $prog --user $USER --pidfile $pidfile $exe --daemon --config $CONFIG --pidfile $pidfile echo RETVAL=$? } stop() { - echo -n "Shutting down qdrouterd services: " + echo -n "Shutting down skrouterd services: " killproc -p $pidfile $prog echo } diff --git a/etc/fedora/qdrouterd.service b/etc/fedora/skrouterd.service similarity index 90% rename from etc/fedora/qdrouterd.service rename to etc/fedora/skrouterd.service index 18920434d..531a5f0c2 100644 --- a/etc/fedora/qdrouterd.service +++ b/etc/fedora/skrouterd.service @@ -22,10 +22,10 @@ Requires=network.target After=network.target [Service] -User=qdrouterd -Group=qdrouterd +User=skrouterd +Group=skrouterd Type=simple -ExecStart=/usr/sbin/qdrouterd -c /etc/qpid-dispatch/qdrouterd.conf +ExecStart=/usr/sbin/skrouterd -c /etc/skupper-router/skrouterd.conf [Install] WantedBy=multi-user.target diff --git a/etc/sasl2/qdrouterd.conf b/etc/sasl2/skrouterd.conf similarity index 81% rename from etc/sasl2/qdrouterd.conf rename to etc/sasl2/skrouterd.conf index 6c8a79d6a..c8d866643 100644 --- a/etc/sasl2/qdrouterd.conf +++ b/etc/sasl2/skrouterd.conf @@ -36,7 +36,7 @@ # pwcheck_method: auxprop auxprop_plugin: sasldb -sasldb_path: /var/lib/qdrouterd/qdrouterd.sasldb +sasldb_path: /var/lib/skrouterd/skrouterd.sasldb mech_list: ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN @@ -46,24 +46,24 @@ mech_list: ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN #--------------------------------- # # 1. If you use a nonstandard location for your sasl_config directory, -# you can point qdrouterd to it by using the router->saslConfigDir +# you can point skrouterd to it by using the router->saslConfigDir # configuration attribute. # # If your nonstandard sasl directory is $MY_SASL_DIR, put a copy -# of this file at $MY_SASL_DIR/qdrouterd.conf, alter the mech list as +# of this file at $MY_SASL_DIR/skrouterd.conf, alter the mech list as # appropriate for your installation, and then use the saslpasswd2 # command to add new user+passwd pairs: -# echo $PASSWD | saslpasswd2 -c -p -f $MY_SASL_DIR/qdrouterd.sasldb -u QPID $USERNAME +# echo $PASSWD | saslpasswd2 -c -p -f $MY_SASL_DIR/skrouterd.sasldb -u QPID $USERNAME # # -# 2. The standard location for the qdrouterd sasldb file is -# /var/lib/qdrouterd/qdrouterd.sasldb +# 2. The standard location for the skrouterd sasldb file is +# /var/lib/skrouterd/skrouterd.sasldb # # 3. You can see what usernames have been stored in the sasldb, with the -# command "sasldblistusers2 -f /var/lib/qdrouterd/qdrouterd.sasldb" +# command "sasldblistusers2 -f /var/lib/skrouterd/skrouterd.sasldb" # -# 4. The sasldb file must be readable by the user running the qdrouterd -# daemon, ( the user name is qdrouterd ) and should be readable only +# 4. The sasldb file must be readable by the user running the skrouterd +# daemon, ( the user name is skrouterd ) and should be readable only # by that user. # # 5. The EXTERNAL mechanism allows you to use SSL transport layer diff --git a/etc/qdrouterd.conf b/etc/skrouterd.conf similarity index 95% rename from etc/qdrouterd.conf rename to etc/skrouterd.conf index d0a1fdeb8..6eaa08278 100644 --- a/etc/qdrouterd.conf +++ b/etc/skrouterd.conf @@ -17,7 +17,7 @@ ## under the License ## -# See the qdrouterd.conf (5) manual page for information about this +# See the skrouterd.conf (5) manual page for information about this # file's format and options. router { diff --git a/include/qpid/dispatch/python_embedded.h b/include/qpid/dispatch/python_embedded.h index 86e6dc622..76f453c38 100644 --- a/include/qpid/dispatch/python_embedded.h +++ b/include/qpid/dispatch/python_embedded.h @@ -59,7 +59,7 @@ void qd_python_start(void); void qd_python_stop(void); /** - * Get the Python top level "qpid_dispatch_internal.dispatch" module. + * Get the Python top level "skupper_router_internal.dispatch" module. */ PyObject *qd_python_module(void); diff --git a/include/qpid/dispatch/server.h b/include/qpid/dispatch/server.h index 31d9c2b9d..8605cb959 100644 --- a/include/qpid/dispatch/server.h +++ b/include/qpid/dispatch/server.h @@ -469,7 +469,7 @@ void *qd_connection_get_link_context(qd_connection_t *conn); /** * Sets the user id on the connection. * If the sasl mech is EXTERNAL, set the user_id on the connection as the concatenated - * list of fields specified in the uidFormat field of qdrouter.json + * list of fields specified in the uidFormat field of skrouter.json * If no uidFormat is specified, the user is set to the pn_transport_user * * @param conn Connection object diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index f43ea87d0..4c6e3f0f8 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -18,19 +18,19 @@ # # Private python modules, not in standard python site dir. -install(DIRECTORY qpid_dispatch_internal DESTINATION ${QPID_DISPATCH_HOME}/python) +install(DIRECTORY skupper_router_internal DESTINATION ${QPID_DISPATCH_HOME}/python) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qpid_dispatch_site.py.in - ${CMAKE_CURRENT_BINARY_DIR}/qpid_dispatch_site.py) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/skupper_router_site.py.in + ${CMAKE_CURRENT_BINARY_DIR}/skupper_router_site.py) # Install script for public python modules install(CODE "execute_process(COMMAND ${Python_EXECUTABLE} setup.py -v install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") install(FILES - ${CMAKE_CURRENT_SOURCE_DIR}/qpid_dispatch/management/qdrouter.json - ${CMAKE_CURRENT_SOURCE_DIR}/qpid_dispatch/management/qdrouter.json.readme.txt + ${CMAKE_CURRENT_SOURCE_DIR}/skupper_router/management/skrouter.json + ${CMAKE_CURRENT_SOURCE_DIR}/skupper_router/management/skrouter.json.readme.txt DESTINATION ${QD_DOC_INSTALL_DIR} ) diff --git a/python/setup.py.in b/python/setup.py.in index 200cb84b8..c2c20a64a 100755 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -30,7 +30,7 @@ from os import environ class BuildPy(build_py): """Extend standard build command, add generated modules from binary directory.""" - MODULES = ['qpid_dispatch_site.py'] + MODULES = ['skupper_router_site.py'] def run(self): build_py.run(self) # Run the standard build, copies source .py files into builddir @@ -49,16 +49,16 @@ if destdir: setup( options=options, - name='qpid_dispatch', - description='Apache Qpid Dispatch tools and libraries.', + name='skupper_router', + description='Skupper Router tools and libraries.', package_dir={'' : '${CMAKE_SOURCE_DIR}/python'}, - packages=['qpid_dispatch', 'qpid_dispatch.management'], - package_data={'qpid_dispatch.management': ['*.json']}, + packages=['skupper_router', 'skupper_router.management'], + package_data={'skupper_router.management': ['*.json']}, cmdclass={'build_py': BuildPy}, version='${QPID_DISPATCH_VERSION}', - author='Apache Qpid', - author_email='dev@qpid.apache.org', - url='http://qpid.apache.org/', + author='Skupper Project', + author_email='skupper@googlegroups.com', + url='https://skupper.io/', license='Apache Software License' ) diff --git a/python/qpid_dispatch/__init__.py b/python/skupper_router/__init__.py similarity index 100% rename from python/qpid_dispatch/__init__.py rename to python/skupper_router/__init__.py diff --git a/python/qpid_dispatch/management/__init__.py b/python/skupper_router/management/__init__.py similarity index 100% rename from python/qpid_dispatch/management/__init__.py rename to python/skupper_router/management/__init__.py diff --git a/python/qpid_dispatch/management/client.py b/python/skupper_router/management/client.py similarity index 99% rename from python/qpid_dispatch/management/client.py rename to python/skupper_router/management/client.py index b62ce2b7d..3ab957e29 100644 --- a/python/qpid_dispatch/management/client.py +++ b/python/skupper_router/management/client.py @@ -250,8 +250,8 @@ def query(self, type=None, attribute_names=None, offset=None, count=None): # There is a bug in proton (PROTON-1846) wherein we cannot ask for # too many rows. So, as a safety we are going to ask only for - # MAX_ALLOWED_COUNT_PER_REQUEST. Since this is used by both qdstat - # and qdmanage, we have determined that the optimal value for + # MAX_ALLOWED_COUNT_PER_REQUEST. Since this is used by both skstat + # and skmanage, we have determined that the optimal value for # MAX_ALLOWED_COUNT_PER_REQUEST is 500 MAX_ALLOWED_COUNT_PER_REQUEST = 500 diff --git a/python/qpid_dispatch/management/entity.py b/python/skupper_router/management/entity.py similarity index 100% rename from python/qpid_dispatch/management/entity.py rename to python/skupper_router/management/entity.py diff --git a/python/qpid_dispatch/management/error.py b/python/skupper_router/management/error.py similarity index 100% rename from python/qpid_dispatch/management/error.py rename to python/skupper_router/management/error.py diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/skupper_router/management/skrouter.json similarity index 99% rename from python/qpid_dispatch/management/qdrouter.json rename to python/skupper_router/management/skrouter.json index 85ecb4e22..2eb23a2db 100644 --- a/python/qpid_dispatch/management/qdrouter.json +++ b/python/skupper_router/management/skrouter.json @@ -1,7 +1,7 @@ { - "description": "Schema for the Qpid Dispatch Router management model. See qdrouter.json.readme.txt.", + "description": "Schema for the Skupper Router management model. See skrouter.json.readme.txt.", - "prefix": "org.apache.qpid.dispatch", + "prefix": "io.skupper.router", "entityTypes": { @@ -293,7 +293,7 @@ "operations": ["GET-SCHEMA", "GET-JSON-SCHEMA", "GET-LOG", "PROFILE"], "operationDefs": { "GET-SCHEMA": { - "description": "Get the qdrouterd schema for this router in AMQP map format", + "description": "Get the skrouterd schema for this router in AMQP map format", "request": { "properties": { "identity": { @@ -304,13 +304,13 @@ }, "response": { "body": { - "description": "The qdrouter schema as a map.", + "description": "The skrouter schema as a map.", "type": "map" } } }, "GET-SCHEMA-JSON": { - "description": "Get the qdrouterd schema for this router in JSON format", + "description": "Get the skrouterd schema for this router in JSON format", "request": { "properties": { "identity": { @@ -325,7 +325,7 @@ }, "response": { "body": { - "description": "The qdrouter schema as a JSON string.", + "description": "The skrouter schema as a JSON string.", "type": "string" } } @@ -452,7 +452,7 @@ "saslConfigName": { "type": "string", "description": "Name of the SASL configuration. This string + '.conf' is the name of the configuration file.", - "default": "qdrouterd", + "default": "skrouterd", "required": false, "create": true }, @@ -592,7 +592,7 @@ "memoryUsage": { "type": "integer", "graph": true, - "description": "The current amount of memory in use by the qdrouterd process in bytes. This includes memory provisioned for stack, data, and code (VmSize). This value is set to Null if the platform does not provide access to the process memory size." + "description": "The current amount of memory in use by the router process in bytes. This includes memory provisioned for stack, data, and code (VmSize). This value is set to Null if the platform does not provide access to the process memory size." } } }, @@ -796,7 +796,7 @@ }, "httpRootDir": { "type": "path", - "description": "Absolute path to a directory from which to serve static HTML files (typically /usr/share/qpid-dispatch/html).", + "description": "Absolute path to a directory from which to serve static HTML files (typically /usr/share/skupper-router/html).", "create": true }, "messageLoggingComponents": { @@ -1407,7 +1407,7 @@ }, "linkRef": { "type": "string", - "description": "Reference to the org.apache.qpid.dispatch.router.link if the link exists", + "description": "Reference to the io.skupper.router.router.link if the link exists", "create": false }, "operStatus": { diff --git a/python/qpid_dispatch/management/qdrouter.json.readme.txt b/python/skupper_router/management/skrouter.json.readme.txt similarity index 94% rename from python/qpid_dispatch/management/qdrouter.json.readme.txt rename to python/skupper_router/management/skrouter.json.readme.txt index ea9a1391b..5c08470ab 100644 --- a/python/qpid_dispatch/management/qdrouter.json.readme.txt +++ b/python/skupper_router/management/skrouter.json.readme.txt @@ -17,10 +17,10 @@ specific language governing permissions and limitations under the License. --> -# The qdrouter management schema +# The skrouter management schema -The schema `qdrouterd.json` is a JSON format file that defines -entity types of the Qpid Dispatch Router management model. The model is based +The schema `skrouterd.json` is a JSON format file that defines +entity types of the Skupper Router management model. The model is based on the AMQP management specification. The schema is a JSON map with the following keys: @@ -80,7 +80,7 @@ There is the following hierarchy among entity types: Operational information reflects the actual current state of the router. For example, "how many addresses are presently active?" All the entities queried - by the `qdstat` tool extend `operationalEntity`. + by the `skstat` tool extend `operationalEntity`. The two types are often related. For example `listener` and `connector` extend `configurationEntity`, they express the intent to make or receive diff --git a/python/qpid_dispatch_internal/__init__.py b/python/skupper_router_internal/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/__init__.py rename to python/skupper_router_internal/__init__.py diff --git a/python/qpid_dispatch_internal/compat/__init__.py b/python/skupper_router_internal/compat/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/compat/__init__.py rename to python/skupper_router_internal/compat/__init__.py diff --git a/python/qpid_dispatch_internal/dispatch.py b/python/skupper_router_internal/dispatch.py similarity index 97% rename from python/qpid_dispatch_internal/dispatch.py rename to python/skupper_router_internal/dispatch.py index 33034b91a..a5d0578e4 100644 --- a/python/qpid_dispatch_internal/dispatch.py +++ b/python/skupper_router_internal/dispatch.py @@ -17,10 +17,10 @@ # under the License # -"""Interface between python and libqpid-dispatch.so. +"""Interface between python and libskupper-router.so. This module contains python ctypes definitions to directly call functions in the -libqpid-dispatch.so library from python. +libskupper-router.so library from python. The C library also adds the following C extension types to this module: @@ -50,7 +50,7 @@ class QdDll(ctypes.PyDLL): """ def __init__(self, handle: int) -> None: - super(QdDll, self).__init__("qpid-dispatch", handle=handle) + super(QdDll, self).__init__("skupper-router", handle=handle) # Types self.qd_dispatch_p = ctypes.c_void_p diff --git a/python/qpid_dispatch_internal/dispatch.pyi b/python/skupper_router_internal/dispatch.pyi similarity index 100% rename from python/qpid_dispatch_internal/dispatch.pyi rename to python/skupper_router_internal/dispatch.pyi diff --git a/python/qpid_dispatch_internal/display_name/__init__.py b/python/skupper_router_internal/display_name/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/display_name/__init__.py rename to python/skupper_router_internal/display_name/__init__.py diff --git a/python/qpid_dispatch_internal/display_name/display_name.py b/python/skupper_router_internal/display_name/display_name.py similarity index 98% rename from python/qpid_dispatch_internal/display_name/display_name.py rename to python/skupper_router_internal/display_name/display_name.py index d3bdf5987..b5da453e0 100644 --- a/python/qpid_dispatch_internal/display_name/display_name.py +++ b/python/skupper_router_internal/display_name/display_name.py @@ -28,7 +28,7 @@ import traceback from typing import Dict -from qpid_dispatch_internal import dispatch +from skupper_router_internal import dispatch class SSLProfile: diff --git a/python/qpid_dispatch_internal/management/__init__.py b/python/skupper_router_internal/management/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/management/__init__.py rename to python/skupper_router_internal/management/__init__.py diff --git a/python/qpid_dispatch_internal/management/agent.py b/python/skupper_router_internal/management/agent.py similarity index 98% rename from python/qpid_dispatch_internal/management/agent.py rename to python/skupper_router_internal/management/agent.py index 64064fb43..0c0b325a2 100644 --- a/python/qpid_dispatch_internal/management/agent.py +++ b/python/skupper_router_internal/management/agent.py @@ -21,7 +21,7 @@ Adapter layer between external attribute-value maps sent/received via the AMQP management protocol and implementation objects (C or python) of the dispatch -router. Entity types are as described in qdrouter.json schema. Reading +router. Entity types are as described in skrouter.json schema. Reading configuration files is treated as a set of CREATE operations. Maintains a set of L{EntityAdapter} that hold attribute maps reflecting the last @@ -74,11 +74,11 @@ from ctypes import c_void_p, py_object, c_long -import qpid_dispatch_site +import skupper_router_site from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_DEBUG, LOG_ERROR, TREATMENT_ANYCAST_CLOSEST -from qpid_dispatch.management.error import ManagementError, OK, CREATED, NO_CONTENT, STATUS_TEXT, \ +from skupper_router.management.error import ManagementError, OK, CREATED, NO_CONTENT, STATUS_TEXT, \ BadRequestStatus, InternalServerErrorStatus, NotImplementedStatus, NotFoundStatus -from qpid_dispatch.management.entity import camelcase +from skupper_router.management.entity import camelcase from .schema import ValidationError, SchemaEntity, EntityType from .qdrouter import QdSchema from ..router.message import Message @@ -371,7 +371,7 @@ class ConnectionBaseEntity(EntityAdapter): Provides validation of the openProperties attribute shared by Listener and Connector entities. """ - # qdrouterd reserves a set of connection-property keys as well as any key + # the router reserves a set of connection-property keys as well as any key # that starts with certain prefixes _RESERVED_KEYS = ['product', 'version', @@ -421,7 +421,7 @@ def __str__(self): return super(ListenerEntity, self).__str__().replace("Entity(", "ListenerEntity(") def _delete(self): - if self.http and qpid_dispatch_site.SKIP_DELETE_HTTP_LISTENER: + if self.http and skupper_router_site.SKIP_DELETE_HTTP_LISTENER: raise BadRequestStatus("HTTP listeners cannot be deleted") self._qd.qd_connection_manager_delete_listener(self._dispatch, self._implementations[0].key) diff --git a/python/qpid_dispatch_internal/management/config.py b/python/skupper_router_internal/management/config.py similarity index 97% rename from python/qpid_dispatch_internal/management/config.py rename to python/skupper_router_internal/management/config.py index 6adee5cfd..031902e82 100644 --- a/python/qpid_dispatch_internal/management/config.py +++ b/python/skupper_router_internal/management/config.py @@ -26,7 +26,7 @@ import traceback from typing import Any, Dict, Iterable, List, Optional, Union, TYPE_CHECKING, TextIO -from qpid_dispatch.management.entity import camelcase +from skupper_router.management.entity import camelcase from ..dispatch import QdDll from .qdrouter import QdSchema @@ -43,7 +43,7 @@ class Config: - """Load config entities from qdrouterd.conf and validated against L{QdSchema}.""" + """Load config entities from skrouterd.conf and validated against L{QdSchema}.""" def __init__( self, @@ -317,7 +317,7 @@ def configure(attributes): qd.qd_router_setup_late(dispatch) # Actions requiring active management agent. agent.activate("$_management_internal") - from qpid_dispatch_internal.display_name.display_name import DisplayNameService + from skupper_router_internal.display_name.display_name import DisplayNameService displayname_service = DisplayNameService() qd.qd_dispatch_register_display_name_service(dispatch, displayname_service) @@ -347,7 +347,7 @@ def configure(attributes): # Configure remaining types except for connector and listener for e in config.entities: - if not e['type'] in ['org.apache.qpid.dispatch.connector', 'org.apache.qpid.dispatch.listener']: + if not e['type'] in ['io.skupper.router.connector', 'io.skupper.router.listener']: configure(e) # Load the vhosts from the .json files in policyDir diff --git a/python/qpid_dispatch_internal/management/qdrouter.py b/python/skupper_router_internal/management/qdrouter.py similarity index 95% rename from python/qpid_dispatch_internal/management/qdrouter.py rename to python/skupper_router_internal/management/qdrouter.py index e089e3940..96e0ba234 100644 --- a/python/qpid_dispatch_internal/management/qdrouter.py +++ b/python/skupper_router_internal/management/qdrouter.py @@ -38,13 +38,13 @@ class QdSchema(schema.Schema): def __init__(self) -> None: """Load schema.""" - qd_schema = get_data('qpid_dispatch.management', 'qdrouter.json') + qd_schema = get_data('skupper_router.management', 'skrouter.json') if not qd_schema: - raise ValueError("Failed to load data file qdrouter.json") + raise ValueError("Failed to load data file skrouter.json") try: super(QdSchema, self).__init__(**json.loads(qd_schema, object_pairs_hook=OrderedDict)) except Exception as e: - raise ValueError("Invalid schema qdrouter.json: %s" % e) + raise ValueError("Invalid schema skrouter.json: %s" % e) self.configuration_entity = self.entity_type(self.CONFIGURATION_ENTITY) self.operational_entity = self.entity_type(self.OPERATIONAL_ENTITY) diff --git a/python/qpid_dispatch_internal/management/schema.py b/python/skupper_router_internal/management/schema.py similarity index 99% rename from python/qpid_dispatch_internal/management/schema.py rename to python/skupper_router_internal/management/schema.py index 7b00aed36..b97220b7f 100644 --- a/python/qpid_dispatch_internal/management/schema.py +++ b/python/skupper_router_internal/management/schema.py @@ -29,8 +29,8 @@ import sys import traceback from collections import OrderedDict -from qpid_dispatch.management.entity import EntityBase -from qpid_dispatch.management.error import NotImplementedStatus +from skupper_router.management.entity import EntityBase +from skupper_router.management.error import NotImplementedStatus try: from ..dispatch import LogAdapter, LOG_WARNING diff --git a/python/qpid_dispatch_internal/management/schema_doc.py b/python/skupper_router_internal/management/schema_doc.py similarity index 100% rename from python/qpid_dispatch_internal/management/schema_doc.py rename to python/skupper_router_internal/management/schema_doc.py diff --git a/python/qpid_dispatch_internal/policy/__init__.py b/python/skupper_router_internal/policy/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/policy/__init__.py rename to python/skupper_router_internal/policy/__init__.py diff --git a/python/qpid_dispatch_internal/policy/policy_local.py b/python/skupper_router_internal/policy/policy_local.py similarity index 100% rename from python/qpid_dispatch_internal/policy/policy_local.py rename to python/skupper_router_internal/policy/policy_local.py diff --git a/python/qpid_dispatch_internal/policy/policy_manager.py b/python/skupper_router_internal/policy/policy_manager.py similarity index 100% rename from python/qpid_dispatch_internal/policy/policy_manager.py rename to python/skupper_router_internal/policy/policy_manager.py diff --git a/python/qpid_dispatch_internal/policy/policy_util.py b/python/skupper_router_internal/policy/policy_util.py similarity index 100% rename from python/qpid_dispatch_internal/policy/policy_util.py rename to python/skupper_router_internal/policy/policy_util.py diff --git a/python/qpid_dispatch_internal/router/__init__.py b/python/skupper_router_internal/router/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/router/__init__.py rename to python/skupper_router_internal/router/__init__.py diff --git a/python/qpid_dispatch_internal/router/address.py b/python/skupper_router_internal/router/address.py similarity index 100% rename from python/qpid_dispatch_internal/router/address.py rename to python/skupper_router_internal/router/address.py diff --git a/python/qpid_dispatch_internal/router/data.py b/python/skupper_router_internal/router/data.py similarity index 100% rename from python/qpid_dispatch_internal/router/data.py rename to python/skupper_router_internal/router/data.py diff --git a/python/qpid_dispatch_internal/router/engine.py b/python/skupper_router_internal/router/engine.py similarity index 100% rename from python/qpid_dispatch_internal/router/engine.py rename to python/skupper_router_internal/router/engine.py diff --git a/python/qpid_dispatch_internal/router/hello.py b/python/skupper_router_internal/router/hello.py similarity index 100% rename from python/qpid_dispatch_internal/router/hello.py rename to python/skupper_router_internal/router/hello.py diff --git a/python/qpid_dispatch_internal/router/link.py b/python/skupper_router_internal/router/link.py similarity index 100% rename from python/qpid_dispatch_internal/router/link.py rename to python/skupper_router_internal/router/link.py diff --git a/python/qpid_dispatch_internal/router/message.py b/python/skupper_router_internal/router/message.py similarity index 100% rename from python/qpid_dispatch_internal/router/message.py rename to python/skupper_router_internal/router/message.py diff --git a/python/qpid_dispatch_internal/router/node.py b/python/skupper_router_internal/router/node.py similarity index 100% rename from python/qpid_dispatch_internal/router/node.py rename to python/skupper_router_internal/router/node.py diff --git a/python/qpid_dispatch_internal/router/path.py b/python/skupper_router_internal/router/path.py similarity index 100% rename from python/qpid_dispatch_internal/router/path.py rename to python/skupper_router_internal/router/path.py diff --git a/python/qpid_dispatch_internal/tools/__init__.py b/python/skupper_router_internal/tools/__init__.py similarity index 100% rename from python/qpid_dispatch_internal/tools/__init__.py rename to python/skupper_router_internal/tools/__init__.py diff --git a/python/qpid_dispatch_internal/tools/command.py b/python/skupper_router_internal/tools/command.py similarity index 95% rename from python/qpid_dispatch_internal/tools/command.py rename to python/skupper_router_internal/tools/command.py index 764846b42..b9ec7eaee 100644 --- a/python/qpid_dispatch_internal/tools/command.py +++ b/python/skupper_router_internal/tools/command.py @@ -24,7 +24,7 @@ import argparse import os -from qpid_dispatch_site import VERSION +from skupper_router_site import VERSION from proton import SSLDomain, Url @@ -70,13 +70,13 @@ def check_args(args, maxargs=0, minargs=0): return args + [None] * (maxargs - len(args)) -def parse_args_qdstat(BusManager, argv=None): - parser = _qdstat_parser(BusManager) +def parse_args_skstat(BusManager, argv=None): + parser = _skstat_parser(BusManager) return parser.parse_args(args=argv) -def parse_args_qdmanage(operations, argv=None): - parser = _qdmanage_parser(operations) +def parse_args_skmanage(operations, argv=None): + parser = _skmanage_parser(operations) return parser.parse_known_args(args=argv) @@ -124,7 +124,7 @@ def add_connection_options(parser): "in production environments") -def _qdstat_add_display_args(parser, BusManager): +def _skstat_add_display_args(parser, BusManager): _group = parser.add_argument_group('Display', 'Choose what kind of \ information you want to be displayed') display = _group.add_mutually_exclusive_group(required=False) @@ -174,9 +174,9 @@ def _qdstat_add_display_args(parser, BusManager): display.set_defaults(show=BusManager.displayGeneral.__name__) -def _qdstat_parser(BusManager): - parser = _custom_optional_arguments_parser(prog="qdstat", parents=[common_parser]) - _qdstat_add_display_args(parser, BusManager) +def _skstat_parser(BusManager): + parser = _custom_optional_arguments_parser(prog="skstat", parents=[common_parser]) + _skstat_add_display_args(parser, BusManager) _group = parser.add_argument_group('Target', 'Choose destination router to \ required, default the one you connect to.') @@ -199,7 +199,7 @@ def _qdstat_parser(BusManager): return parser -def _qdmanage_add_args(parser): +def _skmanage_add_args(parser): parser.add_argument("-r", "--router", metavar="ROUTER-ID", help="Router to be queried") # Edge routers are not part of the router network. Hence we need a separate option @@ -217,12 +217,12 @@ def _qdmanage_add_args(parser): parser.add_argument('--properties', help='JSON map to use as properties for a non-standard operation call.') -def _qdmanage_parser(operations): +def _skmanage_parser(operations): description = "Standard operations: %s. Use GET-OPERATIONS to find additional operations." % (", ".join(operations)) - parser = _custom_optional_arguments_parser(prog="qdmanage ", + parser = _custom_optional_arguments_parser(prog="skmanage ", parents=[common_parser], description=description) - _qdmanage_add_args(parser) + _skmanage_add_args(parser) add_connection_options(parser) return parser diff --git a/python/qpid_dispatch_internal/tools/display.py b/python/skupper_router_internal/tools/display.py similarity index 99% rename from python/qpid_dispatch_internal/tools/display.py rename to python/skupper_router_internal/tools/display.py index 7c880b613..48523a00a 100644 --- a/python/qpid_dispatch_internal/tools/display.py +++ b/python/skupper_router_internal/tools/display.py @@ -18,7 +18,7 @@ # from time import strftime, gmtime -from qpid_dispatch_internal.compat import UNICODE +from skupper_router_internal.compat import UNICODE def YN(val): diff --git a/python/qpid_dispatch_site.py.in b/python/skupper_router_site.py.in similarity index 96% rename from python/qpid_dispatch_site.py.in rename to python/skupper_router_site.py.in index 765a8eb97..19206b73e 100644 --- a/python/qpid_dispatch_site.py.in +++ b/python/skupper_router_site.py.in @@ -29,7 +29,7 @@ from typing import Optional, Tuple def populate_pythonpath() -> None: - """Makes qpid_dispatch_internal available. Modifies sys.path.""" + """Makes skupper_router_internal available. Modifies sys.path.""" home = environ.get("QPID_DISPATCH_HOME") or "${QPID_DISPATCH_HOME_INSTALLED}" sys.path.insert(0, join(home, 'python')) diff --git a/router/CMakeLists.txt b/router/CMakeLists.txt index e0696f182..fb7642a40 100644 --- a/router/CMakeLists.txt +++ b/router/CMakeLists.txt @@ -18,7 +18,7 @@ ## -set(DEFAULT_CONFIG_PATH "${QPID_DISPATCH_CONFDIR}/qdrouterd.conf" CACHE STRING "Default config file path") +set(DEFAULT_CONFIG_PATH "${QPID_DISPATCH_CONFDIR}/skrouterd.conf" CACHE STRING "Default config file path") set(DEFAULT_DISPATCH_PYTHON_DIR ${QPID_DISPATCH_PYTHON_DIR}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) @@ -32,7 +32,7 @@ set(router_SOURCES src/main.c ) -add_executable(qdrouterd ${router_SOURCES}) -target_link_libraries(qdrouterd qpid-dispatch) +add_executable(skrouterd ${router_SOURCES}) +target_link_libraries(skrouterd skupper-router) -install(TARGETS qdrouterd RUNTIME DESTINATION sbin) +install(TARGETS skrouterd RUNTIME DESTINATION sbin) diff --git a/scripts/configure.sh b/scripts/configure.sh index 7426198da..903dd2e24 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -61,5 +61,5 @@ if [ -n "${QDROUTERD_AUTO_MESH_DISCOVERY:-}" ]; then fi if [ -n "${QDROUTERD_AUTO_CREATE_SASLDB_SOURCE:-}" ]; then - $HOME_DIR/bin/create_sasldb.sh ${QDROUTERD_AUTO_CREATE_SASLDB_PATH:-$HOME_DIR/etc/qdrouterd.sasldb} $QDROUTERD_AUTO_CREATE_SASLDB_SOURCE "${APPLICATION_NAME:-qdrouterd}" + $HOME_DIR/bin/create_sasldb.sh ${QDROUTERD_AUTO_CREATE_SASLDB_PATH:-$HOME_DIR/etc/skrouterd.sasldb} $QDROUTERD_AUTO_CREATE_SASLDB_SOURCE "${APPLICATION_NAME:-skrouterd}" fi diff --git a/scripts/expandvars.py b/scripts/expandvars.py index 6c2b8b9d9..926aba9b2 100644 --- a/scripts/expandvars.py +++ b/scripts/expandvars.py @@ -30,7 +30,7 @@ if not is_file: raise Exception() except Exception as e: - print("Usage: python3 expandvars.py . Example - python3 expandvars.py /tmp/qdrouterd.conf") + print("Usage: python3 expandvars.py . Example - python3 expandvars.py /tmp/skrouterd.conf") # Unix programs generally use 2 for command line syntax errors sys.exit(2) diff --git a/scripts/launch.sh b/scripts/launch.sh index 415c35462..013403008 100755 --- a/scripts/launch.sh +++ b/scripts/launch.sh @@ -22,7 +22,7 @@ export HOSTNAME_IP_ADDRESS=$(hostname -i) EXT=${QDROUTERD_CONF_TYPE:-conf} -CONFIG_FILE=/tmp/qdrouterd.${EXT} +CONFIG_FILE=/tmp/skrouterd.${EXT} ${QDROUTERD_HOME}/bin/configure.sh ${QDROUTERD_HOME} $CONFIG_FILE @@ -31,9 +31,9 @@ if [ -f $CONFIG_FILE ]; then fi if [[ $QDROUTERD_DEBUG = "gdb" ]]; then - exec gdb -batch -ex "run" -ex "bt" --args qdrouterd $ARGS + exec gdb -batch -ex "run" -ex "bt" --args skrouterd $ARGS elif [[ $QDROUTERD_DEBUG = "valgrind" ]]; then - exec valgrind qdrouterd $ARGS + exec valgrind skrouterd $ARGS else - exec qdrouterd $ARGS + exec skrouterd $ARGS fi diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5346d1d4d..e0637309c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,10 +25,10 @@ set(GENERATED_SOURCES set(GENERATOR_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/schema_c.py - ${CMAKE_SOURCE_DIR}/python/qpid_dispatch/management/qdrouter.json) -file (GLOB GENERATOR_SRC ${CMAKE_SOURCE_DIR}/python/qpid_dispatch_internal/management/*.py) + ${CMAKE_SOURCE_DIR}/python/skupper_router/management/skrouter.json) +file (GLOB GENERATOR_SRC ${CMAKE_SOURCE_DIR}/python/skupper_router_internal/management/*.py) set(GENERATOR_DEPENDS ${GENERATOR_DEPENDS} ${GENERATOR_SRC}) -file (GLOB GENERATOR_SRC ${CMAKE_SOURCE_DIR}/python/qpid_dispatch/management/*.py) +file (GLOB GENERATOR_SRC ${CMAKE_SOURCE_DIR}/python/skupper_router/management/*.py) set(GENERATOR_DEPENDS ${GENERATOR_DEPENDS} ${GENERATOR_SRC}) add_custom_command ( @@ -36,7 +36,7 @@ add_custom_command ( COMMAND ${Python_EXECUTABLE} ${CMAKE_BINARY_DIR}/tests/run.py -s ${CMAKE_CURRENT_SOURCE_DIR}/schema_c.py DEPENDS ${GENERATOR_DEPENDS}) -# Build the qpid-dispatch library. +# Build the skupper-router library. set(qpid_dispatch_SOURCES adaptors/reference_adaptor.c adaptors/adaptor_utils.c @@ -165,9 +165,9 @@ if ((DEFINED ASAN_LIBRARY) OR (DEFINED UBSAN_LIBRARY) OR (DEFINED TSAN_LIBRARY)) set(USING_SANITIZERS TRUE) endif() -add_library(qpid-dispatch OBJECT ${qpid_dispatch_SOURCES}) -target_include_directories(qpid-dispatch PRIVATE ${qpid_dispatch_INCLUDES}) -target_link_libraries(qpid-dispatch PRIVATE ${qpid_dispatch_LIBRARIES}) +add_library(skupper-router OBJECT ${qpid_dispatch_SOURCES}) +target_include_directories(skupper-router PRIVATE ${qpid_dispatch_INCLUDES}) +target_link_libraries(skupper-router PRIVATE ${qpid_dispatch_LIBRARIES}) # check for various function availability check_symbol_exists(getrlimit sys/resource.h QD_HAVE_GETRLIMIT) diff --git a/src/adaptors/http_common.c b/src/adaptors/http_common.c index 10fbe6043..de89f0cb0 100644 --- a/src/adaptors/http_common.c +++ b/src/adaptors/http_common.c @@ -316,7 +316,7 @@ const char *qdr_http_request_info_columns[] = "details", 0}; -const char *HTTP_REQUEST_INFO_TYPE = "org.apache.qpid.dispatch.httpRequestInfo"; +const char *HTTP_REQUEST_INFO_TYPE = "io.skupper.router.httpRequestInfo"; typedef struct { qdr_http_request_info_list_t records; diff --git a/src/adaptors/tcp_adaptor.c b/src/adaptors/tcp_adaptor.c index 77305c053..b93cf2904 100644 --- a/src/adaptors/tcp_adaptor.c +++ b/src/adaptors/tcp_adaptor.c @@ -1821,7 +1821,7 @@ const char *qdr_tcp_connection_columns[] = "lastOutSeconds", 0}; -const char *TCP_CONNECTION_TYPE = "org.apache.qpid.dispatch.tcpConnection"; +const char *TCP_CONNECTION_TYPE = "io.skupper.router.tcpConnection"; static void insert_column(qdr_core_t *core, qdr_tcp_connection_t *conn, int col, qd_composed_field_t *body) { diff --git a/src/connection_manager.c b/src/connection_manager.c index 16184b2df..345c0cd96 100644 --- a/src/connection_manager.c +++ b/src/connection_manager.c @@ -165,7 +165,7 @@ void qd_server_config_free(qd_server_config_t *cf) /** * Private function to set the values of booleans strip_inbound_annotations and strip_outbound_annotations - * based on the corresponding values for the settings in qdrouter.json + * based on the corresponding values for the settings in skrouter.json * strip_inbound_annotations and strip_outbound_annotations are defaulted to true */ static void load_strip_annotations(qd_server_config_t *config, const char* stripAnnotations) diff --git a/src/dispatch.c b/src/dispatch.c index 5e8bb4a04..5a3d11853 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -124,7 +124,7 @@ qd_error_t qd_dispatch_load_config(qd_dispatch_t *qd, const char *config_path) return qd_error(QD_ERROR_RUNTIME, "Failed to dlopen the current executable"); qd_python_lock_state_t lock_state = qd_python_lock(); - PyObject *module = PyImport_ImportModule("qpid_dispatch_internal.management.config"); + PyObject *module = PyImport_ImportModule("skupper_router_internal.management.config"); PyObject *configure_dispatch = module ? PyObject_GetAttrString(module, "configure_dispatch") : NULL; Py_XDECREF(module); PyObject *result = configure_dispatch ? PyObject_CallFunction(configure_dispatch, "(NNs)", PyLong_FromVoidPtr(qd), @@ -221,7 +221,7 @@ qd_error_t qd_dispatch_configure_router(qd_dispatch_t *qd, qd_entity_t *entity) qd->sasl_config_path = qd_entity_opt_string(entity, "saslConfigDir", 0); QD_ERROR_RET(); } if (! qd->sasl_config_name) { - qd->sasl_config_name = qd_entity_opt_string(entity, "saslConfigName", "qdrouterd"); QD_ERROR_RET(); + qd->sasl_config_name = qd_entity_opt_string(entity, "saslConfigName", "skrouterd"); QD_ERROR_RET(); } char *dump_file = qd_entity_opt_string(entity, "debugDumpFile", 0); QD_ERROR_RET(); @@ -378,7 +378,7 @@ qdr_core_t* qd_dispatch_router_core(qd_dispatch_t *qd) { /* qd_router_memory_usage * - * Return the amount of memory currently provisioned by the qdrouterd process. + * Return the amount of memory currently provisioned by the router process. * This includes data, stack, and code memory. On systems supporting virtual * memory this value may be larger than the physical RAM available on the * platform. diff --git a/src/platform.c b/src/platform.c index 31c8a54ae..49634a57b 100644 --- a/src/platform.c +++ b/src/platform.c @@ -72,7 +72,7 @@ uintmax_t qd_platform_memory_size(void) fclose(minfo_fp); } - // and if qdrouterd is running within a container check the cgroups memory + // and if the router is running within a container check the cgroups memory // controller. Hard and soft memory limits can be set. uintmax_t climit = UINTMAX_MAX; diff --git a/src/policy.c b/src/policy.c index 792c8cae3..04a43f1f0 100644 --- a/src/policy.c +++ b/src/policy.c @@ -81,7 +81,7 @@ static const char * const POLICY_VHOST_GROUP = "$connector"; static void hostname_tree_free(qd_parse_tree_t *hostname_tree); -// Imported qpid_dispatch_internal.policy.policy_manager python module +// Imported skupper_router_internal.policy.policy_manager python module static PyObject * module = 0; ALLOC_DEFINE(qd_policy_settings_t); @@ -151,7 +151,7 @@ void qd_policy_free(qd_policy_t *policy) qd_error_t qd_entity_configure_policy(qd_policy_t *policy, qd_entity_t *entity) { - module = PyImport_ImportModule("qpid_dispatch_internal.policy.policy_manager"); + module = PyImport_ImportModule("skupper_router_internal.policy.policy_manager"); if (!module) { qd_log(policy->log_source, QD_LOG_CRITICAL, "Required internal policy manager python module did not load. Shutting down."); exit(1); @@ -221,7 +221,7 @@ qd_error_t qd_policy_c_counts_refresh(long ccounts, qd_entity_t *entity) } -/** Update the statistics in qdrouterd.conf["policy"] +/** Update the statistics in skrouterd.conf["policy"] * @param[in] entity pointer to the policy management object **/ QD_EXPORT qd_error_t qd_entity_refresh_policy(qd_entity_t* entity, void *unused) { diff --git a/src/policy.h b/src/policy.h index 8b8cfe3ce..f12382e19 100644 --- a/src/policy.h +++ b/src/policy.h @@ -66,7 +66,7 @@ typedef struct qd_policy__settings_s qd_policy_settings_t; ALLOC_DECLARE(qd_policy_settings_t); -/** Configure the C policy entity from the settings in qdrouterd.conf["policy"] +/** Configure the C policy entity from the settings in skrouterd.conf["policy"] * Called python-to-C during config processing. * @param[in] policy pointer to the policy * @param[in] entity pointer to the managed entity diff --git a/src/python_embedded.c b/src/python_embedded.c index fc4a327fc..0dfc50699 100644 --- a/src/python_embedded.c +++ b/src/python_embedded.c @@ -31,7 +31,7 @@ #include -#define DISPATCH_MODULE "qpid_dispatch_internal.dispatch" +#define DISPATCH_MODULE "skupper_router_internal.dispatch" //=============================================================================== // Control Functions @@ -876,7 +876,7 @@ static void qd_python_setup(void) // Get the router.message.Message class. PyObject *message_module = - PyImport_ImportModule("qpid_dispatch_internal.router.message"); + PyImport_ImportModule("skupper_router_internal.router.message"); if (message_module) { message_type = PyObject_GetAttrString(message_module, "Message"); Py_DECREF(message_module); @@ -942,7 +942,7 @@ char *qd_json_msgs_string(PyObject *msgs) { qd_python_lock_state_t lock_state = qd_python_lock(); - PyObject *message_module = PyImport_ImportModule("qpid_dispatch_internal.router.message"); + PyObject *message_module = PyImport_ImportModule("skupper_router_internal.router.message"); if (!message_module) { qd_python_unlock(lock_state); return NULL; diff --git a/src/router_core/agent_address.c b/src/router_core/agent_address.c index 2e65720f3..dfc97cc46 100644 --- a/src/router_core/agent_address.c +++ b/src/router_core/agent_address.c @@ -82,7 +82,7 @@ static void qdr_insert_address_columns_CT(qdr_core_t *core, break; case QDR_ADDRESS_TYPE: - qd_compose_insert_string(body, "org.apache.qpid.dispatch.router.address"); + qd_compose_insert_string(body, "io.skupper.router.router.address"); break; case QDR_ADDRESS_DISTRIBUTION: { diff --git a/src/router_core/agent_config_address.c b/src/router_core/agent_config_address.c index e7ccea1b3..b04bfab2a 100644 --- a/src/router_core/agent_config_address.c +++ b/src/router_core/agent_config_address.c @@ -42,7 +42,7 @@ const char *qdr_config_address_columns[] = "priority", 0}; -const char *CONFIG_ADDRESS_TYPE = "org.apache.qpid.dispatch.router.config.address"; +const char *CONFIG_ADDRESS_TYPE = "io.skupper.router.router.config.address"; const char CONFIG_ADDRESS_PREFIX = 'C'; static void qdr_config_address_insert_column_CT(qdr_address_config_t *addr, int col, qd_composed_field_t *body, bool as_map) diff --git a/src/router_core/agent_config_auto_link.c b/src/router_core/agent_config_auto_link.c index 9226a1497..ff483f37d 100644 --- a/src/router_core/agent_config_auto_link.c +++ b/src/router_core/agent_config_auto_link.c @@ -58,7 +58,7 @@ const char *qdr_config_auto_link_columns[] = "lastError", 0}; -const char *CONFIG_AUTOLINK_TYPE = "org.apache.qpid.dispatch.router.config.autoLink"; +const char *CONFIG_AUTOLINK_TYPE = "io.skupper.router.router.config.autoLink"; const char CONFIG_AUTO_LINK_PREFIX = 'A'; static void qdr_config_auto_link_insert_column_CT(qdr_auto_link_t *al, int col, qd_composed_field_t *body, bool as_map) diff --git a/src/router_core/agent_connection.c b/src/router_core/agent_connection.c index 16fa68d31..0292ba631 100644 --- a/src/router_core/agent_connection.c +++ b/src/router_core/agent_connection.c @@ -94,7 +94,7 @@ const char *qdr_connection_columns[] = "enableProtocolTrace", 0}; -const char *CONNECTION_TYPE = "org.apache.qpid.dispatch.connection"; +const char *CONNECTION_TYPE = "io.skupper.router.connection"; static void qd_get_next_pn_data(pn_data_t **data, const char **d, int *d1) { @@ -567,7 +567,7 @@ void qdra_connection_update_CT(qdr_core_t *core, // // The only two fields that can be updated on a connection is the enableProtocolTrace flag and the admin state. // If both these fields are not there, this is a bad request - // For example, this qdmanage is a bad request - qdmanage update --type=connection identity=1 + // For example, this skmanage is a bad request - skmanage update --type=connection identity=1 // if (!trace_field && !admin_state) { qdra_connection_set_bad_request(query); diff --git a/src/router_core/agent_link.c b/src/router_core/agent_link.c index 70c7023f8..7ec74c22f 100644 --- a/src/router_core/agent_link.c +++ b/src/router_core/agent_link.c @@ -126,7 +126,7 @@ static void qdr_agent_write_column_CT(qdr_core_t *core, qd_composed_field_t *bod } case QDR_LINK_TYPE: - qd_compose_insert_string(body, "org.apache.qpid.dispatch.router.link"); + qd_compose_insert_string(body, "io.skupper.router.router.link"); break; case QDR_LINK_LINK_NAME: diff --git a/src/router_core/agent_router.c b/src/router_core/agent_router.c index dddffbb34..596f106e5 100644 --- a/src/router_core/agent_router.c +++ b/src/router_core/agent_router.c @@ -114,7 +114,7 @@ static void qdr_agent_write_column_CT(qd_composed_field_t *body, int col, qdr_co qd_compose_insert_string(body, "1"); break; case QDR_ROUTER_TYPE: - qd_compose_insert_string(body, "org.apache.qpid.dispatch.router"); + qd_compose_insert_string(body, "io.skupper.router.router"); break; case QDR_ROUTER_MODE: diff --git a/src/router_core/management_agent.c b/src/router_core/management_agent.c index 081cff785..867025e4d 100644 --- a/src/router_core/management_agent.c +++ b/src/router_core/management_agent.c @@ -43,14 +43,14 @@ const char *OPERATION = "operation"; const char *ATTRIBUTE_NAMES = "attributeNames"; -const unsigned char *config_address_entity_type = (unsigned char*) "org.apache.qpid.dispatch.router.config.address"; -const unsigned char *auto_link_entity_type = (unsigned char*) "org.apache.qpid.dispatch.router.config.autoLink"; -const unsigned char *address_entity_type = (unsigned char*) "org.apache.qpid.dispatch.router.address"; -const unsigned char *link_entity_type = (unsigned char*) "org.apache.qpid.dispatch.router.link"; -const unsigned char *router_entity_type = (unsigned char*) "org.apache.qpid.dispatch.router"; -const unsigned char *connection_entity_type = (unsigned char*) "org.apache.qpid.dispatch.connection"; -const unsigned char *tcp_connection_entity_type = (unsigned char*) "org.apache.qpid.dispatch.tcpConnection"; -const unsigned char *http_request_info_entity_type = (unsigned char*) "org.apache.qpid.dispatch.httpRequestInfo"; +const unsigned char *config_address_entity_type = (unsigned char*) "io.skupper.router.router.config.address"; +const unsigned char *auto_link_entity_type = (unsigned char*) "io.skupper.router.router.config.autoLink"; +const unsigned char *address_entity_type = (unsigned char*) "io.skupper.router.router.address"; +const unsigned char *link_entity_type = (unsigned char*) "io.skupper.router.router.link"; +const unsigned char *router_entity_type = (unsigned char*) "io.skupper.router.router"; +const unsigned char *connection_entity_type = (unsigned char*) "io.skupper.router.connection"; +const unsigned char *tcp_connection_entity_type = (unsigned char*) "io.skupper.router.tcpConnection"; +const unsigned char *http_request_info_entity_type = (unsigned char*) "io.skupper.router.httpRequestInfo"; const char * const status_description = "statusDescription"; const char * const correlation_id = "correlation-id"; @@ -403,8 +403,8 @@ static bool qd_can_handle_request(qd_parsed_field_t *properties_fld, // // Only certain entity types can be handled by this agent. - // 'entityType': 'org.apache.qpid.dispatch.router.address - // 'entityType': 'org.apache.qpid.dispatch.router.link' + // 'entityType': 'io.skupper.router.router.address + // 'entityType': 'io.skupper.router.router.link' // TODO - Add more entity types here. The above is not a complete list. qd_parsed_field_t *parsed_field = qd_parse_value_by_key(properties_fld, IDENTITY); diff --git a/src/router_core/modules/test_hooks/core_test_hooks.c b/src/router_core/modules/test_hooks/core_test_hooks.c index e8c27ebc0..58d5020c6 100644 --- a/src/router_core/modules/test_hooks/core_test_hooks.c +++ b/src/router_core/modules/test_hooks/core_test_hooks.c @@ -391,12 +391,12 @@ static qdrc_endpoint_desc_t descriptor = {"Core Test Hooks", on_first_attach, on static test_module_t *qdrc_test_hooks_core_endpoint_setup(qdr_core_t *core, test_module_t *module) { - char *echo_address = "org.apache.qpid.dispatch.router/test/echo"; - char *deny_address = "org.apache.qpid.dispatch.router/test/deny"; - char *sink_address = "org.apache.qpid.dispatch.router/test/sink"; - char *source_address = "org.apache.qpid.dispatch.router/test/source"; - char *source_ps_address = "org.apache.qpid.dispatch.router/test/source_ps"; - char *discard_address = "org.apache.qpid.dispatch.router/test/discard"; + char *echo_address = "io.skupper.router.router/test/echo"; + char *deny_address = "io.skupper.router.router/test/deny"; + char *sink_address = "io.skupper.router.router/test/sink"; + char *source_address = "io.skupper.router.router/test/source"; + char *source_ps_address = "io.skupper.router.router/test/source_ps"; + char *discard_address = "io.skupper.router.router/test/discard"; module->echo_node = NEW(test_node_t); module->deny_node = NEW(test_node_t); @@ -611,7 +611,7 @@ static void _on_conn_event(void *context, qdrc_event_t type, qdr_connection_t *c : NULL); qd_log(tc->module->core->log, QD_LOG_TRACE, "client test container-id=%s", cid); - if (cid && strcmp(cid, "org.apache.qpid.dispatch.test_core_client") == 0) { + if (cid && strcmp(cid, "io.skupper.router.test_core_client") == 0) { qd_log(tc->module->core->log, QD_LOG_TRACE, "client test connection opened"); qdr_terminus_t *target = qdr_terminus(NULL); qdr_terminus_set_address(target, "test_client_address"); diff --git a/src/router_pynode.c b/src/router_pynode.c index a624bc6c5..d0a2fe60e 100644 --- a/src/router_pynode.c +++ b/src/router_pynode.c @@ -409,7 +409,7 @@ qd_error_t qd_router_python_setup(qd_router_t *router) PyObject* pClass; PyObject* pArgs; - pModule = PyImport_ImportModule("qpid_dispatch_internal.router"); QD_ERROR_PY_RET(); + pModule = PyImport_ImportModule("skupper_router_internal.router"); QD_ERROR_PY_RET(); pClass = PyObject_GetAttrString(pModule, "RouterEngine"); Py_DECREF(pModule); QD_ERROR_PY_RET(); diff --git a/src/schema_c.py b/src/schema_c.py index c4bc49886..1823a8bc5 100644 --- a/src/schema_c.py +++ b/src/schema_c.py @@ -21,8 +21,8 @@ Generate C code from the router schema. """ import re -from qpid_dispatch_internal.management.schema import EnumType -from qpid_dispatch_internal.management.qdrouter import QdSchema +from skupper_router_internal.management.schema import EnumType +from skupper_router_internal.management.qdrouter import QdSchema copyright = """/* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index db7520484..561da8f77 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -41,7 +41,7 @@ set(unit_test_SOURCES ) add_executable(unit_tests ${unit_test_SOURCES}) -target_link_libraries(unit_tests qpid-dispatch) +target_link_libraries(unit_tests skupper-router) set(unit_test_size_SOURCES field_test.c @@ -52,10 +52,10 @@ set(unit_test_size_SOURCES ) add_executable(unit_tests_size ${unit_test_size_SOURCES}) -target_link_libraries(unit_tests_size qpid-dispatch) +target_link_libraries(unit_tests_size skupper-router) add_executable(test-sender test-sender.c) -target_link_libraries(test-sender ${Proton_LIBRARIES} qpid-dispatch) +target_link_libraries(test-sender ${Proton_LIBRARIES} skupper-router) add_executable(test-receiver test-receiver.c) target_link_libraries(test-receiver ${Proton_LIBRARIES}) @@ -64,7 +64,7 @@ add_executable(clogger clogger.c) target_link_libraries(clogger ${Proton_LIBRARIES}) add_executable(threaded_timer_test threaded_timer_test.c) -target_link_libraries(threaded_timer_test qpid-dispatch) +target_link_libraries(threaded_timer_test skupper-router) # Bubblewrap is an unprivileged sandboxing tool for Linux. Setting --unshare-net allows # running tests in parallel (the ctest -j option) without port clashes @@ -128,8 +128,8 @@ foreach(py_test_module ${SYSTEM_TESTS_POLICY} system_tests_socket_address_family system_tests_protocol_settings - system_tests_qdmanage - system_tests_qdstat + system_tests_skmanage + system_tests_skstat system_tests_sasl_plain system_tests_user_id system_tests_user_id_proxy diff --git a/tests/c_benchmarks/CMakeLists.txt b/tests/c_benchmarks/CMakeLists.txt index 409292fda..43d1c3e8e 100644 --- a/tests/c_benchmarks/CMakeLists.txt +++ b/tests/c_benchmarks/CMakeLists.txt @@ -40,7 +40,7 @@ add_executable(c-benchmarks SocketException.cpp SocketException.hpp TCPSocket.cpp TCPSocket.hpp TCPServerSocket.cpp TCPServerSocket.hpp) -target_link_libraries(c-benchmarks qpid-dispatch benchmark pthread) +target_link_libraries(c-benchmarks skupper-router benchmark pthread) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/minimal_silent.conf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/c_unittests/CMakeLists.txt b/tests/c_unittests/CMakeLists.txt index 1d772a875..5eb718694 100644 --- a/tests/c_unittests/CMakeLists.txt +++ b/tests/c_unittests/CMakeLists.txt @@ -39,7 +39,7 @@ add_executable(c_unittests test_listener_startup.cpp test_router_startup.cpp test_terminus.cpp) -target_link_libraries(c_unittests cpp-stub pthread qpid-dispatch) +target_link_libraries(c_unittests cpp-stub pthread skupper-router) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/minimal_silent.conf diff --git a/tests/http1_tests.py b/tests/http1_tests.py index 5928bc6d8..8b1142f0b 100644 --- a/tests/http1_tests.py +++ b/tests/http1_tests.py @@ -1316,7 +1316,7 @@ def client_request_close_test(self, server_port, client_port, server_mgmt): expected = len(fake_request) bytes_in = 0 while expected > bytes_in: - ri = server_mgmt.query(type="org.apache.qpid.dispatch.httpRequestInfo").get_entities() + ri = server_mgmt.query(type="io.skupper.router.httpRequestInfo").get_entities() bytes_in = ri[-1]['bytesIn'] if ri else 0 # most recent request at tail sleep(0.1) diff --git a/tests/management_test/entity.py b/tests/management_test/entity.py index da1651529..0a7c9d058 100644 --- a/tests/management_test/entity.py +++ b/tests/management_test/entity.py @@ -18,7 +18,7 @@ # import unittest -from qpid_dispatch.management.entity import EntityBase, camelcase +from skupper_router.management.entity import EntityBase, camelcase class EntityTest(unittest.TestCase): diff --git a/tests/management_test/qdrouter.py b/tests/management_test/qdrouter.py index 0d6a00002..fc65e77e2 100644 --- a/tests/management_test/qdrouter.py +++ b/tests/management_test/qdrouter.py @@ -20,7 +20,7 @@ # pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring,too-many-public-methods import unittest -from qpid_dispatch_internal.management.config import Config +from skupper_router_internal.management.config import Config # Dash-separated configuration file conf_text = """ @@ -78,7 +78,7 @@ class QdrouterTest(unittest.TestCase): - """Tests for qpid_dispatch_internal.config.qdrouter""" + """Tests for skupper_router_internal.config.qdrouter""" def do_test_qdrouter_parse(self, text): conf = Config() diff --git a/tests/management_test/schema.py b/tests/management_test/schema.py index 172b48c10..d70fb0874 100644 --- a/tests/management_test/schema.py +++ b/tests/management_test/schema.py @@ -22,7 +22,7 @@ import unittest import json -from qpid_dispatch_internal.management.schema import Schema, BooleanType, EnumType, AttributeType, ValidationError, EnumValue, EntityType +from skupper_router_internal.management.schema import Schema, BooleanType, EnumType, AttributeType, ValidationError, EnumValue, EntityType SCHEMA_1 = { diff --git a/tests/mock/__init__.py b/tests/mock/__init__.py index e6eb6810c..b41c36bbf 100644 --- a/tests/mock/__init__.py +++ b/tests/mock/__init__.py @@ -20,7 +20,7 @@ """ Mock implementation of the dispatch C extension module for use in unit tests. """ -from qpid_dispatch_internal import dispatch as real_dispatch +from skupper_router_internal import dispatch as real_dispatch from . import dispatch as mock_dispatch # For tests we want to allow loading the proton module. diff --git a/tests/router_engine_test.py b/tests/router_engine_test.py index e68034e46..421cc0a92 100644 --- a/tests/router_engine_test.py +++ b/tests/router_engine_test.py @@ -26,9 +26,9 @@ from system_test import unittest from system_test import main_module -from qpid_dispatch.management.entity import EntityBase -from qpid_dispatch_internal.router.data import LinkState, MessageHELLO -from qpid_dispatch_internal.router.engine import HelloProtocol, PathEngine +from skupper_router.management.entity import EntityBase +from skupper_router_internal.router.data import LinkState, MessageHELLO +from skupper_router_internal.router.engine import HelloProtocol, PathEngine class Adapter: diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py index 213b5e4b7..b9e973731 100644 --- a/tests/router_policy_test.py +++ b/tests/router_policy_test.py @@ -20,17 +20,17 @@ import json from typing import TYPE_CHECKING, Any -from qpid_dispatch_internal.policy.policy_util import HostAddr, is_ipv6_enabled -from qpid_dispatch_internal.policy.policy_util import HostStruct -from qpid_dispatch_internal.policy.policy_util import PolicyError -from qpid_dispatch_internal.policy.policy_util import PolicyAppConnectionMgr -from qpid_dispatch_internal.policy.policy_local import PolicyLocal +from skupper_router_internal.policy.policy_util import HostAddr, is_ipv6_enabled +from skupper_router_internal.policy.policy_util import HostStruct +from skupper_router_internal.policy.policy_util import PolicyError +from skupper_router_internal.policy.policy_util import PolicyAppConnectionMgr +from skupper_router_internal.policy.policy_local import PolicyLocal from system_test import unittest from system_test import TestCase, main_module if TYPE_CHECKING: - from qpid_dispatch_internal.policy.policy_local import AppStats + from skupper_router_internal.policy.policy_local import AppStats class PolicyHostAddrTest(TestCase): diff --git a/tests/system_test.py b/tests/system_test.py index 0cbbd38e2..c8c3970fe 100755 --- a/tests/system_test.py +++ b/tests/system_test.py @@ -18,13 +18,13 @@ # """System test library, provides tools for tests that start multiple processes, -with special support for qdrouter processes. +with special support for skupper-router processes. Features: - Create separate directories for each test. - Save logs, sub-process output, core files etc. - Automated clean-up after tests: kill sub-processes etc. -- Tools to manipulate qdrouter configuration files. +- Tools to manipulate router configuration files. - Sundry other tools. """ @@ -64,8 +64,8 @@ from proton.handlers import MessagingHandler from proton.reactor import AtLeastOnce, Container from proton.reactor import AtMostOnce -from qpid_dispatch.management.client import Node -from qpid_dispatch.management.error import NotFoundStatus +from skupper_router.management.client import Node +from skupper_router.management.error import NotFoundStatus # Optional modules MISSING_MODULES = [] @@ -107,7 +107,7 @@ def is_exe(fpath): def _check_requirements(): """If requirements are missing, return a message, else return empty string.""" missing = MISSING_MODULES - required_exes = ['qdrouterd'] + required_exes = ['skrouterd'] missing += ["No exectuable %s" % e for e in required_exes if not find_exe(e)] if missing: @@ -488,7 +488,7 @@ def __init__(self, name=None, config=Config(), pyinclude=None, wait=True, 'includeSource': 'true', 'outputFile': self.logfile})) else: self.logfile = default_log[0][1].get('outputFile') - args = ['qdrouterd', '-c', config.write(name)] + cl_args + args = ['skrouterd', '-c', config.write(name)] + cl_args env_home = os.environ.get('QPID_DISPATCH_HOME') if pyinclude: args += ['-I', pyinclude] @@ -645,7 +645,7 @@ def is_connected(self, port, host='127.0.0.1'): Otherwise return None""" try: ret_val = False - response = self.management.query(type="org.apache.qpid.dispatch.connection") + response = self.management.query(type="io.skupper.router.connection") index_host = response.attribute_names.index('host') for result in response.results: outs = '%s:%s' % (host, port) @@ -668,7 +668,7 @@ def check(): # Need to rationalize addresses in management attributes. # endswith check is because of M/L/R prefixes addrs = self.management.query( - type='org.apache.qpid.dispatch.router.address', + type='io.skupper.router.router.address', attribute_names=['name', 'subscriberCount', 'remoteCount']).get_entities() addrs = [a for a in addrs if a['name'].endswith(address)] @@ -682,7 +682,7 @@ def wait_address_unsubscribed(self, address, **retry_kwargs): """ Block until address has no subscribers """ - a_type = 'org.apache.qpid.dispatch.router.address' + a_type = 'io.skupper.router.router.address' def check(): addrs = self.management.query(a_type).get_dicts() @@ -761,7 +761,7 @@ def is_router_connected(self, router_id, **retry_kwargs): # actually ready for traffic. Investigate. # Meantime the following actually tests send-thru to the router. node = Node.connect(self.addresses[0], router_id, timeout=1) - return retry_exception(lambda: node.query('org.apache.qpid.dispatch.router')) + return retry_exception(lambda: node.query('io.skupper.router.router')) except (proton.ConnectionException, NotFoundStatus, proton.utils.LinkDetached): # proton.ConnectionException: the router is not yet accepting connections # NotFoundStatus: the queried router is not yet connected @@ -1221,7 +1221,7 @@ def dump_log(self): class QdManager: """ - A means to invoke qdmanage during a testcase + A means to invoke skmanage during a testcase """ def __init__(self, address: Optional[str] = None, @@ -1246,7 +1246,7 @@ def __call__(self, cmd: str, timeout: Optional[float] = None) -> str: addr = address or self._address assert addr, "address missing" - with subprocess.Popen(['qdmanage'] + cmd.split(' ') + self.router + with subprocess.Popen(['skmanage'] + cmd.split(' ') + self.router + ['--bus', addr, '--indent=-1', '--timeout', str(timeout or self._timeout)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, @@ -1323,32 +1323,32 @@ def response(self, msg): return self._Response(ap['statusCode'], ap['statusDescription'], msg.body) def query_router(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router'} return Message(properties=ap, reply_to=self.reply_addr) def query_connections(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.connection'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.connection'} return Message(properties=ap, reply_to=self.reply_addr) def query_links(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router.link'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router.link'} return Message(properties=ap, reply_to=self.reply_addr) def query_addresses(self): ap = {'operation': 'QUERY', - 'type': 'org.apache.qpid.dispatch.router.address'} + 'type': 'io.skupper.router.router.address'} return Message(properties=ap, reply_to=self.reply_addr) def create_connector(self, name, **kwargs): ap = {'operation': 'CREATE', - 'type': 'org.apache.qpid.dispatch.connector', + 'type': 'io.skupper.router.connector', 'name': name} return Message(properties=ap, reply_to=self.reply_addr, body=kwargs) def delete_connector(self, name): ap = {'operation': 'DELETE', - 'type': 'org.apache.qpid.dispatch.connector', + 'type': 'io.skupper.router.connector', 'name': name} return Message(properties=ap, reply_to=self.reply_addr) @@ -1385,7 +1385,7 @@ def get_link_info(name, address): Query the router at address for the status and statistics of the named link """ qdm = QdManager(address=address) - rc = qdm.query('org.apache.qpid.dispatch.router.link') + rc = qdm.query('io.skupper.router.router.link') for item in rc: if item.get('name') == name: return item @@ -1394,7 +1394,7 @@ def get_link_info(name, address): def has_mobile_dest_in_address_table(address, dest): qdm = QdManager(address=address) - rc = qdm.query('org.apache.qpid.dispatch.router.address') + rc = qdm.query('io.skupper.router.router.address') has_dest = False for item in rc: if dest in item.get("name"): @@ -1410,7 +1410,7 @@ def get_inter_router_links(address): """ inter_router_links = [] qdm = QdManager(address=address) - rc = qdm.query('org.apache.qpid.dispatch.router.link') + rc = qdm.query('io.skupper.router.router.link') for item in rc: if item.get("linkType") == "inter-router": inter_router_links.append(item) diff --git a/tests/system_tests_autolinks.py b/tests/system_tests_autolinks.py index 0805bdac5..141324ca0 100644 --- a/tests/system_tests_autolinks.py +++ b/tests/system_tests_autolinks.py @@ -114,8 +114,8 @@ def setUpClass(cls): def test_name_collision(self): args = {"name": "autoLink", "address": "autoLink1", "connection": "broker", "direction": "in"} # Add autoLink with the same name as the one already present. - al_long_type = 'org.apache.qpid.dispatch.router.config.autoLink' - addr_long_type = 'org.apache.qpid.dispatch.router.config.address' + al_long_type = 'io.skupper.router.router.config.autoLink' + addr_long_type = 'io.skupper.router.router.config.address' mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: @@ -216,9 +216,9 @@ def address(self): return self.routers[1].addresses[0] def check_auto_link(self): - long_type = 'org.apache.qpid.dispatch.router.config.autoLink' + long_type = 'io.skupper.router.router.config.autoLink' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) if output[0].get('operStatus') == "active": self.success = True @@ -227,9 +227,9 @@ def check_auto_link(self): self.attempts += 1 - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -254,9 +254,9 @@ def schedule_auto_link_reconnect_test(self): Timer(self.timer_delay, self.check_auto_link).start() def test_auto_link_reattch(self): - long_type = 'org.apache.qpid.dispatch.router.config.autoLink' + long_type = 'io.skupper.router.router.config.autoLink' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) # Since the distribution of the autoLinked address 'examples' # is set to unavailable, the link route will initially be in the @@ -269,7 +269,7 @@ def test_auto_link_reattch(self): # re-attempt to establish the autoLink and once the autoLink # is up, it should return to the 'active' state. delete_command = 'DELETE --type=address --name=unavailable-address' - self.run_qdmanage(delete_command, address=self.routers[0].addresses[0]) + self.run_skmanage(delete_command, address=self.routers[0].addresses[0]) self.schedule_auto_link_reconnect_test() @@ -343,9 +343,9 @@ def run_qdstat_general(self): assert p.returncode == 0, "qdstat exit status %s, output:\n%s" % (p.returncode, out) return out - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', AutolinkTest.normal_address, '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', AutolinkTest.normal_address, '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -373,9 +373,9 @@ def test_03_autolink_sender(self): test.run() self.assertIsNone(test.error) - long_type = 'org.apache.qpid.dispatch.router' + long_type = 'io.skupper.router.router' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(output[0]['deliveriesEgressRouteContainer'], 275) self.assertEqual(output[0]['deliveriesIngressRouteContainer'], 0) self.assertEqual(output[0]['deliveriesTransit'], 0) @@ -746,7 +746,7 @@ def send_ops(self): if self.n_created < self.count: while self.n_created < self.count and self.agent.credit > 0: props = {'operation': 'CREATE', - 'type': 'org.apache.qpid.dispatch.router.config.autoLink', + 'type': 'io.skupper.router.router.config.autoLink', 'name': 'AL.%d' % self.n_created} body = {'direction': 'out', 'containerId': 'container.new', @@ -757,7 +757,7 @@ def send_ops(self): elif self.n_attached == self.count and self.n_deleted < self.count: while self.n_deleted < self.count and self.agent.credit > 0: props = {'operation': 'DELETE', - 'type': 'org.apache.qpid.dispatch.router.config.autoLink', + 'type': 'io.skupper.router.router.config.autoLink', 'name': 'AL.%d' % self.n_deleted} body = {} msg = Message(properties=props, body=body, reply_to=self.reply_to) diff --git a/tests/system_tests_bad_configuration.py b/tests/system_tests_bad_configuration.py index 25da99088..4b9cdad1a 100644 --- a/tests/system_tests_bad_configuration.py +++ b/tests/system_tests_bad_configuration.py @@ -92,7 +92,7 @@ def tearDownClass(cls): def address(self): """ - Returns the address that can be used along with qdmanage + Returns the address that can be used along with skmanage to query the running instance of the dispatch router. """ return self.router.addresses[0] @@ -139,14 +139,14 @@ def test_unresolvable_host_caught(self): """ self.assertTrue(self.error_caught) - def test_qdmanage_query(self): + def test_skmanage_query(self): """ Attempts to query the router after the error (or timeout) has occurred. It expects a successful query response to be returned by the router. :return: """ p = self.popen( - ['qdmanage', '-b', self.address(), 'query', '--type=router', '--timeout', str(TIMEOUT)], + ['skmanage', '-b', self.address(), 'query', '--type=router', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=Process.EXIT_OK, universal_newlines=True) out = p.communicate()[0] @@ -183,7 +183,7 @@ def test_verify_reject_id_with_ctrl_char(self): router_conf.write("}") lib_include_path = os.path.join(os.environ["QPID_DISPATCH_HOME"], "python") p = self.popen( - ['qdrouterd', '-c', conf_path, '-I', lib_include_path], + ['skrouterd', '-c', conf_path, '-I', lib_include_path], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=Process.EXIT_FAIL, universal_newlines=True) out = p.communicate(timeout=5)[0] @@ -222,7 +222,7 @@ def test_verify_reject_id_with_whitespace(self): router_conf.write("}") lib_include_path = os.path.join(os.environ["QPID_DISPATCH_HOME"], "python") p = self.popen( - ['qdrouterd', '-c', conf_path, '-I', lib_include_path], + ['skrouterd', '-c', conf_path, '-I', lib_include_path], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=Process.EXIT_FAIL, universal_newlines=True) out = p.communicate(timeout=5)[0] diff --git a/tests/system_tests_cmdline_parsing.py b/tests/system_tests_cmdline_parsing.py index 1e19dfd86..37b5b8f3b 100644 --- a/tests/system_tests_cmdline_parsing.py +++ b/tests/system_tests_cmdline_parsing.py @@ -18,7 +18,7 @@ # """ -This is a unit test class used to validate how qdrouterd +This is a unit test class used to validate how the router behaves with different command line arguments combinations, in order to ensure it won't break, causing bad experiences to the users. @@ -52,9 +52,9 @@ def setUpClass(cls): ('log', {'module': 'DEFAULT', 'enable': 'trace+', 'includeSource': 'true', 'outputFile': os.getcwd() + "/" + CommandLineTest.name + '.log'}) ]) - def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): + def run_router_as_daemon(self, config_file_name, pid_file_name): """ - Runs qdrouterd as a daemon, using the provided config_file_name + Runs the router as a daemon, using the provided config_file_name in order to ensure router is able to load it, be it using a full or relative path. @@ -63,7 +63,7 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): :return: """ pipe = self.popen( - [os.path.join(os.environ.get('BUILD_DIR'), 'router', 'qdrouterd'), '-d', + [os.path.join(os.environ.get('BUILD_DIR'), 'router', 'skrouterd'), '-d', '-I', os.path.join(os.environ.get('SOURCE_DIR'), 'python'), '-c', self.config.write(config_file_name), '-P', pid_file_name], stdout=PIPE, stderr=STDOUT, expect=Process.EXIT_OK, @@ -73,7 +73,7 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): try: pipe.teardown() - # kill qdrouterd running as a daemon + # kill the router running as a daemon with open(pid_file_name, 'r') as pidfile: for line in pidfile: os.kill(int(line), signal.SIGTERM) @@ -83,12 +83,12 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): def test_01_config_relative_path(self): """ - Starts qdrouterd as daemon, enforcing a config file name with + Starts the router as daemon, enforcing a config file name with relative path. """ try: - self.run_qdrouterd_as_daemon("test-router", os.getcwd() + '/test.pid') + self.run_router_as_daemon("test-router", os.getcwd() + '/test.pid') except OSError as ex: self.fail(ex) @@ -115,9 +115,9 @@ def setUpClass(cls): ('log', {'module': 'DEFAULT', 'enable': 'trace+', 'includeSource': 'true', 'outputFile': os.getcwd() + "/" + CommandLineTest2.name + '.log'}) ]) - def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): + def run_router_as_daemon(self, config_file_name, pid_file_name): """ - Runs qdrouterd as a daemon, using the provided config_file_name + Runs the router as a daemon, using the provided config_file_name in order to ensure router is able to load it, be it using a full or relative path. @@ -126,7 +126,7 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): :return: """ pipe = self.popen( - [os.path.join(os.environ.get('BUILD_DIR'), 'router', 'qdrouterd'), '-d', + [os.path.join(os.environ.get('BUILD_DIR'), 'router', 'skrouterd'), '-d', '-I', os.path.join(os.environ.get('SOURCE_DIR'), 'python'), '-c', self.config.write(config_file_name), '-P', pid_file_name], stdout=PIPE, stderr=STDOUT, expect=Process.EXIT_OK, @@ -136,7 +136,7 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): try: pipe.teardown() - # kill qdrouterd running as a daemon + # kill the router running as a daemon with open(pid_file_name, 'r') as pidfile: for line in pidfile: os.kill(int(line), signal.SIGTERM) @@ -146,13 +146,13 @@ def run_qdrouterd_as_daemon(self, config_file_name, pid_file_name): def test_02_config_full_path(self): """ - Starts qdrouterd as daemon, enforcing a config file name with + Starts the router as daemon, enforcing a config file name with full path. """ try: - self.run_qdrouterd_as_daemon(os.getcwd() + "/test-router-2.conf", - pid_file_name=os.getcwd() + '/test.pid') + self.run_router_as_daemon(os.getcwd() + "/test-router-2.conf", + pid_file_name=os.getcwd() + '/test.pid') except OSError as ex: self.fail(ex) diff --git a/tests/system_tests_connector_status.py b/tests/system_tests_connector_status.py index c0e983d67..82d8eb661 100644 --- a/tests/system_tests_connector_status.py +++ b/tests/system_tests_connector_status.py @@ -72,9 +72,9 @@ def setUp(self): def address(self): return self.routers[1].addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -101,9 +101,9 @@ def schedule_B_connector_test(self): def check_B_connector(self): # Router A should now try to connect to Router B again since we killed Router C. - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command, address=self.address())) + output = json.loads(self.run_skmanage(query_command, address=self.address())) conn_status = output[0].get('connectionStatus') conn_msg = output[0].get('connectionMsg') @@ -117,9 +117,9 @@ def test_conn_status_before_connect(self): # The routers have connected and begun talking to each other # Verify that the connectionStatus field of the connector is set to SUCCESS. # Also make sure that the connectionMsg field of the connector has "Connection opened" in it. - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) connection_msg = output[0]['connectionMsg'] self.assertEqual('SUCCESS', output[0]['connectionStatus']) conn_opened = False diff --git a/tests/system_tests_core_client.py b/tests/system_tests_core_client.py index b2edf2602..19162dafb 100644 --- a/tests/system_tests_core_client.py +++ b/tests/system_tests_core_client.py @@ -29,7 +29,7 @@ # These tests rely on enabling the router test hooks, which instantiates a test # client (see modules/test_hooks/core_test_hooks) see core_test_hooks.c -CONTAINER_ID = "org.apache.qpid.dispatch.test_core_client" +CONTAINER_ID = "io.skupper.router.test_core_client" TARGET_ADDR = "test_core_client_address" diff --git a/tests/system_tests_core_endpoint.py b/tests/system_tests_core_endpoint.py index d24e45ee0..9d0bbc651 100644 --- a/tests/system_tests_core_endpoint.py +++ b/tests/system_tests_core_endpoint.py @@ -57,27 +57,27 @@ def router(name, connection, args=None): router('A', ('listener', {'role': 'inter-router', 'port': inter_router_port}), ["-T"]) def test_01_denied_link(self): - test = DenyLinkTest(self.routers[0].addresses[0], "org.apache.qpid.dispatch.router/test/deny") + test = DenyLinkTest(self.routers[0].addresses[0], "io.skupper.router.router/test/deny") test.run() self.assertIsNone(test.error) def test_02_discard_deliveries(self): - test = DiscardTest(self.routers[0].addresses[0], "org.apache.qpid.dispatch.router/test/discard") + test = DiscardTest(self.routers[0].addresses[0], "io.skupper.router.router/test/discard") test.run() self.assertIsNone(test.error) def test_03_presettled_source(self): - test = SourceTest(self.routers[0].addresses[0], "org.apache.qpid.dispatch.router/test/source_ps", 300, 300) + test = SourceTest(self.routers[0].addresses[0], "io.skupper.router.router/test/source_ps", 300, 300) test.run() self.assertIsNone(test.error) def test_04_unsettled_source(self): - test = SourceTest(self.routers[0].addresses[0], "org.apache.qpid.dispatch.router/test/source", 300, 0) + test = SourceTest(self.routers[0].addresses[0], "io.skupper.router.router/test/source", 300, 0) test.run() self.assertIsNone(test.error) def test_05_echo_attach_detach(self): - test = EchoTest(self.routers[0].addresses[0], "org.apache.qpid.dispatch.router/test/echo") + test = EchoTest(self.routers[0].addresses[0], "io.skupper.router.router/test/echo") test.run() self.assertIsNone(test.error) diff --git a/tests/system_tests_default_distribution.py b/tests/system_tests_default_distribution.py index d6b079abd..559bb9ff5 100644 --- a/tests/system_tests_default_distribution.py +++ b/tests/system_tests_default_distribution.py @@ -44,15 +44,15 @@ def setUpClass(cls): cls.router.wait_ready() cls.address = cls.router.addresses[0] - def run_qdstat(self, args, regexp=None, address=None): + def run_skstat(self, args, regexp=None, address=None): p = self.popen( - ['qdstat', '--bus', str(address or self.address), '--timeout', str(TIMEOUT)] + args, - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + ['skstat', '--bus', str(address or self.address), '--timeout', str(TIMEOUT)] + args, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) if regexp: assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % (regexp, out) return out @@ -73,7 +73,7 @@ def test_anonymous_sender(self): self.assertTrue(test.received_error) def test_general(self): - out = self.run_qdstat(['--general'], r'(?s)Router Statistics.*Mode\s*Standalone') + out = self.run_skstat(['--general'], r'(?s)Router Statistics.*Mode\s*Standalone') self.assertIn("Connections 1", out) self.assertIn("Nodes 0", out) self.assertIn("Auto Links 0", out) diff --git a/tests/system_tests_delivery_abort.py b/tests/system_tests_delivery_abort.py index 5eb4a83a2..b677e0b08 100644 --- a/tests/system_tests_delivery_abort.py +++ b/tests/system_tests_delivery_abort.py @@ -21,7 +21,7 @@ from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch_internal.compat import BINARY +from skupper_router_internal.compat import BINARY from system_test import Logger, TestCase, Qdrouterd, main_module, unittest, TIMEOUT, TestTimeout @@ -121,11 +121,11 @@ def response(self, msg): return Entity(ap['statusCode'], ap['statusDescription'], msg.body) def read_address(self, name): - ap = {'operation': 'READ', 'type': 'org.apache.qpid.dispatch.router.address', 'name': name} + ap = {'operation': 'READ', 'type': 'io.skupper.router.router.address', 'name': name} return Message(properties=ap, reply_to=self.reply_addr) def query_addresses(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router.address'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router.address'} return Message(properties=ap, reply_to=self.reply_addr) diff --git a/tests/system_tests_delivery_counts.py b/tests/system_tests_delivery_counts.py index 096a8ff94..a0b0ca269 100644 --- a/tests/system_tests_delivery_counts.py +++ b/tests/system_tests_delivery_counts.py @@ -21,7 +21,7 @@ from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from system_test import TestCase, Qdrouterd, TIMEOUT, get_link_info, \ get_inter_router_links, has_mobile_dest_in_address_table, PollTimeout, TestTimeout @@ -73,7 +73,7 @@ def router_modified_counts(self, large_message=False): address = self.router.addresses[0] local_node = Node.connect(address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_modified_index = outs.attribute_names.index('modifiedDeliveries') results = outs.results[0] num_modified_deliveries_pre_test = results[deliveries_modified_index] @@ -82,7 +82,7 @@ def router_modified_counts(self, large_message=False): test = ModifiedDeliveriesTest(address, num_messages, large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] self.assertEqual(results[deliveries_modified_index] - num_modified_deliveries_pre_test, num_messages) @@ -126,7 +126,7 @@ def one_router_rejected_counts(self, large_message=False): address = self.router.addresses[0] local_node = Node.connect(address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_rejected_index = outs.attribute_names.index('rejectedDeliveries') results = outs.results[0] deliveries_rejected_pre_test = results[deliveries_rejected_index] @@ -135,7 +135,7 @@ def one_router_rejected_counts(self, large_message=False): test = RejectedDeliveriesTest(address, num_messages, large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] self.assertEqual(results[deliveries_rejected_index] - deliveries_rejected_pre_test, num_messages) @@ -178,7 +178,7 @@ def one_router_released_dropped_count(self, large_message=False): address = self.router.addresses[0] local_node = Node.connect(address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_dropped_presettled_index = outs.attribute_names.index('droppedPresettledDeliveries') deliveries_released_index = outs.attribute_names.index('releasedDeliveries') @@ -192,7 +192,7 @@ def one_router_released_dropped_count(self, large_message=False): test = ReleasedDroppedPresettledCountTest(address, num_messages, large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] @@ -252,7 +252,7 @@ def two_router_released_dropped_counts(self, large_message=False): # Make sure the hello messages (which are presettled dont show up in the counts local_node = Node.connect(address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_dropped_presettled_index = outs.attribute_names.index('droppedPresettledDeliveries') deliveries_released_index = outs.attribute_names.index('releasedDeliveries') deliveries_presettled_index = outs.attribute_names.index('presettledDeliveries') @@ -264,7 +264,7 @@ def two_router_released_dropped_counts(self, large_message=False): test = ReleasedDroppedPresettledCountTest(address, num_messages, large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] self.assertEqual(results[deliveries_dropped_presettled_index] - deliveries_dropped_presettled_pre_test, 10) @@ -620,14 +620,14 @@ def two_router_ingress_egress_counts(self, large_message=False): # Gather the values for deliveries_ingress and deliveries_egress before running the test. local_node = Node.connect(in_router_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_ingress_index = outs.attribute_names.index('deliveriesIngress') results = outs.results[0] pre_deliveries_ingresss = results[deliveries_ingress_index] local_node = Node.connect(out_router_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_egress_index = outs.attribute_names.index('deliveriesEgress') deliveries_accepted_index = outs.attribute_names.index('acceptedDeliveries') results = outs.results[0] @@ -643,13 +643,13 @@ def two_router_ingress_egress_counts(self, large_message=False): # Gather the values for deliveries_ingress and deliveries_egress after running the test. local_node = Node.connect(in_router_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] post_deliveries_ingresss = results[deliveries_ingress_index] local_node = Node.connect(out_router_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] post_deliveries_egress = results[deliveries_egress_index] @@ -704,7 +704,7 @@ def one_router_ingress_egress_counts(self, large_message=False): address = self.router.addresses[0] local_node = Node.connect(address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_ingress_index = outs.attribute_names.index('deliveriesIngress') deliveries_egress_index = outs.attribute_names.index('deliveriesEgress') @@ -716,7 +716,7 @@ def one_router_ingress_egress_counts(self, large_message=False): test = IngressEgressOneRouterTest(address, num_messages, large_message=large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') results = outs.results[0] @@ -776,7 +776,7 @@ def route_container_egress(self , large_message=False): route_container_addr = self.router.addresses[1] num_messages = 10 local_node = Node.connect(regular_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_egress_route_container_index = outs.attribute_names.index('deliveriesEgressRouteContainer') results = outs.results[0] @@ -785,7 +785,7 @@ def route_container_egress(self , large_message=False): test = RouteContainerEgressTest(route_container_addr, regular_addr, num_messages, large_message=large_message) test.run() - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_egress_route_container_index = outs.attribute_names.index('deliveriesEgressRouteContainer') results = outs.results[0] @@ -1143,7 +1143,7 @@ def test_route_container_ingress(self): test.run() local_node = Node.connect(regular_addr, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') deliveries_ingress_route_container_index = outs.attribute_names.index('deliveriesIngressRouteContainer') diff --git a/tests/system_tests_distribution.py b/tests/system_tests_distribution.py index de6e39f09..506c82047 100644 --- a/tests/system_tests_distribution.py +++ b/tests/system_tests_distribution.py @@ -63,11 +63,11 @@ def parse_address_query_response(self, msg): return AddressCheckResponse(ap['statusCode'], ap['statusDescription'], msg.body) def make_address_query(self, name): - ap = {'operation': 'READ', 'type': 'org.apache.qpid.dispatch.router.address', 'name': name} + ap = {'operation': 'READ', 'type': 'io.skupper.router.router.address', 'name': name} return Message(properties=ap, reply_to=self.reply_addr) def make_addresses_query(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router.address'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router.address'} return Message(properties=ap, reply_to=self.reply_addr) diff --git a/tests/system_tests_edge_router.py b/tests/system_tests_edge_router.py index 5b8fac796..a6d885553 100644 --- a/tests/system_tests_edge_router.py +++ b/tests/system_tests_edge_router.py @@ -28,7 +28,7 @@ from proton.reactor import Container from proton.utils import BlockingConnection -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, MgmtMsgProxy, TestTimeout from system_test import Logger @@ -104,16 +104,16 @@ def setUp(self): self.max_attempts = 3 self.attempts = 0 - def run_qdstat(self, args, regexp=None, address=None): + def run_skstat(self, args, regexp=None, address=None): p = self.popen( - ['qdstat', '--bus', str(address or self.router.addresses[0]), + ['skstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT)] + args, - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) if regexp: assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % ( @@ -129,39 +129,39 @@ def can_terminate(self): return False - def run_int_b_edge_qdstat(self): - outs = self.run_qdstat(['--edge'], + def run_int_b_edge_skstat(self): + outs = self.run_skstat(['--edge'], address=self.routers[2].addresses[0]) lines = outs.split("\n") for line in lines: if "INT.B" in line and "yes" in line: self.success = True - def run_int_a_edge_qdstat(self): - outs = self.run_qdstat(['--edge'], + def run_int_a_edge_skstat(self): + outs = self.run_skstat(['--edge'], address=self.routers[2].addresses[0]) lines = outs.split("\n") for line in lines: if "INT.A" in line and "yes" in line: self.success = True - def schedule_int_a_qdstat_test(self): + def schedule_int_a_skstat_test(self): if self.attempts < self.max_attempts: if not self.success: - Timer(self.timer_delay, self.run_int_a_edge_qdstat).start() + Timer(self.timer_delay, self.run_int_a_edge_skstat).start() self.attempts += 1 - def schedule_int_b_qdstat_test(self): + def schedule_int_b_skstat_test(self): if self.attempts < self.max_attempts: if not self.success: - Timer(self.timer_delay, self.run_int_b_edge_qdstat).start() + Timer(self.timer_delay, self.run_int_b_edge_skstat).start() self.attempts += 1 def test_01_active_flag(self): """ In this test, we have one edge router connected to two interior routers. One connection is to INT.A and another connection is to - INT.B . But only one of these connections is active. We use qdstat + INT.B . But only one of these connections is active. We use skstat to make sure that only one of these connections is active. Then we kill the router with the active connection and make sure that the other connection is now the active one @@ -170,7 +170,7 @@ def test_01_active_flag(self): self.skipTest("Test skipped during development.") success = False - outs = self.run_qdstat(['--edge'], + outs = self.run_skstat(['--edge'], address=self.routers[0].addresses[0]) lines = outs.split("\n") for line in lines: @@ -180,7 +180,7 @@ def test_01_active_flag(self): self.fail("Active edge connection not found not found for " "interior router") - outs = self.run_qdstat(['--edge'], + outs = self.run_skstat(['--edge'], address=self.routers[2].addresses[0]) conn_map_edge = dict() # @@ -208,7 +208,7 @@ def test_01_active_flag(self): # if the other connection becomes active # EdgeRouterTest.routers[0].teardown() - self.schedule_int_b_qdstat_test() + self.schedule_int_b_skstat_test() while not self.can_terminate(): pass @@ -221,7 +221,7 @@ def test_01_active_flag(self): # if the other connection becomes active # EdgeRouterTest.routers[1].teardown() - self.schedule_int_a_qdstat_test() + self.schedule_int_a_skstat_test() while not self.can_terminate(): pass @@ -1189,38 +1189,38 @@ def test_67_drop_rx_client_multicast_small_message(self): test.run() self.assertIsNone(test.error) - def run_qdstat(self, args, regexp=None, address=None): + def run_skstat(self, args, regexp=None, address=None): if args: - popen_arg = ['qdstat', '--bus', str(address or self.router.addresses[0]), + popen_arg = ['skstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT)] + args else: - popen_arg = ['qdstat', '--bus', + popen_arg = ['skstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT)] p = self.popen(popen_arg, - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) if regexp: assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % ( regexp, out) return out - def test_68_edge_qdstat_all_routers(self): - # Connects to an edge router and runs "qdstat --all-routers" - # "qdstat --all-routers" is same as "qdstat --all-routers --g" - # Connecting to an edge router and running "qdstat --all-routers""will only yield the + def test_68_edge_skstat_all_routers(self): + # Connects to an edge router and runs "skstat --all-routers" + # "skstat --all-routers" is same as "skstat --all-routers --g" + # Connecting to an edge router and running "skstat --all-routers""will only yield the # summary statistics of the edge router. It will not show statistics of the interior routers. - outs = self.run_qdstat(['--all-routers'], + outs = self.run_skstat(['--all-routers'], address=self.routers[2].addresses[0]) self.assertIn("Router Id EA1", outs) - outs = self.run_qdstat(['--all-routers', '--all-entities'], + outs = self.run_skstat(['--all-routers', '--all-entities'], address=self.routers[2].addresses[0]) # Check if each entity section is showing self.assertIn("Router Links", outs) @@ -1233,14 +1233,14 @@ def test_68_edge_qdstat_all_routers(self): self.assertIn("Memory Pools", outs) - outs = self.run_qdstat(['-c', '--all-routers'], + outs = self.run_skstat(['-c', '--all-routers'], address=self.routers[2].addresses[0]) # Verify that the the edhe uplink connection is showing self.assertIn("INT.A", outs) self.assertNotIn("inter-router", outs) - outs = self.run_qdstat(['--all-entities'], + outs = self.run_skstat(['--all-entities'], address=self.routers[2].addresses[0]) # Check if each entity section is showing self.assertIn("Router Links", outs) @@ -1253,22 +1253,22 @@ def test_68_edge_qdstat_all_routers(self): self.assertIn("Memory Pools", outs) - def test_69_interior_qdstat_all_routers(self): - # Connects to an interior router and runs "qdstat --all-routers" - # "qdstat --all-routers" is same as "qdstat --all-routers --all-entities" - # Connecting to an interior router and running "qdstat --all-routers""will yield the + def test_69_interior_skstat_all_routers(self): + # Connects to an interior router and runs "skstat --all-routers" + # "skstat --all-routers" is same as "skstat --all-routers --all-entities" + # Connecting to an interior router and running "skstat --all-routers""will yield the # summary statistics of all the interior routers. - outs = self.run_qdstat(['--all-routers'], + outs = self.run_skstat(['--all-routers'], address=self.routers[0].addresses[0]) self.assertEqual(outs.count("Router Statistics"), 2) - outs = self.run_qdstat(['--all-routers', '-nv'], + outs = self.run_skstat(['--all-routers', '-nv'], address=self.routers[0].addresses[0]) # 5 occurences including section headers self.assertEqual(outs.count("INT.A"), 5) self.assertEqual(outs.count("INT.B"), 5) - outs = self.run_qdstat(['--all-routers', '--all-entities'], + outs = self.run_skstat(['--all-routers', '--all-entities'], address=self.routers[0].addresses[0]) self.assertEqual(outs.count("Router Links"), 2) self.assertEqual(outs.count("Router Addresses"), 2) @@ -1276,25 +1276,25 @@ def test_69_interior_qdstat_all_routers(self): self.assertEqual(outs.count("Router Statistics"), 2) self.assertEqual(outs.count("Memory Pools"), 2) - outs = self.run_qdstat(['--all-routers', '-nv'], + outs = self.run_skstat(['--all-routers', '-nv'], address=self.routers[0].addresses[0]) # 5 occurrences including section headers self.assertEqual(outs.count("INT.A"), 5) self.assertEqual(outs.count("INT.B"), 5) - outs = self.run_qdstat(['-c', '--all-routers'], + outs = self.run_skstat(['-c', '--all-routers'], address=self.routers[0].addresses[0]) self.assertEqual(outs.count("INT.A"), 2) self.assertEqual(outs.count("INT.B"), 2) - outs = self.run_qdstat(['-l', '--all-routers'], + outs = self.run_skstat(['-l', '--all-routers'], address=self.routers[0].addresses[0]) # Two edge-downlinks from each interior to the two edges, 4 in total. self.assertEqual(outs.count("edge-downlink"), 4) # Gets all entity information of the interior router - outs = self.run_qdstat(['--all-entities'], + outs = self.run_skstat(['--all-entities'], address=self.routers[0].addresses[0]) self.assertEqual(outs.count("Router Links"), 1) self.assertEqual(outs.count("Router Addresses"), 1) @@ -1303,7 +1303,7 @@ def test_69_interior_qdstat_all_routers(self): has_error = False try: # You cannot combine --all-entities with -c - outs = self.run_qdstat(['-c', '--all-entities'], + outs = self.run_skstat(['-c', '--all-entities'], address=self.routers[0].addresses[0]) except Exception as e: if "error: argument --all-entities: not allowed with argument -c/--connections" in str(e): @@ -1313,7 +1313,7 @@ def test_69_interior_qdstat_all_routers(self): has_error = False try: - outs = self.run_qdstat(['-r', 'INT.A', '--all-routers'], + outs = self.run_skstat(['-r', 'INT.A', '--all-routers'], address=self.routers[0].addresses[0]) except Exception as e: if "error: argument --all-routers: not allowed with argument -r/--router" in str(e): @@ -1321,15 +1321,15 @@ def test_69_interior_qdstat_all_routers(self): self.assertTrue(has_error) - def test_70_qdstat_edge_router_option(self): - # Tests the --edge-router (-d) option of qdstat + def test_70_skstat_edge_router_option(self): + # Tests the --edge-router (-d) option of skstat # The goal of this test is to connect to any router in the # network (interior or edge) and ask for details about a specific edge router # You could not do that before DISPATCH-1580 - # Makes a connection to an interior router INT.A and runs qdstat + # Makes a connection to an interior router INT.A and runs skstat # asking for all connections of an edge router EA1 - outs = self.run_qdstat(['-d', 'EA1', '-c'], + outs = self.run_skstat(['-d', 'EA1', '-c'], address=self.routers[0].addresses[0]) parts = outs.split("\n") conn_found = False @@ -1340,9 +1340,9 @@ def test_70_qdstat_edge_router_option(self): self.assertTrue(conn_found) - # Makes a connection to an edge router and runs qdstat + # Makes a connection to an edge router and runs skstat # asking for all connections of an edge router EA1 - outs = self.run_qdstat(['-d', 'EA1', '-c'], + outs = self.run_skstat(['-d', 'EA1', '-c'], address=self.routers[2].addresses[0]) parts = outs.split("\n") conn_found = False @@ -1353,11 +1353,11 @@ def test_70_qdstat_edge_router_option(self): self.assertTrue(conn_found) - # Makes a connection to an interior router INT.B and runs qdstat + # Makes a connection to an interior router INT.B and runs skstat # asking for all connections of an edge router EA1. The interior # router INT.B is connected to edge router EA1 indirectly via # interior router INT.A - outs = self.run_qdstat(['--edge-router', 'EA1', '-c'], + outs = self.run_skstat(['--edge-router', 'EA1', '-c'], address=self.routers[1].addresses[0]) parts = outs.split("\n") conn_found = False @@ -1368,25 +1368,25 @@ def test_70_qdstat_edge_router_option(self): self.assertTrue(conn_found) - def test_71_qdmanage_edge_router_option(self): - # Makes a connection to an interior router INT.A and runs qdstat + def test_71_skmanage_edge_router_option(self): + # Makes a connection to an interior router INT.A and runs skstat # asking for all connections of an edge router EA1 mgmt = QdManager(address=self.routers[0].addresses[0], edge_router_id='EA1') conn_found = False - outs = mgmt.query('org.apache.qpid.dispatch.connection') + outs = mgmt.query('io.skupper.router.connection') for out in outs: if out['container'] == 'INT.A' and out['dir'] == "out" and out['role'] == "edge": conn_found = True break self.assertTrue(conn_found) - # Makes a connection to an edge router and runs qdstat + # Makes a connection to an edge router and runs skstat # asking for all connections of an edge router EA1 mgmt = QdManager(address=self.routers[2].addresses[0], edge_router_id='EA1') conn_found = False - outs = mgmt.query('org.apache.qpid.dispatch.connection') + outs = mgmt.query('io.skupper.router.connection') for out in outs: if out['container'] == 'INT.A' and out['dir'] == "out" and out['role'] == "edge": @@ -1394,14 +1394,14 @@ def test_71_qdmanage_edge_router_option(self): break self.assertTrue(conn_found) - # Makes a connection to an interior router INT.B and runs qdstat + # Makes a connection to an interior router INT.B and runs skstat # asking for all connections of an edge router EA1. The interior # router INT.B is connected to edge router EA1 indirectly via # interior router INT.A mgmt = QdManager(address=self.routers[1].addresses[0], edge_router_id='EA1') conn_found = False - outs = mgmt.query('org.apache.qpid.dispatch.connection') + outs = mgmt.query('io.skupper.router.connection') for out in outs: if out['container'] == 'INT.A' and out['dir'] == "out" and out['role'] == "edge": @@ -1409,11 +1409,11 @@ def test_71_qdmanage_edge_router_option(self): break self.assertTrue(conn_found) - def test_72_qdstat_query_interior_from_edge(self): + def test_72_skstat_query_interior_from_edge(self): # Connect to Edge Router EA1 and query the connections on # Interior Router INT.A - outs = self.run_qdstat(['-r', 'INT.A', '-c'], + outs = self.run_skstat(['-r', 'INT.A', '-c'], address=self.routers[2].addresses[0]) # The Interior Router INT.A is connected to two edge routers @@ -1438,7 +1438,7 @@ def test_72_qdstat_query_interior_from_edge(self): # EA1 via INT.A # We will connect to edge router EA1 (which has an edge # uplink to INT.A) and query for connections on INT.B - outs = self.run_qdstat(['-r', 'INT.B', '-c'], + outs = self.run_skstat(['-r', 'INT.B', '-c'], address=self.routers[2].addresses[0]) eb1_conn_found = False @@ -1455,14 +1455,14 @@ def test_72_qdstat_query_interior_from_edge(self): self.assertTrue(eb1_conn_found and eb2_conn_found and int_a_inter_router_conn_found) - def test_73_qdmanage_query_interior_from_edge(self): + def test_73_skmanage_query_interior_from_edge(self): # The Interior Router INT.A is connected to two edge routers # EA1 and EA2 and is also connected to another interior router INT.B # We will connect to edge router EA1 (which has an edge # uplink to INT.A) and query for connections on INT.A mgmt = QdManager(address=self.routers[2].addresses[0], router_id='INT.A') - outs = mgmt.query('org.apache.qpid.dispatch.connection') + outs = mgmt.query('io.skupper.router.connection') ea1_conn_found = False ea2_conn_found = False int_b_inter_router_conn_found = False @@ -1482,7 +1482,7 @@ def test_73_qdmanage_query_interior_from_edge(self): # uplink to INT.A) and query for connections on INT.B mgmt = QdManager(address=self.routers[2].addresses[0], router_id='INT.B') - outs = mgmt.query('org.apache.qpid.dispatch.connection') + outs = mgmt.query('io.skupper.router.connection') eb1_conn_found = False eb2_conn_found = False int_a_inter_router_conn_found = False @@ -2281,7 +2281,7 @@ def on_link_opened(self, event): def check_address(self): local_node = Node.connect(self.interior_host, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router.address') + outs = local_node.query(type='io.skupper.router.router.address') remote_count = outs.attribute_names.index("remoteCount") subs_count = outs.attribute_names.index("subscriberCount") found = False @@ -2526,7 +2526,7 @@ def router(name, mode, extra): def _get_address(self, router, address): """Lookup address in route table""" - a_type = 'org.apache.qpid.dispatch.router.address' + a_type = 'io.skupper.router.router.address' addrs = router.management.query(a_type).get_dicts() return [a for a in addrs if address in a['name']] diff --git a/tests/system_tests_handle_failover.py b/tests/system_tests_handle_failover.py index cacdcda8c..bdf25e129 100644 --- a/tests/system_tests_handle_failover.py +++ b/tests/system_tests_handle_failover.py @@ -100,9 +100,9 @@ def setUp(self): def address(self): return self.routers[1].addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -112,15 +112,15 @@ def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): raise Exception("%s\n%s" % (e, out)) return out - def run_qdstat(self, args, regexp=None, address=None): + def run_skstat(self, args, regexp=None, address=None): p = self.popen( - ['qdstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT)] + args, - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + ['skstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(TIMEOUT)] + args, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) if regexp: assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % (regexp, out) return out @@ -129,14 +129,14 @@ def test_1_connector_has_failover_list(self): """ This is the most simple and straightforward case. Router A connects to Router B. Router B sends failover information to Router A. - We make a qdmanage connector query to Router A which checks if Router A is storing the failover information + We make a skmanage connector query to Router A which checks if Router A is storing the failover information received from Router B.The failover list must consist of the original connection info (from the connector) followed by the two items sent by the Router B (stored in cls.failover_list) The 'failoverUrls' is comma separated. """ - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) expected = "amqp://127.0.0.1:" + str(FailoverTest.inter_router_port) + ", " + FailoverTest.failover_list self.assertEqual(expected, output[0]['failoverUrls']) @@ -148,9 +148,9 @@ def schedule_B_to_C_failover_test(self): self.attempts += 1 def check_C_connector(self): - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command, address=self.routers[1].addresses[0])) + output = json.loads(self.run_skmanage(query_command, address=self.routers[1].addresses[0])) expected = FailoverTest.backup_url + ", " + "amqp://127.0.0.1:" + str(FailoverTest.inter_router_port) \ + ", " + "amqp://third-host:5671" @@ -178,7 +178,7 @@ def test_2_remove_router_B(self): """ # First make sure there are no inter-router connections on router C - outs = self.run_qdstat(['--connections'], address=self.routers[2].addresses[1]) + outs = self.run_skstat(['--connections'], address=self.routers[2].addresses[1]) inter_router = 'inter-router' in outs self.assertFalse(inter_router) @@ -203,9 +203,9 @@ def schedule_C_to_B_failover_test(self): def check_B_connector(self): # Router A should now try to connect to Router B again since we killed Router C. - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command, address=self.routers[1].addresses[0])) + output = json.loads(self.run_skmanage(query_command, address=self.routers[1].addresses[0])) # The order that the URLs appear in the failoverUrls is important. This is the order in which the router # will attempt to make connections in case the existing connection goes down. @@ -256,9 +256,9 @@ def test_3_reinstate_router_B(self): def check_A_connector(self): # Router A should now try to connect to Router B again since we killed Router C. - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command, address=self.routers[1].addresses[0])) + output = json.loads(self.run_skmanage(query_command, address=self.routers[1].addresses[0])) # The order that the URLs appear in the failoverUrls is important. This is the order in which the router # will attempt to make connections in case the existing connection goes down. diff --git a/tests/system_tests_http.py b/tests/system_tests_http.py index 8c1f6de7b..473bc4e2b 100644 --- a/tests/system_tests_http.py +++ b/tests/system_tests_http.py @@ -25,7 +25,7 @@ from urllib.request import urlopen, build_opener, HTTPSHandler from urllib.error import HTTPError, URLError -import qpid_dispatch_site +import skupper_router_site from system_test import TIMEOUT, Process, QdManager, retry from system_test import TestCase, Qdrouterd, main_module, DIR from system_test import unittest @@ -41,7 +41,7 @@ def ssl_file(name): def setUpClass(cls): super(RouterTestHttp, cls).setUpClass() # DISPATCH-1513, DISPATCH-2299: Http listener delete was broken in LWS v4 until v4.2.0 - cls.skip_delete_http_listener_test = qpid_dispatch_site.SKIP_DELETE_HTTP_LISTENER + cls.skip_delete_http_listener_test = skupper_router_site.SKIP_DELETE_HTTP_LISTENER @classmethod def get(cls, url, use_ca=True): @@ -61,9 +61,9 @@ def get_cert(cls, url): opener = build_opener(HTTPSHandler(context=context)) return opener.open(url).read().decode('utf-8') - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -138,7 +138,7 @@ def address(): # are working. # Delete the listener on port http_delete_listen_port_1 - long_type = 'org.apache.qpid.dispatch.listener' + long_type = 'io.skupper.router.listener' mgmt = QdManager(address=address()) if self.skip_delete_http_listener_test: @@ -319,7 +319,7 @@ def address(): # The new flag allows (as the flag says) HTTP over HTTPS listeners. # Since this flag is not available before lws 3.2.0 we need # to selectively disable this check - if qpid_dispatch_site.LIBWEBSOCKETS_VERSION >= (3, 2, 0): + if skupper_router_site.LIBWEBSOCKETS_VERSION >= (3, 2, 0): self.assert_get("http://localhost:%s" % r.ports[0]) self.assert_get("https://localhost:%s" % r.ports[1]) @@ -337,7 +337,7 @@ def address(): if not self.skip_delete_http_listener_test: # Delete the listener with name 'delete-me' - long_type = 'org.apache.qpid.dispatch.listener' + long_type = 'io.skupper.router.listener' mgmt = QdManager(address=address()) mgmt.delete(long_type, name=name) diff --git a/tests/system_tests_http1_adaptor.py b/tests/system_tests_http1_adaptor.py index e2096556d..e4b9904f0 100644 --- a/tests/system_tests_http1_adaptor.py +++ b/tests/system_tests_http1_adaptor.py @@ -48,9 +48,9 @@ class Http1AdaptorManagementTest(TestCase): def setUpClass(cls): super(Http1AdaptorManagementTest, cls).setUpClass() - cls.LISTENER_TYPE = 'org.apache.qpid.dispatch.httpListener' - cls.CONNECTOR_TYPE = 'org.apache.qpid.dispatch.httpConnector' - cls.CONNECTION_TYPE = 'org.apache.qpid.dispatch.connection' + cls.LISTENER_TYPE = 'io.skupper.router.httpListener' + cls.CONNECTOR_TYPE = 'io.skupper.router.httpConnector' + cls.CONNECTION_TYPE = 'io.skupper.router.connection' cls.interior_edge_port = cls.tester.get_port() cls.interior_mgmt_port = cls.tester.get_port() @@ -315,7 +315,7 @@ def test_000_stats(self): self._do_request(client, self.TESTS_11["POST"]) client.close() qd_manager = QdManager(address=self.INT_A.listener) - stats = qd_manager.query('org.apache.qpid.dispatch.httpRequestInfo') + stats = qd_manager.query('io.skupper.router.httpRequestInfo') self.assertEqual(len(stats), 2) for s in stats: self.assertEqual(s.get('requests'), 10) diff --git a/tests/system_tests_http2.py b/tests/system_tests_http2.py index e723dff16..884951e97 100644 --- a/tests/system_tests_http2.py +++ b/tests/system_tests_http2.py @@ -234,14 +234,14 @@ def check_listener_delete(self, client_addr, server_addr): self.assertIn(ret_string, out) qd_manager = QdManager(address=server_addr) - http_listeners = qd_manager.query('org.apache.qpid.dispatch.httpListener') + http_listeners = qd_manager.query('io.skupper.router.httpListener') self.assertEqual(len(http_listeners), 1) - # Run a qdmanage DELETE on the httpListener - qd_manager.delete("org.apache.qpid.dispatch.httpListener", name=self.listener_name) + # Run a skmanage DELETE on the httpListener + qd_manager.delete("io.skupper.router.httpListener", name=self.listener_name) # Make sure the listener is gone - http_listeners = qd_manager.query('org.apache.qpid.dispatch.httpListener') + http_listeners = qd_manager.query('io.skupper.router.httpListener') self.assertEqual(len(http_listeners), 0) # Try running a curl command against the listener to make sure it times out @@ -254,7 +254,7 @@ def check_listener_delete(self, client_addr, server_addr): # Add back the listener and run a curl command to make sure that the newly added listener is # back up and running. - create_result = qd_manager.create("org.apache.qpid.dispatch.httpListener", self.http_listener_props) + create_result = qd_manager.create("io.skupper.router.httpListener", self.http_listener_props) sleep(2) out = self.run_curl(client_addr) self.assertIn(ret_string, out) @@ -264,10 +264,10 @@ def check_connector_delete(self, client_addr, server_addr): # We are first making sure that the http request goes thru successfully. out = self.run_curl(client_addr) - # Run a qdmanage query on connections to see how many qdr_connections are + # Run a skmanage query on connections to see how many qdr_connections are # there on the egress router qd_manager = QdManager(address=server_addr) - connections = qd_manager.query('org.apache.qpid.dispatch.connection') + connections = qd_manager.query('io.skupper.router.connection') self.assertGreaterEqual(len(connections), 2) server_conn_found = False @@ -277,19 +277,19 @@ def check_connector_delete(self, client_addr, server_addr): break self.assertTrue(server_conn_found) - # Run a qdmanage DELETE on the httpConnector - http_connectors = qd_manager.query('org.apache.qpid.dispatch.httpConnector') + # Run a skmanage DELETE on the httpConnector + http_connectors = qd_manager.query('io.skupper.router.httpConnector') self.assertEqual(len(http_connectors), 1) # Delete the httpConnector - qd_manager.delete("org.apache.qpid.dispatch.httpConnector", name=self.connector_name) + qd_manager.delete("io.skupper.router.httpConnector", name=self.connector_name) # Make sure the connector is gone - http_connectors = qd_manager.query('org.apache.qpid.dispatch.httpConnector') + http_connectors = qd_manager.query('io.skupper.router.httpConnector') self.assertEqual(len(http_connectors), 0) # Deleting the connector must have taken out the connection to the server. - connections = qd_manager.query('org.apache.qpid.dispatch.connection') + connections = qd_manager.query('io.skupper.router.connection') http_server_conn_found = False for conn in connections: if os.environ['SERVER_LISTEN_PORT'] in conn['name']: @@ -310,13 +310,13 @@ def check_connector_delete(self, client_addr, server_addr): self.assertTrue(request_timed_out) # Add back the httpConnector - # qdmanage CREATE type=httpConnector address=examples.com host=127.0.0.1 port=80 protocolVersion=HTTP2 - create_result = qd_manager.create("org.apache.qpid.dispatch.httpConnector", self.connector_props) + # skmanage CREATE type=httpConnector address=examples.com host=127.0.0.1 port=80 protocolVersion=HTTP2 + create_result = qd_manager.create("io.skupper.router.httpConnector", self.connector_props) num_tries = 2 tries = 0 conn_present = False while tries < num_tries: - connections = qd_manager.query('org.apache.qpid.dispatch.connection') + connections = qd_manager.query('io.skupper.router.connection') tries += 1 if len(connections) < 2: sleep(2) @@ -383,7 +383,7 @@ def test_000_stats(self): out = self.run_curl(address, args=['-d', 'fname=Mickey&lname=Mouse', '-X', 'POST']) self.assertIn('Success! Your first name is Mickey, last name is Mouse', out) - stats = qd_manager.query('org.apache.qpid.dispatch.httpRequestInfo') + stats = qd_manager.query('io.skupper.router.httpRequestInfo') self.assertEqual(len(stats), 2) # Give time for the core thread to augment the stats. @@ -392,7 +392,7 @@ def test_000_stats(self): if not stats or stats[0].get('requests') < 2: i += 1 sleep(1) - stats = qd_manager.query('org.apache.qpid.dispatch.httpRequestInfo') + stats = qd_manager.query('io.skupper.router.httpRequestInfo') else: break @@ -551,7 +551,7 @@ def test_000_stats(self): # Run curl 127.0.0.1:port --http2-prior-knowledge address = self.router_qdra.http_addresses[0] qd_manager_a = QdManager(address=self.router_qdra.addresses[0]) - stats_a = qd_manager_a.query('org.apache.qpid.dispatch.httpRequestInfo') + stats_a = qd_manager_a.query('io.skupper.router.httpRequestInfo') # First request self.run_curl(address) @@ -567,7 +567,7 @@ def test_000_stats(self): if not stats_a or stats_a[0].get('requests') < 2: sleep(1) i += 1 - stats_a = qd_manager_a.query('org.apache.qpid.dispatch.httpRequestInfo') + stats_a = qd_manager_a.query('io.skupper.router.httpRequestInfo') else: break @@ -577,7 +577,7 @@ def test_000_stats(self): self.assertEqual(stats_a[0].get('bytesOut'), 3944) self.assertEqual(stats_a[0].get('bytesIn'), 24) qd_manager_b = QdManager(address=self.router_qdrb.addresses[0]) - stats_b = qd_manager_b.query('org.apache.qpid.dispatch.httpRequestInfo') + stats_b = qd_manager_b.query('io.skupper.router.httpRequestInfo') self.assertEqual(len(stats_b), 1) i = 0 @@ -586,7 +586,7 @@ def test_000_stats(self): if not stats_b or stats_b[0].get('requests') < 2: i += 1 sleep(1) - stats_b = qd_manager_b.query('org.apache.qpid.dispatch.httpRequestInfo') + stats_b = qd_manager_b.query('io.skupper.router.httpRequestInfo') else: break @@ -778,7 +778,7 @@ def test_check_connector_delete(self): # Now delete the httpConnector on the edge router config_edgea qd_manager = QdManager(address=self.router_qdra.addresses[0]) - qd_manager.delete("org.apache.qpid.dispatch.httpConnector", name=self.edge_a_http_connector_name) + qd_manager.delete("io.skupper.router.httpConnector", name=self.edge_a_http_connector_name) sleep(2) # now check the interior router for the examples address. Since the httpConnector on one of the @@ -796,7 +796,7 @@ def test_check_connector_delete(self): # Now delete the httpConnector on the edge router config_edgeb qd_manager = QdManager(address=self.router_qdrb.addresses[0]) - qd_manager.delete("org.apache.qpid.dispatch.httpConnector", name=self.edge_b_http_connector_name) + qd_manager.delete("io.skupper.router.httpConnector", name=self.edge_b_http_connector_name) sleep(2) # Now, run a curl client GET request with a timeout. diff --git a/tests/system_tests_log_level_update.py b/tests/system_tests_log_level_update.py index 42a46903b..b8d33584a 100644 --- a/tests/system_tests_log_level_update.py +++ b/tests/system_tests_log_level_update.py @@ -172,8 +172,8 @@ def test_turn_on_protocol_trace(self): # num_attaches for address TEST_ADDR must be 4, two attaches to/from sender and receiver self.assertTrue(num_attaches == 4) - # Turn off trace logging using qdmanage - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "info+"}, name="log/DEFAULT") + # Turn off trace logging using skmanage + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/DEFAULT") # Turn on trace (not trace+) level logging for the PROTOCOL module. After doing # this we will create a sender and a receiver and make sure that the PROTOCOL module @@ -184,7 +184,7 @@ def test_turn_on_protocol_trace(self): # module would also spit out dispatch trace level messages from the SERVER module. # DISPATCH-1558 adds the new PROTOCOL module which moves all protocol traces into # that module. - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "trace+"}, name="log/PROTOCOL") + qd_manager.update("io.skupper.router.log", {"enable": "trace+"}, name="log/PROTOCOL") TEST_ADDR = "moduletest1" hello_world_1 = "Hello World_1!" @@ -202,7 +202,7 @@ def test_turn_on_protocol_trace(self): # Now turn off trace logging for the PROTOCOL module and make sure # that there is no more proton frame trace messages appearing in the log - qd_manager.update("org.apache.qpid.dispatch.log", + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/PROTOCOL") TEST_ADDR = "moduletest2" @@ -271,7 +271,7 @@ def test_inter_router_protocol_trace(self): # The router already has trace logging turned on for all connections. # Get the connection id of the inter-router connection - results = qd_manager.query("org.apache.qpid.dispatch.connection") + results = qd_manager.query("io.skupper.router.connection") conn_id = None for result in results: if result['role'] == 'inter-router': @@ -279,7 +279,7 @@ def test_inter_router_protocol_trace(self): # Turn off trace logging for the inter-router connection. This update command is run async by the router # so we need to sleep a bit before the operation is actually completed. - qd_manager.update("org.apache.qpid.dispatch.connection", {"enableProtocolTrace": "false"}, identity=conn_id) + qd_manager.update("io.skupper.router.connection", {"enableProtocolTrace": "false"}, identity=conn_id) time.sleep(1) num_transfers = self._get_transfer_frame_count(conn_id) @@ -298,7 +298,7 @@ def test_inter_router_protocol_trace(self): self.assertEqual(num_transfers_after_update, num_transfers) # Turn on trace logging for the inter-router connection - qd_manager.update("org.apache.qpid.dispatch.connection", {"enableProtocolTrace": "yes"}, identity=conn_id) + qd_manager.update("io.skupper.router.connection", {"enableProtocolTrace": "yes"}, identity=conn_id) # Create a receiver and make sure the MAU update is NOT seen on the inter-router connection log TEST_ADDR_2 = "EnableConnectionLevelProtocolTraceTest2" @@ -338,7 +338,7 @@ def test_enable_protocol_trace_on_non_existent_connection(self): try: # Turn on trace logging for connection with invalid or non-existent identity - outs = qd_manager.update("org.apache.qpid.dispatch.connection", {"enableProtocolTrace": "true"}, identity='G10000') + outs = qd_manager.update("io.skupper.router.connection", {"enableProtocolTrace": "true"}, identity='G10000') except Exception as e: if "BadRequestStatus" in str(e): bad_request = True @@ -349,7 +349,7 @@ def test_single_connection_protocol_trace(self): qd_manager = QdManager(self.address) # Turn off trace logging on all connections. - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "info+"}, + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/DEFAULT") TEST_ADDR_1 = "EnableConnectionLevelProtocolTraceTest1" @@ -365,14 +365,14 @@ def test_single_connection_protocol_trace(self): container_2.container_id = CONTAINER_ID_2 conn_2 = BlockingConnection(self.address, container=container_2) - results = qd_manager.query("org.apache.qpid.dispatch.connection") + results = qd_manager.query("io.skupper.router.connection") conn_id = None for result in results: if result['container'] == CONTAINER_ID_1: conn_id = result['identity'] # Turn on trace logging for connection with identity conn_id - qd_manager.update("org.apache.qpid.dispatch.connection", {"enableProtocolTrace": "true"}, identity=conn_id) + qd_manager.update("io.skupper.router.connection", {"enableProtocolTrace": "true"}, identity=conn_id) blocking_receiver_1 = conn_1.create_receiver(address=TEST_ADDR_1) blocking_sender_1 = conn_1.create_sender(address=TEST_ADDR_1, options=apply_options) @@ -398,7 +398,7 @@ def test_single_connection_protocol_trace(self): self.assertTrue(num_attaches_2 == 0) # Now turn off the connection tracing on that connection - qd_manager.update("org.apache.qpid.dispatch.connection", + qd_manager.update("io.skupper.router.connection", {"enableProtocolTrace": "off"}, identity=conn_id) blocking_receiver_1.close() @@ -469,8 +469,8 @@ def test_01_toggle_default_trace_logging(self): # num_attaches for address TEST_ADDR must be 4, two attaches to/from sender and receiver self.assertTrue(num_attaches == 4) - # STEP 2: Turn off trace logging using qdmanage - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "info+"}, name="log/DEFAULT") + # STEP 2: Turn off trace logging using skmanage + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/DEFAULT") # Step 3: Now, router trace logging is turned off (has been set to info+) # Create the sender and receiver again on a different address and make @@ -492,7 +492,7 @@ def test_01_toggle_default_trace_logging(self): # STEP 4: Tuen trace logging back on again and make sure num_attaches = 4 TEST_ADDR = "apachetest3" - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "trace+"}, name="log/DEFAULT") + qd_manager.update("io.skupper.router.log", {"enable": "trace+"}, name="log/DEFAULT") self.create_sender_receiver(TEST_ADDR, hello_world_3, blocking_connection) # STEP 3: Count the number of attaches for address TEST_ADDR, there should be 4 @@ -534,9 +534,9 @@ def test_02_toggle_server_trace_logging(self): # for the PROTOCOL module and make sure it works. qd_manager = QdManager(self.address) # Set log level to info+ on the DEFAULT module - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "info+"}, name="log/DEFAULT") + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/DEFAULT") # Set log level to trace+ on the PROTOCOL module - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "trace+"}, name="log/PROTOCOL") + qd_manager.update("io.skupper.router.log", {"enable": "trace+"}, name="log/PROTOCOL") blocking_connection = BlockingConnection(self.address) self.create_sender_receiver(TEST_ADDR, hello_world_5, @@ -553,7 +553,7 @@ def test_02_toggle_server_trace_logging(self): self.assertTrue(num_attaches == 4) TEST_ADDR = "apachetest6" - qd_manager.update("org.apache.qpid.dispatch.log", {"enable": "info+"}, name="log/PROTOCOL") + qd_manager.update("io.skupper.router.log", {"enable": "info+"}, name="log/PROTOCOL") self.create_sender_receiver(TEST_ADDR, hello_world_6, blocking_connection) diff --git a/tests/system_tests_log_message_components.py b/tests/system_tests_log_message_components.py index 351f8cf9d..e901b3f52 100644 --- a/tests/system_tests_log_message_components.py +++ b/tests/system_tests_log_message_components.py @@ -24,7 +24,7 @@ from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch_internal.compat import BINARY +from skupper_router_internal.compat import BINARY from system_test import TestCase, Qdrouterd, Process, TIMEOUT from system_test import unittest @@ -37,9 +37,9 @@ class RouterMessageLogTestBase(TestCase): - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), @@ -93,7 +93,7 @@ def test_log_message_all(self): everything_ok = False - logs = json.loads(self.run_qdmanage("get-log")) + logs = json.loads(self.run_skmanage("get-log")) message_logs = [log for log in logs if log[0] == 'MESSAGE'] self.assertTrue(message_logs) test_message = [log for log in message_logs if "message-id=\"123455\"" in log[2]] @@ -141,7 +141,7 @@ def test_log_message_none(self): self.assertTrue(test.message_received) everything_ok = True - logs = json.loads(self.run_qdmanage("get-log")) + logs = json.loads(self.run_skmanage("get-log")) for log in logs: if log[0] == 'MESSAGE': everything_ok = False @@ -175,7 +175,7 @@ def test_log_message_some(self): self.assertTrue(test.message_received) everything_ok = False - logs = json.loads(self.run_qdmanage("get-log")) + logs = json.loads(self.run_skmanage("get-log")) message_logs = [log for log in logs if log[0] == 'MESSAGE'] self.assertTrue(message_logs) test_message = [log for log in message_logs if diff --git a/tests/system_tests_management.py b/tests/system_tests_management.py index 2ad4f8b0f..830368650 100644 --- a/tests/system_tests_management.py +++ b/tests/system_tests_management.py @@ -28,17 +28,17 @@ from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch.management.client import Node, Url -from qpid_dispatch.management.error import ManagementError, BadRequestStatus, NotImplementedStatus, NotFoundStatus -from qpid_dispatch_internal.management.qdrouter import QdSchema -from qpid_dispatch_internal.compat import dictify -from qpid_dispatch_internal.compat import BINARY +from skupper_router.management.client import Node, Url +from skupper_router.management.error import ManagementError, BadRequestStatus, NotImplementedStatus, NotFoundStatus +from skupper_router_internal.management.qdrouter import QdSchema +from skupper_router_internal.compat import dictify +from skupper_router_internal.compat import BINARY import system_test from system_test import Qdrouterd, Process from system_test import unittest -PREFIX = 'org.apache.qpid.dispatch.' +PREFIX = 'io.skupper.router.' MANAGEMENT = PREFIX + 'management' CONFIGURATION = PREFIX + 'configurationEntity' OPERATIONAL = PREFIX + 'operationalEntity' @@ -220,7 +220,7 @@ def test_log(self): 'outputFile': 'logrouter.log', 'includeSource': True, 'includeTimestamp': True, - 'type': 'org.apache.qpid.dispatch.log'}) + 'type': 'io.skupper.router.log'}) def check_log(log, error=True, debug=False): """Cause an error and check for expected error and debug logs""" @@ -377,7 +377,7 @@ def test_link(self): def test_connection(self): """Verify there is at least one connection""" - response = self.node.query(type='org.apache.qpid.dispatch.connection') + response = self.node.query(type='io.skupper.router.connection') self.assertTrue(response.results) def test_router(self): @@ -398,7 +398,7 @@ def check(attrs): name = attrs['id'] self.assertEqual(attrs['identity'], 'router.node/%s' % name) self.assertEqual(attrs['name'], 'router.node/%s' % name) - self.assertEqual(attrs['type'], 'org.apache.qpid.dispatch.router.node') + self.assertEqual(attrs['type'], 'io.skupper.router.router.node') self.assertEqual(attrs['address'], 'amqp:/_topo/0/%s' % name) return name @@ -415,7 +415,7 @@ def test_entity_names(self): if e.type == MANAGEMENT: self.assertEqual(e.identity, "self") else: - if e.type == 'org.apache.qpid.dispatch.connection': + if e.type == 'io.skupper.router.connection': # This will make sure that the identity of the connection object is always numeric self.assertRegex(str(e.identity), "[1-9]+", e) else: diff --git a/tests/system_tests_multicast.py b/tests/system_tests_multicast.py index 83208cead..ec69e552b 100644 --- a/tests/system_tests_multicast.py +++ b/tests/system_tests_multicast.py @@ -178,12 +178,12 @@ def _get_alloc_stats(self, router, stats): # u'qd_buffer_t', u'batchesRebalancedToThreads': int32(736), # u'totalFreeToHeap': int32(0), u'totalAllocFromHeap': int32(2816), # u'localFreeListMax': int32(128), u'type': - # u'org.apache.qpid.dispatch.allocator', u'identity': + # u'io.skupper.router.allocator', u'identity': # u'allocator/qd_buffer_t', u'name': u'allocator/qd_buffer_t'}] d = dict() mgmt = router.management - atype = 'org.apache.qpid.dispatch.allocator' + atype = 'io.skupper.router.allocator' q = mgmt.query(type=atype).get_dicts() for name in stats: d[name] = next(a for a in q if a['typeName'] == name) @@ -621,7 +621,7 @@ def run(self): clean = True for cfg in self.config: mgmt = cfg['router'].management - atype = 'org.apache.qpid.dispatch.router.address' + atype = 'io.skupper.router.router.address' addrs = mgmt.query(type=atype).get_dicts() if any(self.topic in a['name'] for a in addrs): clean = False diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py index fe8937152..4c91d264b 100644 --- a/tests/system_tests_one_router.py +++ b/tests/system_tests_one_router.py @@ -27,7 +27,7 @@ from proton.utils import BlockingConnection, SyncRequestResponse from proton.reactor import Container, AtMostOnce, AtLeastOnce -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, DIR, Process, unittest, QdManager, TestTimeout @@ -59,7 +59,7 @@ def test_49_add_interrouter_connector_to_standalone_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.connector", + out = mgmt.create("io.skupper.router.connector", {"host": "0.0.0.0", "port": "77777", "role": "inter-router"}) @@ -78,7 +78,7 @@ def test_50_add_edge_listener_to_standalone_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.listener", + out = mgmt.create("io.skupper.router.listener", {"host": "0.0.0.0", "port": "77777", "role": "edge", @@ -98,7 +98,7 @@ def test_51_add_interrouter_listener_to_standalone_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.listener", + out = mgmt.create("io.skupper.router.listener", {"host": "0.0.0.0", "port": "77777", "role": "inter-router", @@ -131,7 +131,7 @@ def test_52_add_interrouter_connector_to_edge_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.connector", + out = mgmt.create("io.skupper.router.connector", {"host": "0.0.0.0", "port": "77777", "role": "inter-router"}) @@ -150,7 +150,7 @@ def test_53_add_edge_listener_to_edge_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.listener", + out = mgmt.create("io.skupper.router.listener", {"host": "0.0.0.0", "port": "77777", "role": "edge", @@ -170,7 +170,7 @@ def test_54_add_interrouter_listener_to_edge_router(self): mgmt = QdManager(address=self.router.addresses[0]) test_pass = False try: - out = mgmt.create("org.apache.qpid.dispatch.listener", + out = mgmt.create("io.skupper.router.listener", {"host": "0.0.0.0", "port": "77777", "role": "inter-router", @@ -340,9 +340,9 @@ def setUpClass(cls): cls.out_strip_addr = cls.router.addresses[3] cls.in_strip_addr = cls.router.addresses[4] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address, '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address, '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -424,7 +424,7 @@ def test_09_message_annotations(self) : self.assertIsNone(test.error) # Tests stripping of ingress and egress annotations. - # There is a property in qdrouter.json called stripAnnotations with possible values of ["in", "out", "both", "no"] + # There is a property in skrouter.json called stripAnnotations with possible values of ["in", "out", "both", "no"] # The default for stripAnnotations is "both" (which means strip annotations on both ingress and egress) # This test will test the stripAnnotations = no option - meaning no annotations must be stripped. # We will send in a custom annotation and make sure that we get back 3 annotations on the received message @@ -593,7 +593,7 @@ def test_37_connection_properties_unicode_string(self): node = Node.connect(self.router.addresses[0]) - results = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['properties']).results + results = node.query(type='io.skupper.router.connection', attribute_names=['properties']).results found = False for result in results: @@ -616,7 +616,7 @@ def test_38_connection_properties_symbols(self): node = Node.connect(self.router.addresses[0]) - results = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['properties']).results + results = node.query(type='io.skupper.router.connection', attribute_names=['properties']).results found = False for result in results: @@ -646,7 +646,7 @@ def test_42_unsettled_large_message_test(self): def test_43_dropped_presettled_receiver_stops(self): local_node = Node.connect(self.address, timeout=TIMEOUT) - res = local_node.query('org.apache.qpid.dispatch.router') + res = local_node.query('io.skupper.router.router') presettled_dropped_count_index = res.attribute_names.index('droppedPresettledDeliveries') presettled_dropped_count = res.results[0][presettled_dropped_count_index] test = DroppedPresettledTest(self.address, 200, presettled_dropped_count) @@ -664,7 +664,7 @@ def test_44_delete_connection_fail(self): connection = BlockingConnection(self.address, properties=CONNECTION_PROPERTIES_UNICODE_STRING) query_command = 'QUERY --type=connection' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) identity = None passed = False @@ -672,14 +672,14 @@ def test_44_delete_connection_fail(self): if output.get('properties'): conn_properties = output['properties'] # Find the connection that has our properties - CONNECTION_PROPERTIES_UNICODE_STRING - # Delete that connection and run another qdmanage to see + # Delete that connection and run another skmanage to see # if the connection is gone. if conn_properties.get('int_property'): identity = output.get("identity") if identity: update_command = 'UPDATE --type=connection adminStatus=deleted --id=' + identity try: - outputs = json.loads(self.run_qdmanage(update_command)) + outputs = json.loads(self.run_skmanage(update_command)) except Exception as e: if "Forbidden" in str(e): passed = True @@ -772,15 +772,15 @@ def response(self, msg): return Entity(ap['statusCode'], ap['statusDescription'], msg.body) def read_address(self, name): - ap = {'operation': 'READ', 'type': 'org.apache.qpid.dispatch.router.address', 'name': name} + ap = {'operation': 'READ', 'type': 'io.skupper.router.router.address', 'name': name} return Message(properties=ap, reply_to=self.reply_addr) def query_addresses(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router.address'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router.address'} return Message(properties=ap, reply_to=self.reply_addr) def query_links(self): - ap = {'operation': 'QUERY', 'type': 'org.apache.qpid.dispatch.router.link'} + ap = {'operation': 'QUERY', 'type': 'io.skupper.router.router.link'} return Message(properties=ap, reply_to=self.reply_addr) @@ -1205,13 +1205,13 @@ def run(self): def on_message(self, event): if event.receiver == self.receiver: if event.message.properties['statusCode'] == 200: - if 'org.apache.qpid.dispatch.router' in event.message.body.keys(): + if 'io.skupper.router.router' in event.message.body.keys(): if len(event.message.body.keys()) > 2: self.bail(None) else: self.bail('size of keys in message body less than or equal 2') else: - self.bail('org.apache.qpid.dispatch.router is not in the keys') + self.bail('io.skupper.router.router is not in the keys') else: self.bail("The return status code is %s. It should be 200" % str(event.message.properties['statusCode'])) @@ -1295,7 +1295,7 @@ def addr_text(self, addr): def on_timer_task(self, event): local_node = Node.connect(self.parent.address, timeout=TIMEOUT) - res = local_node.query('org.apache.qpid.dispatch.router.address') + res = local_node.query('io.skupper.router.router.address') name = res.attribute_names.index('name') found = False for results in res.results: @@ -1454,7 +1454,7 @@ def __init__(self, parent): def on_timer_task(self, event): self.num_tries += 1 local_node = Node.connect(self.parent.addr, timeout=TIMEOUT) - res = local_node.query('org.apache.qpid.dispatch.router.link') + res = local_node.query('io.skupper.router.router.link') owning_addr_index = res.attribute_names.index('owningAddr') has_address = False for out in res.results: @@ -1486,7 +1486,7 @@ def __init__(self, parent): def on_timer_task(self, event): self.num_tries += 1 local_node = Node.connect(self.parent.addr, timeout=TIMEOUT) - res = local_node.query('org.apache.qpid.dispatch.router') + res = local_node.query('io.skupper.router.router') presettled_deliveries_dropped_index = res.attribute_names.index('droppedPresettledDeliveries') presettled_dropped_count = res.results[0][presettled_deliveries_dropped_index] @@ -2928,7 +2928,7 @@ def __init__(self, parent, lastDlv=None, uptime=0): def on_timer_task(self, event): local_node = Node.connect(self.parent.address, timeout=TIMEOUT) - result = local_node.query('org.apache.qpid.dispatch.connection') + result = local_node.query('io.skupper.router.connection') container_id_index = result.attribute_names.index('container') uptime_seconds_index = result.attribute_names.index('uptimeSeconds') last_dlv_seconds_index = result.attribute_names.index('lastDlvSeconds') @@ -3094,7 +3094,7 @@ def __init__(self, address): def get_modified_deliveries(self) : local_node = Node.connect(self.address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') pos = outs.attribute_names.index("modifiedDeliveries") results = outs.results[0] n_modified_deliveries = results[pos] @@ -3218,7 +3218,7 @@ def __init__(self, address): def check_if_done(self): if self.n_settled == self.count: local_node = Node.connect(self.address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') pos = outs.attribute_names.index("acceptedDeliveries") results = outs.results[0] if results[pos] >= self.count: @@ -3278,7 +3278,7 @@ def __init__(self, address): def count_rejects(self) : local_node = Node.connect(self.address, timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') pos = outs.attribute_names.index("rejectedDeliveries") results = outs.results[0] return results[pos] @@ -3522,7 +3522,7 @@ def run(self): clean = False while not clean: clean = True - atype = 'org.apache.qpid.dispatch.router.address' + atype = 'io.skupper.router.router.address' addrs = self.router.management.query(type=atype).get_dicts() if any("dispatch-1330" in a['name'] for a in addrs): clean = False diff --git a/tests/system_tests_open_properties.py b/tests/system_tests_open_properties.py index f089ef395..77d529861 100644 --- a/tests/system_tests_open_properties.py +++ b/tests/system_tests_open_properties.py @@ -197,7 +197,7 @@ def test_02_verify_connector_properties(self): class OpenPropertiesQdManageTest(TestCase): """ - Tests creating openProperties via qdmanage tool + Tests creating openProperties via skmanage tool """ def _valid_properties_check(self, client_class): @@ -264,7 +264,7 @@ def _valid_properties_check(self, client_class): 'openProperties': op}) - cmd = "CREATE --type=org.apache.qpid.dispatch.%s --stdin" % client_class.entity + cmd = "CREATE --type=io.skupper.router.%s --stdin" % client_class.entity output = QdManager()(cmd=cmd, address=router.addresses[0], input=input, @@ -476,7 +476,7 @@ def setUpClass(cls): cls.RouterA.wait_ready() mgmt = cls.RouterA.management while True: - results = mgmt.query(type='org.apache.qpid.dispatch.connection', + results = mgmt.query(type='io.skupper.router.connection', attribute_names=['container']).get_dicts() if len([c for c in results if c['container'] == 'RouterB']): break diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py index 94cea20ff..6f9c5b0f7 100644 --- a/tests/system_tests_policy.py +++ b/tests/system_tests_policy.py @@ -33,7 +33,7 @@ from proton.reactor import Container, ReceiverOption from proton.utils import BlockingConnection, LinkDetached, SyncRequestResponse -from qpid_dispatch_internal.policy.policy_util import is_ipv6_enabled +from skupper_router_internal.policy.policy_util import is_ipv6_enabled from test_broker import FakeBroker @@ -56,9 +56,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -93,7 +93,7 @@ def test_verify_maximum_connections(self): bc1.close() bc2.close() - policystats = json.loads(self.run_qdmanage('query --type=policy')) + policystats = json.loads(self.run_skmanage('query --type=policy')) self.assertTrue(policystats[0]["connectionsDenied"] == 1) self.assertTrue(policystats[0]["totalDenials"] == 1) @@ -102,7 +102,7 @@ class LoadPolicyFromFolder(TestCase): """ Verify that specifying a policy folder from the router conf file effects loading the policies in that folder. - This test relies on qdmanage utility. + This test relies on skmanage utility. """ @classmethod def setUpClass(cls): @@ -136,9 +136,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -151,7 +151,7 @@ def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): def test_verify_policies_are_loaded(self): addr = self.address() - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) def new_policy(self): @@ -209,12 +209,12 @@ def updated_policy(self): def test_verify_policy_add_update_delete(self): # verify current vhost count - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) # create - self.run_qdmanage('create --type=vhost --name=dispatch-494 --stdin', input=self.new_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('create --type=vhost --name=dispatch-494 --stdin', input=self.new_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -227,8 +227,8 @@ def test_verify_policy_add_update_delete(self): self.assertTrue(found) # update - self.run_qdmanage('update --type=vhost --name=dispatch-494 --stdin', input=self.updated_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('update --type=vhost --name=dispatch-494 --stdin', input=self.updated_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -241,8 +241,8 @@ def test_verify_policy_add_update_delete(self): self.assertTrue(found) # delete - self.run_qdmanage('delete --type=vhost --name=dispatch-494') - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('delete --type=vhost --name=dispatch-494') + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) absent = True for ruleset in rulesets: @@ -253,12 +253,12 @@ def test_verify_policy_add_update_delete(self): def test_repeated_create_delete(self): for i in range(0, 10): - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) # create - self.run_qdmanage('create --type=vhost --name=dispatch-494 --stdin', input=self.new_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('create --type=vhost --name=dispatch-494 --stdin', input=self.new_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -268,8 +268,8 @@ def test_repeated_create_delete(self): self.assertTrue(found) # delete - self.run_qdmanage('delete --type=vhost --name=dispatch-494') - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('delete --type=vhost --name=dispatch-494') + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) absent = True for ruleset in rulesets: @@ -369,7 +369,7 @@ class PolicyVhostOverride(TestCase): Verify that specific vhost and global denial counts are propagated. This test conveniently forces the vhost denial statistics to be on a named vhost and we know where to find them. - This test relies on qdmanage utility. + This test relies on skmanage utility. """ @classmethod def setUpClass(cls): @@ -387,9 +387,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -416,7 +416,7 @@ def test_verify_n_receivers(self): br1.close() - vhoststats = json.loads(self.run_qdmanage('query --type=vhostStats')) + vhoststats = json.loads(self.run_skmanage('query --type=vhostStats')) foundStat = False for vhs in vhoststats: if vhs["hostname"] == "override.host.com": @@ -426,7 +426,7 @@ def test_verify_n_receivers(self): break self.assertTrue(foundStat, msg="did not find virtual host id 'override.host.com' in stats") - policystats = json.loads(self.run_qdmanage('query --type=policy')) + policystats = json.loads(self.run_skmanage('query --type=policy')) self.assertTrue(policystats[0]["linksDenied"] == 1) self.assertTrue(policystats[0]["totalDenials"] == 1) @@ -444,7 +444,7 @@ def test_verify_n_senders(self): bs1.close() - vhoststats = json.loads(self.run_qdmanage('query --type=vhostStats')) + vhoststats = json.loads(self.run_skmanage('query --type=vhostStats')) foundStat = False for vhs in vhoststats: if vhs["hostname"] == "override.host.com": @@ -454,7 +454,7 @@ def test_verify_n_senders(self): break self.assertTrue(foundStat, msg="did not find virtual host id 'override.host.com' in stats") - policystats = json.loads(self.run_qdmanage('query --type=policy')) + policystats = json.loads(self.run_skmanage('query --type=policy')) self.assertTrue(policystats[0]["linksDenied"] == 2) self.assertTrue(policystats[0]["totalDenials"] == 2) @@ -471,7 +471,7 @@ class PolicyTerminusCapabilities(TestCase): """ Verify that specifying a policy folder from the router conf file effects loading the policies in that folder. - This test relies on qdmanage utility. + This test relies on skmanage utility. """ @classmethod def setUpClass(cls): @@ -542,7 +542,7 @@ class VhostPolicyNameField(TestCase): """ Verify that vhosts can be created getting the name from 'id' or from 'hostname'. - This test relies on qdmanage utility. + This test relies on skmanage utility. """ @classmethod def setUpClass(cls): @@ -576,9 +576,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -697,12 +697,12 @@ def neither_policy(self): def test_01_id_vs_hostname(self): # verify current vhost count - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 5) # create using 'id' - self.run_qdmanage('create --type=vhost --name=dispatch-918 --stdin', input=self.id_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('create --type=vhost --name=dispatch-918 --stdin', input=self.id_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -713,8 +713,8 @@ def test_01_id_vs_hostname(self): self.assertTrue(found) # update using 'hostname' - self.run_qdmanage('update --type=vhost --name=dispatch-918 --stdin', input=self.hostname_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('update --type=vhost --name=dispatch-918 --stdin', input=self.hostname_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -726,15 +726,15 @@ def test_01_id_vs_hostname(self): # update 'id' and 'hostname' try: - self.run_qdmanage('update --type=vhost --name=dispatch-918 --stdin', + self.run_skmanage('update --type=vhost --name=dispatch-918 --stdin', input=self.both_policy()) self.assertTrue(False) # should not be able to update 'id' except Exception as e: pass # update using neither - self.run_qdmanage('update --type=vhost --name=dispatch-918 --stdin', input=self.neither_policy()) - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + self.run_skmanage('update --type=vhost --name=dispatch-918 --stdin', input=self.neither_policy()) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 6) found = False for ruleset in rulesets: @@ -777,9 +777,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -930,16 +930,16 @@ def test_link_name_parse_tree_patterns(self): # update to replace source/target match patterns qdm_out = "" try: - qdm_out = self.run_qdmanage('update --type=vhost --name=vhost/$default --stdin', input=self.default_patterns()) + qdm_out = self.run_skmanage('update --type=vhost --name=vhost/$default --stdin', input=self.default_patterns()) except Exception as e: - self.assertTrue(False, msg=('Error running qdmanage %s' % str(e))) + self.assertTrue(False, msg=('Error running skmanage %s' % str(e))) self.assertNotIn("PolicyError", qdm_out) # attempt an create that should be rejected qdm_out = "" exception = False try: - qdm_out = self.run_qdmanage('create --type=vhost --name=DISPATCH-1993-2 --stdin', input=self.disallowed_source()) + qdm_out = self.run_skmanage('create --type=vhost --name=DISPATCH-1993-2 --stdin', input=self.disallowed_source()) except Exception as e: exception = True self.assertIn("InternalServerErrorStatus: PolicyError: Policy 'DISPATCH-1993-2' is invalid:", str(e)) @@ -949,7 +949,7 @@ def test_link_name_parse_tree_patterns(self): qdm_out = "" exception = False try: - qdm_out = self.run_qdmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_target()) + qdm_out = self.run_skmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_target()) except Exception as e: exception = True self.assertIn("InternalServerErrorStatus: PolicyError: Policy 'DISPATCH-1993-3' is invalid:", str(e)) @@ -959,7 +959,7 @@ def test_link_name_parse_tree_patterns(self): qdm_out = "" exception = False try: - qdm_out = self.run_qdmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_source_pattern1()) + qdm_out = self.run_skmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_source_pattern1()) except Exception as e: exception = True self.assertIn("InternalServerErrorStatus: PolicyError:", str(e)) @@ -970,7 +970,7 @@ def test_link_name_parse_tree_patterns(self): qdm_out = "" exception = False try: - qdm_out = self.run_qdmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_source_pattern2()) + qdm_out = self.run_skmanage('create --type=vhost --name=DISPATCH-1993-3 --stdin', input=self.disallowed_source_pattern2()) except Exception as e: exception = True self.assertIn("InternalServerErrorStatus: PolicyError:", str(e)) @@ -1003,9 +1003,9 @@ def setUpClass(cls): def address(self): return self.router.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', re.sub(r'amqp://', 'amqp://u1:password@', self.address()), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -1042,15 +1042,15 @@ def disallowed_hostname(self): """ def test_hostname_pattern_00_hello(self): - rulesets = json.loads(self.run_qdmanage('query --type=vhost')) + rulesets = json.loads(self.run_skmanage('query --type=vhost')) self.assertEqual(len(rulesets), 1) def test_hostname_pattern_01_denied_add(self): qdm_out = "" try: - qdm_out = self.run_qdmanage('create --type=vhost --name=#.#.0.0 --stdin', input=self.disallowed_hostname()) + qdm_out = self.run_skmanage('create --type=vhost --name=#.#.0.0 --stdin', input=self.disallowed_hostname()) except Exception as e: - self.assertIn("pattern conflicts", str(e), msg=('Error running qdmanage %s' % str(e))) + self.assertIn("pattern conflicts", str(e), msg=('Error running skmanage %s' % str(e))) self.assertNotIn("222222", qdm_out) diff --git a/tests/system_tests_policy_oversize_compound.py b/tests/system_tests_policy_oversize_compound.py index 31b8c6fee..a76581557 100644 --- a/tests/system_tests_policy_oversize_compound.py +++ b/tests/system_tests_policy_oversize_compound.py @@ -741,9 +741,9 @@ def wait_router_network_connected(cls): cls.EA1.wait_connectors() cls.EB1.wait_connectors() - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), diff --git a/tests/system_tests_priority.py b/tests/system_tests_priority.py index d6e50631b..87155b772 100644 --- a/tests/system_tests_priority.py +++ b/tests/system_tests_priority.py @@ -22,7 +22,7 @@ from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch_internal.compat import UNICODE +from skupper_router_internal.compat import UNICODE from system_test import TestCase, Qdrouterd, main_module, unittest @@ -56,7 +56,7 @@ def __init__(self, reply_addr): def make_router_link_query(self) : props = {'count': '100', 'operation': 'QUERY', - 'entityType': 'org.apache.qpid.dispatch.router.link', + 'entityType': 'io.skupper.router.router.link', 'name': 'self', 'type': 'org.amqp.management' } diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py index 72d104c2b..b11a33066 100644 --- a/tests/system_tests_sasl_plain.py +++ b/tests/system_tests_sasl_plain.py @@ -22,7 +22,7 @@ from subprocess import PIPE, Popen from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT from system_test import unittest, QdManager -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from proton import SASL @@ -85,7 +85,7 @@ def setUpClass(cls): super(RouterTestPlainSaslFailure, cls).router('X', [ ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': x_listener_port, 'saslMechanisms': 'PLAIN', 'authenticatePeer': 'yes'}), - # This unauthenticated listener is for qdstat to connect to it. + # This unauthenticated listener is for skstat to connect to it. ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), 'authenticatePeer': 'no'}), ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), @@ -124,7 +124,7 @@ def setUpClass(cls): @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test") def test_inter_router_sasl_fail(self): passed = False - long_type = 'org.apache.qpid.dispatch.connection' + long_type = 'io.skupper.router.connection' qd_manager = QdManager(address=self.routers[1].addresses[0]) connections = qd_manager.query(long_type) for connection in connections: @@ -180,7 +180,7 @@ def setUpClass(cls): super(RouterTestPlainSaslFailureUsingLiteral, cls).router('X', [ ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': x_listener_port, 'saslMechanisms': 'PLAIN', 'authenticatePeer': 'yes'}), - # This unauthenticated listener is for qdstat to connect to it. + # This unauthenticated listener is for skstat to connect to it. ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), 'authenticatePeer': 'no'}), ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), @@ -219,7 +219,7 @@ def setUpClass(cls): @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test") def test_inter_router_sasl_fail(self): passed = False - long_type = 'org.apache.qpid.dispatch.connection' + long_type = 'io.skupper.router.connection' qd_manager = QdManager(address=self.routers[1].addresses[0]) connections = qd_manager.query(long_type) @@ -269,7 +269,7 @@ def setUpClass(cls): super(RouterTestPlainSasl, cls).router('X', [ ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': x_listener_port, 'saslMechanisms': 'PLAIN', 'authenticatePeer': 'yes'}), - # This unauthenticated listener is for qdstat to connect to it. + # This unauthenticated listener is for skstat to connect to it. ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), 'authenticatePeer': 'no'}), ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), @@ -300,7 +300,7 @@ def test_inter_router_plain_exists(self): """ Check authentication of inter-router link is PLAIN. - This test makes executes a qdstat -c via an unauthenticated listener to + This test makes executes a skstat -c via an unauthenticated listener to QDR.X and makes sure that the output has an "inter-router" connection to QDR.Y whose authentication is PLAIN. This ensures that QDR.Y did not somehow use SASL ANONYMOUS to connect to QDR.X @@ -308,44 +308,44 @@ def test_inter_router_plain_exists(self): """ p = self.popen( - ['qdstat', '-b', str(self.routers[0].addresses[1]), '-c'], - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + ['skstat', '-b', str(self.routers[0].addresses[1]), '-c'], + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) self.assertIn("inter-router", out) self.assertIn("test@domain.com(PLAIN)", out) @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test") - def test_qdstat_connect_sasl(self): + def test_skstat_connect_sasl(self): """ - Make qdstat use sasl plain authentication. + Make skstat use sasl plain authentication. """ p = self.popen( - ['qdstat', '-b', str(self.routers[0].addresses[2]), '-c', '--sasl-mechanisms=PLAIN', + ['skstat', '-b', str(self.routers[0].addresses[2]), '-c', '--sasl-mechanisms=PLAIN', '--sasl-username=test@domain.com', '--sasl-password=password'], - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) split_list = out.split() # There will be 2 connections that have authenticated using SASL PLAIN. One inter-router connection - # and the other connection that this qdstat client is making + # and the other connection that this skstat client is making self.assertEqual(2, split_list.count("test@domain.com(PLAIN)")) self.assertEqual(1, split_list.count("inter-router")) self.assertEqual(1, split_list.count("normal")) @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test") - def test_qdstat_connect_sasl_password_file(self): + def test_skstat_connect_sasl_password_file(self): """ - Make qdstat use sasl plain authentication with client password specified in a file. + Make skstat use sasl plain authentication with client password specified in a file. """ password_file = os.getcwd() + '/sasl-client-password-file.txt' # Create a SASL configuration file. @@ -355,19 +355,19 @@ def test_qdstat_connect_sasl_password_file(self): sasl_client_password_file.close() p = self.popen( - ['qdstat', '-b', str(self.routers[0].addresses[2]), '-c', '--sasl-mechanisms=PLAIN', + ['skstat', '-b', str(self.routers[0].addresses[2]), '-c', '--sasl-mechanisms=PLAIN', '--sasl-username=test@domain.com', '--sasl-password-file=' + password_file], - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) split_list = out.split() # There will be 2 connections that have authenticated using SASL PLAIN. One inter-router connection - # and the other connection that this qdstat client is making + # and the other connection that this skstat client is making self.assertEqual(2, split_list.count("test@domain.com(PLAIN)")) self.assertEqual(1, split_list.count("inter-router")) self.assertEqual(1, split_list.count("normal")) @@ -447,12 +447,12 @@ def setUpClass(cls): cls.routers[1].wait_router_connected('QDR.X') @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test") - def test_aaa_qdstat_connect_sasl_over_ssl(self): + def test_aaa_skstat_connect_sasl_over_ssl(self): """ - Make qdstat use sasl plain authentication over ssl. + Make skstat use sasl plain authentication over ssl. """ p = self.popen( - ['qdstat', '-b', str(self.routers[0].addresses[2]), '-c', + ['skstat', '-b', str(self.routers[0].addresses[2]), '-c', # The following are SASL args '--sasl-mechanisms=PLAIN', '--sasl-username=test@domain.com', @@ -463,17 +463,17 @@ def test_aaa_qdstat_connect_sasl_over_ssl(self): '--ssl-certificate=' + self.ssl_file('client-certificate.pem'), '--ssl-key=' + self.ssl_file('client-private-key.pem'), '--ssl-password=client-password'], - name='qdstat-' + self.id(), stdout=PIPE, expect=None, + name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] assert p.returncode == 0, \ - "qdstat exit status %s, output:\n%s" % (p.returncode, out) + "skstat exit status %s, output:\n%s" % (p.returncode, out) split_list = out.split() # There will be 2 connections that have authenticated using SASL PLAIN. One inter-router connection - # and the other connection that this qdstat client is making + # and the other connection that this skstat client is making self.assertEqual(2, split_list.count("test@domain.com(PLAIN)")) self.assertEqual(1, split_list.count("inter-router")) self.assertEqual(1, split_list.count("normal")) @@ -482,7 +482,7 @@ def test_aaa_qdstat_connect_sasl_over_ssl(self): def test_inter_router_plain_over_ssl_exists(self): """The setUpClass sets up two routers with SASL PLAIN enabled over TLS. - This test makes executes a query for type='org.apache.qpid.dispatch.connection' over + This test makes executes a query for type='io.skupper.router.connection' over an unauthenticated listener to QDR.X and makes sure that the output has an "inter-router" connection to QDR.Y whose authentication is PLAIN. This ensures that QDR.Y did not @@ -491,7 +491,7 @@ def test_inter_router_plain_over_ssl_exists(self): """ local_node = Node.connect(self.routers[0].addresses[1], timeout=TIMEOUT) - results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + results = local_node.query(type='io.skupper.router.connection').get_entities() # sslProto should be TLSv1.x self.assertIn('TLSv1', results[0].sslProto) @@ -539,7 +539,7 @@ def setUpClass(cls): ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': x_listener_port, 'sslProfile': 'server-ssl-profile', 'saslMechanisms': 'PLAIN', 'authenticatePeer': 'yes'}), - # This unauthenticated listener is for qdstat to connect to it. + # This unauthenticated listener is for skstat to connect to it. ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), 'authenticatePeer': 'no'}), ('sslProfile', {'name': 'server-ssl-profile', @@ -586,7 +586,7 @@ def test_no_inter_router_connection(self): due to setting 'verifyHostname': 'yes' """ local_node = Node.connect(self.routers[1].addresses[0], timeout=TIMEOUT) - results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + results = local_node.query(type='io.skupper.router.connection').get_entities() # There should be only two connections. # There will be no inter-router connection @@ -631,7 +631,7 @@ def setUpClass(cls): ('listener', {'host': '0.0.0.0', 'role': 'inter-router', 'port': x_listener_port, 'sslProfile': 'server-ssl-profile', 'saslMechanisms': 'PLAIN', 'authenticatePeer': 'yes'}), - # This unauthenticated listener is for qdstat to connect to it. + # This unauthenticated listener is for skstat to connect to it. ('listener', {'host': '0.0.0.0', 'role': 'normal', 'port': cls.tester.get_port(), 'authenticatePeer': 'no'}), ('sslProfile', {'name': 'server-ssl-profile', @@ -701,7 +701,7 @@ def test_inter_router_plain_over_ssl_exists(self): """ local_node = Node.connect(self.routers[1].addresses[0], timeout=TIMEOUT) - results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + results = local_node.query(type='io.skupper.router.connection').get_entities() self.common_asserts(results) @@ -712,11 +712,11 @@ def test_zzz_delete_create_ssl_profile(self): """ local_node = self.routers[1].management - connections = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + connections = local_node.query(type='io.skupper.router.connection').get_entities() self.assertIn("QDR.X", [c.container for c in connections]) # We can find the connection before local_node.delete(type='connector', name='connectorToX') local_node.delete(type='sslProfile', name='client-ssl-profile') - connections = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + connections = local_node.query(type='io.skupper.router.connection').get_entities() is_qdr_x = "QDR.X" in [c.container for c in connections] self.assertFalse(is_qdr_x) # Should not be present now @@ -739,7 +739,7 @@ def test_zzz_delete_create_ssl_profile(self): 'saslUsername': 'test@domain.com', 'saslPassword': 'password'}) self.routers[1].wait_connectors() - results = local_node.query(type='org.apache.qpid.dispatch.connection').get_entities() + results = local_node.query(type='io.skupper.router.connection').get_entities() self.common_asserts(results) diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_skmanage.py similarity index 79% rename from tests/system_tests_qdmanage.py rename to tests/system_tests_skmanage.py index 8d669364d..165991bde 100644 --- a/tests/system_tests_qdmanage.py +++ b/tests/system_tests_skmanage.py @@ -25,22 +25,22 @@ from proton.utils import BlockingConnection -from qpid_dispatch_internal.compat import dictify -from qpid_dispatch_internal.management.qdrouter import QdSchema +from skupper_router_internal.compat import dictify +from skupper_router_internal.management.qdrouter import QdSchema from system_test import unittest from system_test import Logger, TestCase, Process, Qdrouterd, main_module, TIMEOUT, DIR from system_test import QdManager -DUMMY = "org.apache.qpid.dispatch.dummy" +DUMMY = "io.skupper.router.dummy" CONNECTION_PROPERTIES_UNICODE_STRING = {'connection': 'properties', 'int_property': 6451} TOTAL_ENTITIES = 29 # for tests that check the total # of entities -class QdmanageTest(TestCase): - """Test qdmanage tool output""" +class SkmanageTest(TestCase): + """Test skmanage tool output""" @staticmethod def ssl_file(name): @@ -48,7 +48,7 @@ def ssl_file(name): @classmethod def setUpClass(cls): - super(QdmanageTest, cls).setUpClass() + super(SkmanageTest, cls).setUpClass() cls.inter_router_port = cls.tester.get_port() cls.secure_port = cls.tester.get_port() cls.secure_user_port = cls.tester.get_port() @@ -89,9 +89,9 @@ def setUpClass(cls): def address(self): return self.router_1.addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -116,7 +116,7 @@ def assert_entities_equal(self, expect, actual, copy=None): def test_crud(self): def check(cmd, expect, copy=None, **kwargs): - actual = json.loads(self.run_qdmanage(cmd)) + actual = json.loads(self.run_skmanage(cmd)) self.assert_entity_equal(expect, actual, copy=copy) expect = {'arg1': 'foo', 'type': DUMMY, 'name': 'mydummy2'} @@ -134,17 +134,17 @@ def check(cmd, expect, copy=None, **kwargs): # name outside attributes check('update name=mydummy arg1=xxx num1=888', expect) check('read --name=mydummy', expect) - self.run_qdmanage('delete --name mydummy') - self.run_qdmanage('read --name=mydummy', expect=Process.EXIT_FAIL) + self.run_skmanage('delete --name mydummy') + self.run_skmanage('read --name=mydummy', expect=Process.EXIT_FAIL) def test_stdin(self): """Test piping from stdin""" def check(cmd, expect, input, copy=None): - actual = json.loads(self.run_qdmanage(cmd + " --stdin", input=input)) + actual = json.loads(self.run_skmanage(cmd + " --stdin", input=input)) self.assert_entity_equal(expect, actual, copy=copy) def check_list(cmd, expect_list, input, copy=None): - actual = json.loads(self.run_qdmanage(cmd + " --stdin", input=input)) + actual = json.loads(self.run_skmanage(cmd + " --stdin", input=input)) self.assert_entities_equal(expect_list, actual, copy=copy) expect = {'type': DUMMY, 'name': 'mydummyx', 'arg1': 'foo'} @@ -165,21 +165,21 @@ def check_list(cmd, expect_list, input, copy=None): def test_query(self): def long_type(name): - return 'org.apache.qpid.dispatch.' + name + return 'io.skupper.router.' + name types = ['listener', 'log', 'router'] long_types = [long_type(name) for name in types] - qall = json.loads(self.run_qdmanage('query')) + qall = json.loads(self.run_skmanage('query')) qall_types = {e['type'] for e in qall} for t in long_types: self.assertIn(t, qall_types) - qlistener = json.loads(self.run_qdmanage('query --type=listener')) + qlistener = json.loads(self.run_skmanage('query --type=listener')) self.assertEqual([long_type('listener')] * 4, [e['type'] for e in qlistener]) self.assertEqual(self.router_1.ports[0], int(qlistener[0]['port'])) - qattr = json.loads(self.run_qdmanage('query type name')) + qattr = json.loads(self.run_skmanage('query type name')) for e in qattr: self.assertEqual(2, len(e)) @@ -191,57 +191,57 @@ def name_type(entities): def test_get_schema(self): schema = dictify(QdSchema().dump()) - actual = self.run_qdmanage("get-json-schema") + actual = self.run_skmanage("get-json-schema") self.assertEqual(schema, dictify(json.loads(actual))) - actual = self.run_qdmanage("get-schema") + actual = self.run_skmanage("get-schema") self.assertEqual(schema, dictify(json.loads(actual))) def test_get_annotations(self): """ - The qdmanage GET-ANNOTATIONS call must return an empty dict since we don't support annotations at the moment. + The skmanage GET-ANNOTATIONS call must return an empty dict since we don't support annotations at the moment. """ - out = json.loads(self.run_qdmanage("get-annotations")) + out = json.loads(self.run_skmanage("get-annotations")) self.assertTrue(len(out) == 0) def test_get_types(self): - out = json.loads(self.run_qdmanage("get-types")) + out = json.loads(self.run_skmanage("get-types")) self.assertEqual(len(out), TOTAL_ENTITIES) def test_get_attributes(self): - out = json.loads(self.run_qdmanage("get-attributes")) + out = json.loads(self.run_skmanage("get-attributes")) self.assertEqual(len(out), TOTAL_ENTITIES) def test_get_operations(self): - out = json.loads(self.run_qdmanage("get-operations")) + out = json.loads(self.run_skmanage("get-operations")) self.assertEqual(len(out), TOTAL_ENTITIES) - self.assertEqual(out['org.apache.qpid.dispatch.sslProfile'], ['CREATE', 'DELETE', 'READ']) + self.assertEqual(out['io.skupper.router.sslProfile'], ['CREATE', 'DELETE', 'READ']) def test_get_types_with_ssl_profile_type(self): - out = json.loads(self.run_qdmanage("get-types --type=org.apache.qpid.dispatch.sslProfile")) - self.assertEqual(out['org.apache.qpid.dispatch.sslProfile'], ['org.apache.qpid.dispatch.configurationEntity', 'org.apache.qpid.dispatch.entity']) + out = json.loads(self.run_skmanage("get-types --type=io.skupper.router.sslProfile")) + self.assertEqual(out['io.skupper.router.sslProfile'], ['io.skupper.router.configurationEntity', 'io.skupper.router.entity']) def test_get_ssl_profile_type_attributes(self): - out = json.loads(self.run_qdmanage('get-attributes --type=org.apache.qpid.dispatch.sslProfile')) + out = json.loads(self.run_skmanage('get-attributes --type=io.skupper.router.sslProfile')) self.assertEqual(len(out), 1) - self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 11) + self.assertEqual(len(out['io.skupper.router.sslProfile']), 11) def test_get_ssl_profile_attributes(self): - out = json.loads(self.run_qdmanage('get-attributes org.apache.qpid.dispatch.sslProfile')) + out = json.loads(self.run_skmanage('get-attributes io.skupper.router.sslProfile')) self.assertEqual(len(out), 1) - self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 11) + self.assertEqual(len(out['io.skupper.router.sslProfile']), 11) def test_get_ssl_profile_type_operations(self): - out = json.loads(self.run_qdmanage('get-operations --type=org.apache.qpid.dispatch.sslProfile')) + out = json.loads(self.run_skmanage('get-operations --type=io.skupper.router.sslProfile')) self.assertEqual(len(out), 1) - self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 3) + self.assertEqual(len(out['io.skupper.router.sslProfile']), 3) def test_get_ssl_profile_operations(self): - out = json.loads(self.run_qdmanage('get-operations org.apache.qpid.dispatch.sslProfile')) + out = json.loads(self.run_skmanage('get-operations io.skupper.router.sslProfile')) self.assertEqual(len(out), 1) - self.assertEqual(len(out['org.apache.qpid.dispatch.sslProfile']), 3) + self.assertEqual(len(out['io.skupper.router.sslProfile']), 3) def test_get_log(self): - logs = json.loads(self.run_qdmanage("get-log limit=20")) + logs = json.loads(self.run_skmanage("get-log limit=20")) found = False for log in logs: if 'get-log' in log[2] and ['AGENT', 'debug'] == log[0:2]: @@ -250,7 +250,7 @@ def test_get_log(self): def test_get_logstats(self): query_command = 'QUERY --type=logStats' - logs = json.loads(self.run_qdmanage(query_command)) + logs = json.loads(self.run_skmanage(query_command)) # Each value returned by the above query should be # a log, and each log should contain an entry for each # log level. @@ -283,27 +283,27 @@ def test_update(self): exception = False try: # Try to not set 'output' - json.loads(self.run_qdmanage("UPDATE --type org.apache.qpid.dispatch.log --name log/DEFAULT outputFile=")) + json.loads(self.run_skmanage("UPDATE --type io.skupper.router.log --name log/DEFAULT outputFile=")) except Exception as e: exception = True self.assertTrue("InternalServerErrorStatus: CError: Configuration: Failed to open log file ''" in str(e)) self.assertTrue(exception) # Set a valid 'output' - output = json.loads(self.run_qdmanage("UPDATE --type org.apache.qpid.dispatch.log --name log/DEFAULT " + output = json.loads(self.run_skmanage("UPDATE --type io.skupper.router.log --name log/DEFAULT " "enable=trace+ outputFile=A.log")) self.assertEqual("A.log", output['outputFile']) self.assertEqual("trace+", output['enable']) def create(self, type, name, port): create_command = 'CREATE --type=' + type + ' --name=' + name + ' host=0.0.0.0 port=' + port - connector = json.loads(self.run_qdmanage(create_command)) + connector = json.loads(self.run_skmanage(create_command)) return connector def test_check_address_name(self): - long_type = 'org.apache.qpid.dispatch.router.config.address' + long_type = 'io.skupper.router.router.config.address' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(len(output), 2) self.assertEqual(output[0]['name'], "test-address") self.assertEqual(output[0]['distribution'], "multicast") @@ -315,45 +315,45 @@ def test_check_address_name(self): self.assertNotIn('prefix', output[1]) def test_create_address(self): - long_type = 'org.apache.qpid.dispatch.router.config.address' + long_type = 'io.skupper.router.router.config.address' create_command = 'CREATE --type=' + long_type + ' pattern="a.b.#"' - output = json.loads(self.run_qdmanage(create_command)) + output = json.loads(self.run_skmanage(create_command)) self.assertEqual(output['pattern'], '"a.b.#"') def test_check_auto_link_name(self): - long_type = 'org.apache.qpid.dispatch.router.config.autoLink' + long_type = 'io.skupper.router.router.config.autoLink' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(output[0]['name'], "test-auto-link") self.assertEqual(output[0]['direction'], "out") self.assertEqual(output[0]['addr'], "mnop") def test_specify_container_id_connection_auto_link(self): - long_type = 'org.apache.qpid.dispatch.router.config.autoLink' + long_type = 'io.skupper.router.router.config.autoLink' create_command = 'CREATE --type=' + long_type + ' address=abc containerId=id1 connection=conn1 direction=out' - output = self.run_qdmanage(create_command, expect=Process.EXIT_FAIL) + output = self.run_skmanage(create_command, expect=Process.EXIT_FAIL) self.assertIn("Both connection and containerId cannot be specified", output) def test_create_delete_connector(self): - long_type = 'org.apache.qpid.dispatch.connector' + long_type = 'io.skupper.router.connector' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) name = output[0]['name'] # Delete an existing connector delete_command = 'DELETE --type=' + long_type + ' --name=' + name - self.run_qdmanage(delete_command) - output = json.loads(self.run_qdmanage(query_command)) + self.run_skmanage(delete_command) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(output, []) # Re-create the connector and then try wait_connectors - self.create(long_type, name, str(QdmanageTest.inter_router_port)) + self.create(long_type, name, str(SkmanageTest.inter_router_port)) - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) created = False for output in outputs: - conn_name = 'connector/127.0.0.1:%s' % QdmanageTest.inter_router_port - conn_name_1 = 'connector/0.0.0.0:%s' % QdmanageTest.inter_router_port + conn_name = 'connector/127.0.0.1:%s' % SkmanageTest.inter_router_port + conn_name_1 = 'connector/0.0.0.0:%s' % SkmanageTest.inter_router_port if conn_name == output['name'] or conn_name_1 == output['name']: created = True break @@ -364,19 +364,19 @@ def test_zzz_add_connector(self): port = self.get_port() # dont provide role and make sure that role is defaulted to 'normal' command = "CREATE --type=connector --name=eaconn1 port=" + str(port) + " host=0.0.0.0" - output = json.loads(self.run_qdmanage(command)) + output = json.loads(self.run_skmanage(command)) self.assertEqual("normal", output['role']) # provide the same connector name (eaconn1), expect duplicate value failure - self.assertRaises(Exception, self.run_qdmanage, + self.assertRaises(Exception, self.run_skmanage, "CREATE --type=connector --name=eaconn1 port=12345 host=0.0.0.0") port = self.get_port() # provide role as 'normal' and make sure that it is preserved command = "CREATE --type=connector --name=eaconn2 port=" + str(port) + " host=0.0.0.0 role=normal" - output = json.loads(self.run_qdmanage(command)) + output = json.loads(self.run_skmanage(command)) self.assertEqual("normal", output['role']) def test_zzz_create_delete_listener(self): - long_type = 'org.apache.qpid.dispatch.listener' + long_type = 'io.skupper.router.listener' name = 'ealistener' listener_port = self.get_port() @@ -388,12 +388,12 @@ def test_zzz_create_delete_listener(self): exception_occurred = False delete_command = 'DELETE --type=' + long_type + ' --name=' + name - self.run_qdmanage(delete_command) + self.run_skmanage(delete_command) exception_occurred = False try: # Try deleting an already deleted connector, this should raise an exception - self.run_qdmanage(delete_command) + self.run_skmanage(delete_command) except Exception as e: exception_occurred = True self.assertTrue(("NotFoundStatus: No entity with name=%s" % name) in str(e)) @@ -405,21 +405,21 @@ def test_create_delete_ssl_profile(self): ssl_create_command = 'CREATE --type=sslProfile certFile=' + self.ssl_file('server-certificate.pem') + \ ' privateKeyFile=' + self.ssl_file('server-private-key.pem') + ' password=server-password' + \ ' name=' + ssl_profile_name + ' caCertFile=' + self.ssl_file('ca-certificate.pem') - output = json.loads(self.run_qdmanage(ssl_create_command)) + output = json.loads(self.run_skmanage(ssl_create_command)) self.assertEqual(output['name'], ssl_profile_name) - self.run_qdmanage('DELETE --type=sslProfile --name=' + + self.run_skmanage('DELETE --type=sslProfile --name=' + ssl_profile_name) def test_delete_connection(self): """ - This test creates a blocking connection and tries to delete that connection using qdmanage DELETE operation. - Make sure we are Forbidden from deleting a connection because qdmanage DELETEs are not allowed on a connection - Only qdmanage UPDATEs are allowed.. + This test creates a blocking connection and tries to delete that connection using skmanage DELETE operation. + Make sure we are Forbidden from deleting a connection because skmanage DELETEs are not allowed on a connection + Only skmanage UPDATEs are allowed.. :return: """ connection = BlockingConnection(self.address(), properties=CONNECTION_PROPERTIES_UNICODE_STRING) query_command = 'QUERY --type=connection' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) identity = None passed = False for output in outputs: @@ -430,7 +430,7 @@ def test_delete_connection(self): if identity: delete_command = 'DELETE --type=connection --id=' + identity try: - outs = json.loads(self.run_qdmanage(delete_command)) + outs = json.loads(self.run_skmanage(delete_command)) except Exception as e: if "Forbidden" in str(e): passed = True @@ -444,7 +444,7 @@ def test_create_delete_address_pattern(self): ('*/mars/*/#', 'multicast'), ('*.mercury', 'closest'), ('*/#/pluto', 'multicast')] - long_type = 'org.apache.qpid.dispatch.router.config.address' + long_type = 'io.skupper.router.router.config.address' # add patterns: pcount = 0 @@ -453,12 +453,12 @@ def test_create_delete_address_pattern(self): ' pattern=' + p[0] + \ ' distribution=' + p[1] + \ ' name=Pattern' + str(pcount) - self.run_qdmanage(query_command) + self.run_skmanage(query_command) pcount += 1 # verify correctly added: query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) total = len(output) pcount = 0 @@ -476,12 +476,12 @@ def test_create_delete_address_pattern(self): for p in config: query_command = 'DELETE --type=' + long_type + \ ' --name=Pattern' + str(pcount) - self.run_qdmanage(query_command) + self.run_skmanage(query_command) pcount += 1 # verify deleted: query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(len(output), total - len(config)) for o in output: pattern = o.get('pattern') @@ -507,13 +507,13 @@ def test_yy_query_many_links(self): count += 1 # Try fetching all 10,000 addresses - # This qdmanage query command would fail without the fix + # This skmanage query command would fail without the fix # for DISPATCH-974 - query_command = 'QUERY --type=org.apache.qpid.dispatch.router.address' + query_command = 'QUERY --type=io.skupper.router.router.address' for i in range(3): sender_addresses = 0 receiver_addresses = 0 - outs = json.loads(self.run_qdmanage(query_command)) + outs = json.loads(self.run_skmanage(query_command)) for out in outs: if ADDRESS_SENDER in out['name']: sender_addresses += 1 @@ -532,7 +532,7 @@ def test_yy_query_many_links(self): for i in range(3): out_links = 0 in_links = 0 - outs = json.loads(self.run_qdmanage(query_command)) + outs = json.loads(self.run_skmanage(query_command)) for out in outs: if out.get('owningAddr'): if ADDRESS_SENDER in out['owningAddr']: @@ -559,9 +559,9 @@ def test_yy_query_many_links(self): self.assertEqual(in_links, COUNT) def test_worker_threads(self): - long_type = 'org.apache.qpid.dispatch.router' + long_type = 'io.skupper.router.router' qd_manager = QdManager(address=self.address()) - output = qd_manager.query('org.apache.qpid.dispatch.router') + output = qd_manager.query('io.skupper.router.router') self.assertEqual(output[0]['workerThreads'], 4) def test_check_memory_usage(self): @@ -569,9 +569,9 @@ def test_check_memory_usage(self): Verify that the process memory usage is present. Non-Linux platforms may return zero, so accept that as a valid value. """ - long_type = 'org.apache.qpid.dispatch.router' + long_type = 'io.skupper.router.router' query_command = 'QUERY --type=' + long_type - output = json.loads(self.run_qdmanage(query_command)) + output = json.loads(self.run_skmanage(query_command)) self.assertEqual(len(output), 1) mem = output[0].get('memoryUsage') @@ -585,34 +585,34 @@ def test_check_memory_usage(self): self.assertTrue(mem is None) def test_ssl_connection(self): - """Verify qdmanage can securely connect via SSL""" + """Verify skmanage can securely connect via SSL""" ssl_address = "amqps://localhost:%s" % self.secure_port ssl_user_address = "amqps://localhost:%s" % self.secure_user_port - query = 'QUERY --type org.apache.qpid.dispatch.router' + query = 'QUERY --type io.skupper.router.router' # this should fail: no trustfile with self.assertRaises(RuntimeError, msg="failure expected: no trustfile") as exc: - self.run_qdmanage(query, address=ssl_address) + self.run_skmanage(query, address=ssl_address) self.assertIn("certificate verify failed", str(exc.exception), "unexpected exception: %s" % str(exc.exception)) # this should pass: - self.run_qdmanage(query + " --ssl-trustfile " + + self.run_skmanage(query + " --ssl-trustfile " + self.ssl_file('ca-certificate.pem'), address=ssl_address) # this should fail: wrong hostname with self.assertRaises(RuntimeError, msg="failure expected: wrong hostname") as exc: - self.run_qdmanage(query + " --ssl-trustfile " + + self.run_skmanage(query + " --ssl-trustfile " + self.ssl_file('ca-certificate.pem'), address="amqps://127.0.0.1:%s" % self.secure_port) self.assertIn("certificate verify failed", str(exc.exception), "unexpected exception: %s" % str(exc.exception)) # this should pass: disable hostname check: - self.run_qdmanage(query + " --ssl-trustfile " + + self.run_skmanage(query + " --ssl-trustfile " + self.ssl_file('ca-certificate.pem') + " --ssl-disable-peer-name-verify", address="amqps://127.0.0.1:%s" % self.secure_port) @@ -620,14 +620,14 @@ def test_ssl_connection(self): # this should fail: router requires client to authenticate with self.assertRaises(RuntimeError, msg="client authentication should fail") as exc: - self.run_qdmanage(query + " --ssl-trustfile " + + self.run_skmanage(query + " --ssl-trustfile " + self.ssl_file('ca-certificate.pem'), address=ssl_user_address) self.assertIn("SSL Failure", str(exc.exception), "unexpected exception: %s" % str(exc.exception)) - # this should pass: qdmanage provides credentials - self.run_qdmanage(query + " --ssl-trustfile " + + # this should pass: skmanage provides credentials + self.run_skmanage(query + " --ssl-trustfile " + self.ssl_file('ca-certificate.pem') + " --ssl-certificate " + self.ssl_file('client-certificate.pem') + diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_skstat.py similarity index 84% rename from tests/system_tests_qdstat.py rename to tests/system_tests_skstat.py index f2e342e62..bdeaaa642 100644 --- a/tests/system_tests_qdstat.py +++ b/tests/system_tests_skstat.py @@ -28,22 +28,22 @@ from system_test import main_module, TIMEOUT, TestCase, Qdrouterd, DIR -class QdstatTestBase(TestCase): - """Define run_qdstat for use with all tests""" +class SkstatTestBase(TestCase): + """Define run_skstat for use with all tests""" - def run_qdstat(self, args, address=None, regex=None): + def run_skstat(self, args, address=None, regex=None): if args is None: args = [] - args = ['qdstat', + args = ['skstat', '--bus', str(address or self.address()), '--timeout', str(TIMEOUT)] + args - p = self.popen(args, name='qdstat-' + self.id(), stdout=PIPE, + p = self.popen(args, name='skstat-' + self.id(), stdout=PIPE, expect=None, universal_newlines=True) out, err = p.communicate() if p.returncode != 0: - raise RuntimeError("qdstat failed: %s (%s, %s)" % (p.returncode, + raise RuntimeError("skstat failed: %s (%s, %s)" % (p.returncode, out, err)) if regex is not None: pattern = re.compile(regex, re.I) @@ -56,11 +56,11 @@ def address(self): return self.router.addresses[0] -class QdstatTest(QdstatTestBase): - """Test qdstat tool output""" +class SkstatTest(SkstatTestBase): + """Test skstat tool output""" @classmethod def setUpClass(cls): - super(QdstatTest, cls).setUpClass() + super(SkstatTest, cls).setUpClass() config = Qdrouterd.Config([ ('router', {'id': 'QDR.A', 'workerThreads': 1}), ('listener', {'port': cls.tester.get_port()}), @@ -68,10 +68,10 @@ def setUpClass(cls): cls.router = cls.tester.qdrouterd('test-router', config) def test_help(self): - self.run_qdstat(['--help'], regex=r'Usage: qdstat') + self.run_skstat(['--help'], regex=r'Usage: skstat') def test_general(self): - out = self.run_qdstat(['--general'], + out = self.run_skstat(['--general'], regex=r'(?s)Router Statistics.*Mode\s*Standalone') self.assertTrue(re.match(r"(.*)\bConnections\b[ \t]+\b1\b(.*)", @@ -90,7 +90,7 @@ def test_general(self): self.assertEqual(out.count("QDR.A"), 2) def test_general_csv(self): - out = self.run_qdstat(['--general', '--csv'], + out = self.run_skstat(['--general', '--csv'], regex=r'(?s)Router Statistics.*Mode","Standalone') self.assertIn('"Connections","1"', out) @@ -102,57 +102,57 @@ def test_general_csv(self): self.assertEqual(out.count("QDR.A"), 2) def test_connections(self): - self.run_qdstat(['--connections'], regex=r'host.*container.*role') - outs = self.run_qdstat(['--connections'], regex=r'no-auth') - outs = self.run_qdstat(['--connections'], regex=r'QDR.A') + self.run_skstat(['--connections'], regex=r'host.*container.*role') + outs = self.run_skstat(['--connections'], regex=r'no-auth') + outs = self.run_skstat(['--connections'], regex=r'QDR.A') def test_connections_csv(self): - self.run_qdstat(['--connections', "--csv"], regex=r'host.*container.*role') - outs = self.run_qdstat(['--connections'], regex=r'no-auth') - outs = self.run_qdstat(['--connections'], regex=r'QDR.A') + self.run_skstat(['--connections', "--csv"], regex=r'host.*container.*role') + outs = self.run_skstat(['--connections'], regex=r'no-auth') + outs = self.run_skstat(['--connections'], regex=r'QDR.A') def test_links(self): - self.run_qdstat(['--links'], regex=r'QDR.A') - out = self.run_qdstat(['--links'], regex=r'endpoint.*out.*local.*temp.') + self.run_skstat(['--links'], regex=r'QDR.A') + out = self.run_skstat(['--links'], regex=r'endpoint.*out.*local.*temp.') parts = out.split("\n") self.assertEqual(len(parts), 9) def test_links_csv(self): - self.run_qdstat(['--links', "--csv"], regex=r'QDR.A') - out = self.run_qdstat(['--links'], regex=r'endpoint.*out.*local.*temp.') + self.run_skstat(['--links', "--csv"], regex=r'QDR.A') + out = self.run_skstat(['--links'], regex=r'endpoint.*out.*local.*temp.') parts = out.split("\n") self.assertEqual(len(parts), 9) def test_links_with_limit(self): - out = self.run_qdstat(['--links', '--limit=1']) + out = self.run_skstat(['--links', '--limit=1']) parts = out.split("\n") self.assertEqual(len(parts), 8) def test_links_with_limit_csv(self): - out = self.run_qdstat(['--links', '--limit=1', "--csv"]) + out = self.run_skstat(['--links', '--limit=1', "--csv"]) parts = out.split("\n") self.assertEqual(len(parts), 7) def test_nodes(self): - self.run_qdstat(['--nodes'], regex=r'No Router List') + self.run_skstat(['--nodes'], regex=r'No Router List') def test_nodes_csv(self): - self.run_qdstat(['--nodes', "--csv"], regex=r'No Router List') + self.run_skstat(['--nodes', "--csv"], regex=r'No Router List') def test_address(self): - out = self.run_qdstat(['--address'], regex=r'QDR.A') - out = self.run_qdstat(['--address'], regex=r'\$management') + out = self.run_skstat(['--address'], regex=r'QDR.A') + out = self.run_skstat(['--address'], regex=r'\$management') parts = out.split("\n") self.assertEqual(len(parts), 12) def test_address_csv(self): - out = self.run_qdstat(['--address'], regex=r'QDR.A') - out = self.run_qdstat(['--address'], regex=r'\$management') + out = self.run_skstat(['--address'], regex=r'QDR.A') + out = self.run_skstat(['--address'], regex=r'\$management') parts = out.split("\n") self.assertEqual(len(parts), 12) - def test_qdstat_no_args(self): - outs = self.run_qdstat(args=None) + def test_skstat_no_args(self): + outs = self.run_skstat(args=None) self.assertIn("Presettled Count", outs) self.assertIn("Dropped Presettled Count", outs) self.assertIn("Accepted Count", outs) @@ -163,8 +163,8 @@ def test_qdstat_no_args(self): self.assertIn("Ingress Count", outs) self.assertIn("Uptime", outs) - def test_qdstat_no_other_args_csv(self): - outs = self.run_qdstat(["--csv"]) + def test_skstat_no_other_args_csv(self): + outs = self.run_skstat(["--csv"]) self.assertIn("Presettled Count", outs) self.assertIn("Dropped Presettled Count", outs) self.assertIn("Accepted Count", outs) @@ -176,7 +176,7 @@ def test_qdstat_no_other_args_csv(self): self.assertIn("Uptime", outs) def test_address_priority(self): - out = self.run_qdstat(['--address']) + out = self.run_skstat(['--address']) lines = out.split("\n") # make sure the output contains a header line @@ -204,7 +204,7 @@ def test_address_priority(self): def test_address_priority_csv(self): HEADER_ROW = 4 PRI_COL = 3 - out = self.run_qdstat(['--address', "--csv"]) + out = self.run_skstat(['--address', "--csv"]) lines = out.split("\n") # make sure the output contains a header line @@ -229,41 +229,41 @@ def test_address_priority_csv(self): self.assertTrue(priority <= 9, "Priority was greater than 9") def test_address_with_limit(self): - out = self.run_qdstat(['--address', '--limit=1']) + out = self.run_skstat(['--address', '--limit=1']) parts = out.split("\n") self.assertEqual(len(parts), 8) def test_address_with_limit_csv(self): - out = self.run_qdstat(['--address', '--limit=1', '--csv']) + out = self.run_skstat(['--address', '--limit=1', '--csv']) parts = out.split("\n") self.assertEqual(len(parts), 7) def test_memory(self): - out = self.run_qdstat(['--memory']) + out = self.run_skstat(['--memory']) self.assertIn("QDR.A", out) self.assertIn("UTC", out) regexp = r'qdr_address_t\s+[0-9]+' assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % (regexp, out) def test_memory_csv(self): - out = self.run_qdstat(['--memory', '--csv']) + out = self.run_skstat(['--memory', '--csv']) self.assertIn("QDR.A", out) self.assertIn("UTC", out) regexp = r'qdr_address_t","[0-9]+' assert re.search(regexp, out, re.I), "Can't find '%s' in '%s'" % (regexp, out) def test_policy(self): - out = self.run_qdstat(['--policy']) + out = self.run_skstat(['--policy']) self.assertIn("Maximum Concurrent Connections", out) self.assertIn("Total Denials", out) def test_policy_csv(self): - out = self.run_qdstat(['-p', "--csv"]) + out = self.run_skstat(['-p', "--csv"]) self.assertIn("Maximum Concurrent Connections", out) self.assertIn("Total Denials", out) def test_log(self): - self.run_qdstat(['--log', '--limit=5'], regex=r'AGENT \(debug\).*GET-LOG') + self.run_skstat(['--log', '--limit=5'], regex=r'AGENT \(debug\).*GET-LOG') def test_yy_query_many_links(self): # This test will fail without the fix for DISPATCH-974 @@ -285,11 +285,11 @@ def test_yy_query_many_links(self): if count == COUNT: break - # Now we run qdstat command and check if we got back details + # Now we run skstat command and check if we got back details # about all the 10000 links # We do not specify the limit which means unlimited # which means get everything that is there. - outs = self.run_qdstat(['--links']) + outs = self.run_skstat(['--links']) out_list = outs.split("\n") out_links = 0 @@ -303,8 +303,8 @@ def test_yy_query_many_links(self): self.assertEqual(in_links, COUNT) self.assertEqual(out_links, COUNT) - # Run qdstat with a limit more than 10,000 - outs = self.run_qdstat(['--links', '--limit=15000']) + # Run skstat with a limit more than 10,000 + outs = self.run_skstat(['--links', '--limit=15000']) out_list = outs.split("\n") out_links = 0 @@ -318,8 +318,8 @@ def test_yy_query_many_links(self): self.assertEqual(in_links, COUNT) self.assertEqual(out_links, COUNT) - # Run qdstat with a limit less than 10,000 - outs = self.run_qdstat(['--links', '--limit=2000']) + # Run skstat with a limit less than 10,000 + outs = self.run_skstat(['--links', '--limit=2000']) out_list = outs.split("\n") links = 0 @@ -329,9 +329,9 @@ def test_yy_query_many_links(self): self.assertEqual(links, 2000) - # Run qdstat with a limit less than 10,000 + # Run skstat with a limit less than 10,000 # repeat with --csv - outs = self.run_qdstat(['--links', '--limit=2000', '--csv']) + outs = self.run_skstat(['--links', '--limit=2000', '--csv']) out_list = outs.split("\n") links = 0 @@ -341,9 +341,9 @@ def test_yy_query_many_links(self): self.assertEqual(links, 2000) - # Run qdstat with a limit of 700 because 700 + # Run skstat with a limit of 700 because 700 # is the maximum number of rows we get per request - outs = self.run_qdstat(['--links', '--limit=700']) + outs = self.run_skstat(['--links', '--limit=700']) out_list = outs.split("\n") links = 0 @@ -353,10 +353,10 @@ def test_yy_query_many_links(self): self.assertEqual(links, 700) - # Run qdstat with a limit of 700 because 700 + # Run skstat with a limit of 700 because 700 # is the maximum number of rows we get per request # repeat with --csv - outs = self.run_qdstat(['--links', '--limit=700', '--csv']) + outs = self.run_skstat(['--links', '--limit=700', '--csv']) out_list = outs.split("\n") links = 0 @@ -366,10 +366,10 @@ def test_yy_query_many_links(self): self.assertEqual(links, 700) - # Run qdstat with a limit of 500 because 700 + # Run skstat with a limit of 500 because 700 # is the maximum number of rows we get per request # and we want to try something less than 700 - outs = self.run_qdstat(['--links', '--limit=500']) + outs = self.run_skstat(['--links', '--limit=500']) out_list = outs.split("\n") links = 0 @@ -379,11 +379,11 @@ def test_yy_query_many_links(self): self.assertEqual(links, 500) - # Run qdstat with a limit of 500 because 700 + # Run skstat with a limit of 500 because 700 # is the maximum number of rows we get per request # and we want to try something less than 700 # repeat with --csv - outs = self.run_qdstat(['--links', '--limit=500', '--csv']) + outs = self.run_skstat(['--links', '--limit=500', '--csv']) out_list = outs.split("\n") links = 0 @@ -393,9 +393,9 @@ def test_yy_query_many_links(self): self.assertEqual(links, 500) - # DISPATCH-1485. Try to run qdstat with a limit=0. Without the fix for DISPATCH-1485 + # DISPATCH-1485. Try to run skstat with a limit=0. Without the fix for DISPATCH-1485 # this following command will hang and the test will fail. - outs = self.run_qdstat(['--links', '--limit=0']) + outs = self.run_skstat(['--links', '--limit=0']) out_list = outs.split("\n") links = 0 @@ -404,10 +404,10 @@ def test_yy_query_many_links(self): links += 1 self.assertEqual(links, COUNT * 2) - # DISPATCH-1485. Try to run qdstat with a limit=0. Without the fix for DISPATCH-1485 + # DISPATCH-1485. Try to run skstat with a limit=0. Without the fix for DISPATCH-1485 # this following command will hang and the test will fail. # repeat with --csv - outs = self.run_qdstat(['--links', '--limit=0', '--csv']) + outs = self.run_skstat(['--links', '--limit=0', '--csv']) out_list = outs.split("\n") links = 0 @@ -417,7 +417,7 @@ def test_yy_query_many_links(self): self.assertEqual(links, COUNT * 2) # This test would fail without the fix for DISPATCH-974 - outs = self.run_qdstat(['--address']) + outs = self.run_skstat(['--address']) out_list = outs.split("\n") sender_addresses = 0 @@ -432,9 +432,9 @@ def test_yy_query_many_links(self): self.assertEqual(receiver_addresses, COUNT) # Test if there is a non-zero uptime for the router in the output of - # qdstat -g + # skstat -g non_zero_seconds = False - outs = self.run_qdstat(args=None) + outs = self.run_skstat(args=None) parts = outs.split("\n") for part in parts: if "Uptime" in part: @@ -452,11 +452,11 @@ def test_yy_query_many_links(self): c.close() -class QdstatTestVhostPolicy(QdstatTestBase): - """Test qdstat-with-policy tool output""" +class SkstatTestVhostPolicy(SkstatTestBase): + """Test skstat-with-policy tool output""" @classmethod def setUpClass(cls): - super(QdstatTestVhostPolicy, cls).setUpClass() + super(SkstatTestVhostPolicy, cls).setUpClass() config = Qdrouterd.Config([ ('router', {'id': 'QDR.A', 'workerThreads': 1}), ('listener', {'port': cls.tester.get_port()}), @@ -486,49 +486,49 @@ def setUpClass(cls): cls.router = cls.tester.qdrouterd('test-router', config) def test_vhost(self): - out = self.run_qdstat(['--vhosts']) + out = self.run_skstat(['--vhosts']) self.assertIn("Vhosts", out) self.assertIn("allowUnknownUser", out) def test_vhost_csv(self): - out = self.run_qdstat(['--vhosts', '--csv']) + out = self.run_skstat(['--vhosts', '--csv']) self.assertIn("Vhosts", out) self.assertIn("allowUnknownUser", out) def test_vhostgroups(self): - out = self.run_qdstat(['--vhostgroups']) + out = self.run_skstat(['--vhostgroups']) self.assertIn("Vhost Groups", out) self.assertIn("allowAdminStatusUpdate", out) self.assertIn("Vhost '$default' UserGroup '$default'", out) self.assertIn("Vhost '$default' UserGroup 'HGCrawler'", out) def test_vhostgroups_csv(self): - out = self.run_qdstat(['--vhostgroups', '--csv']) + out = self.run_skstat(['--vhostgroups', '--csv']) self.assertIn("Vhost Groups", out) self.assertIn("allowAdminStatusUpdate", out) self.assertIn("Vhost '$default' UserGroup '$default'", out) self.assertIn("Vhost '$default' UserGroup 'HGCrawler'", out) def test_vhoststats(self): - out = self.run_qdstat(['--vhoststats']) + out = self.run_skstat(['--vhoststats']) self.assertIn("Vhost Stats", out) self.assertIn("maxMessageSizeDenied", out) self.assertIn("Vhost User Stats", out) self.assertIn("remote hosts", out) def test_vhoststats_csv(self): - out = self.run_qdstat(['--vhoststats', '--csv']) + out = self.run_skstat(['--vhoststats', '--csv']) self.assertIn("Vhost Stats", out) self.assertIn("maxMessageSizeDenied", out) self.assertIn("Vhost User Stats", out) self.assertIn("remote hosts", out) -class QdstatLinkPriorityTest(QdstatTestBase): +class SkstatLinkPriorityTest(SkstatTestBase): """Need 2 routers to get inter-router links for the link priority test""" @classmethod def setUpClass(cls): - super(QdstatLinkPriorityTest, cls).setUpClass() + super(SkstatLinkPriorityTest, cls).setUpClass() cls.inter_router_port = cls.tester.get_port() config_1 = Qdrouterd.Config([ ('router', {'mode': 'interior', 'id': 'R1'}), @@ -549,7 +549,7 @@ def address(self): return self.router_1.addresses[0] def test_link_priority(self): - out = self.run_qdstat(['--links']) + out = self.run_skstat(['--links']) lines = out.split("\n") # make sure the output contains a header line @@ -583,7 +583,7 @@ def test_link_priority_csv(self): HEADER_ROW = 4 TYPE_COL = 0 PRI_COL = 8 - out = self.run_qdstat(['--links', '--csv']) + out = self.run_skstat(['--links', '--csv']) lines = out.split("\n") # make sure the output contains a header line @@ -614,7 +614,7 @@ def test_link_priority_csv(self): self.assertEqual(len(priorities.keys()), 10, "Not all priorities are present") def _test_links_all_routers(self, command): - out = self.run_qdstat(command) + out = self.run_skstat(command) self.assertTrue(out.count('UTC') == 1) self.assertTrue(out.count('Router Links') == 2) self.assertTrue(out.count('inter-router') == 40) @@ -627,7 +627,7 @@ def test_links_all_routers_csv(self): self._test_links_all_routers(['--links', '--all-routers', '--csv']) def _test_all_entities(self, command): - out = self.run_qdstat(command) + out = self.run_skstat(command) self.assertTrue(out.count('UTC') == 1) self.assertTrue(out.count('Router Links') == 1) @@ -644,7 +644,7 @@ def test_all_entities_csv(self): self._test_all_entities(['--all-entities', '--csv']) def _test_all_entities_all_routers(self, command): - out = self.run_qdstat(command) + out = self.run_skstat(command) self.assertTrue(out.count('UTC') == 1) self.assertTrue(out.count('Router Links') == 2) @@ -670,8 +670,8 @@ def _has_ssl(): @unittest.skipIf(_has_ssl() is False, "Proton SSL support unavailable") -class QdstatSslTest(QdstatTestBase): - """Test qdstat tool output""" +class SkstatSslTest(SkstatTestBase): + """Test skstat tool output""" @staticmethod def ssl_file(name): @@ -683,7 +683,7 @@ def sasl_path(): @classmethod def setUpClass(cls): - super(QdstatSslTest, cls).setUpClass() + super(SkstatSslTest, cls).setUpClass() # Write SASL configuration file: with open('tests-mech-EXTERNAL.conf', 'w') as sasl_conf: sasl_conf.write("mech_list: EXTERNAL ANONYMOUS DIGEST-MD5 PLAIN\n") @@ -720,7 +720,7 @@ def setUpClass(cls): cls.router = cls.tester.qdrouterd('test-router', config) def get_ssl_args(self): - """A map of short names to the corresponding qdstat arguments. A list + """A map of short names to the corresponding skstat arguments. A list of keys are passed to ssl_test() via the arg_names parameter list. """ args = dict( @@ -738,7 +738,7 @@ def ssl_test(self, url_name, arg_names): """Run simple SSL connection test with supplied parameters. :param url_name: a shorthand name used to select which router - interface qdstat will connect to: + interface skstat will connect to: 'none' = No SSL or SASL config 'strict' = Require SSL, No SASL config 'unsecured' = SSL not required, SASL not required @@ -754,129 +754,129 @@ def ssl_test(self, url_name, arg_names): urls = dict(zip(['none', 'strict', 'unsecured', 'auth'], addrs)) urls.update(zip(['none_s', 'strict_s', 'unsecured_s', 'auth_s'], (Url(a, scheme="amqps") for a in addrs))) - self.run_qdstat(['--general'] + sum([args[n] for n in arg_names], []), + self.run_skstat(['--general'] + sum([args[n] for n in arg_names], []), address=str(urls[url_name]), regex=r'(?s)Router Statistics.*Mode\s*Standalone') def ssl_test_bad(self, url_name, arg_names): self.assertRaises(RuntimeError, self.ssl_test, url_name, arg_names) - # qdstat -b amqp://localhost: --general and makes sure + # skstat -b amqp://localhost: --general and makes sure # the router sends back a valid response. def test_ssl_none(self): self.ssl_test('none', []) - # qdstat -b amqps://localhost: --general + # skstat -b amqps://localhost: --general # Make sure that the command fails. def test_ssl_scheme_to_none(self): self.ssl_test_bad('none_s', []) - # qdstat -b amqp://localhost: --general --ssl-certificate /path/to/client-certificate.pem + # skstat -b amqp://localhost: --general --ssl-certificate /path/to/client-certificate.pem # Makes sure the command fails. def test_ssl_cert_to_none(self): self.ssl_test_bad('none', ['client_cert']) # Tries to run the following command on a listener that requires SSL (requireSsl:yes) - # qdstat -b amqp://localhost: --general + # skstat -b amqp://localhost: --general # Makes sure the command fails. def test_ssl_none_to_strict(self): self.ssl_test_bad('strict', []) - # qdstat -b amqps://localhost: --general + # skstat -b amqps://localhost: --general def test_ssl_schema_to_strict(self): self.ssl_test_bad('strict_s', []) - # qdstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem + # skstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem # --ssl-key /path/to/client-private-key.pem --ssl-password client-password' def test_ssl_cert_to_strict(self): self.ssl_test_bad('strict_s', ['client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem def test_ssl_trustfile_to_strict(self): self.ssl_test('strict_s', ['trustfile']) - # qdstat -b amqps://localhost: --general --ssl-trustfile + # skstat -b amqps://localhost: --general --ssl-trustfile # /path/to/ca-certificate.pem --ssl-certificate /path/to/client-certificate.pem # --ssl-key /path/to/client-private-key.pem --ssl-password client-password def test_ssl_trustfile_cert_to_strict(self): self.ssl_test('strict_s', ['trustfile', 'client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem # Send in a bad ca cert and make sure the test fails. def test_ssl_bad_trustfile_to_strict(self): self.ssl_test_bad('strict_s', ['bad_trustfile']) # Require-auth SSL listener - # qdstat -b amqp://localhost: --general + # skstat -b amqp://localhost: --general # Send in no certs to a 'authenticatePeer': 'yes', 'requireSsl': 'yes' listener and make sure it fails. # Also protocol is amqp not amqps def test_ssl_none_to_auth(self): self.ssl_test_bad('auth', []) - # qdstat -b amqps://localhost:28491 --general + # skstat -b amqps://localhost:28491 --general # Send in no certs to a 'authenticatePeer': 'yes', 'requireSsl': 'yes' listener and make sure it fails. def test_ssl_schema_to_auth(self): self.ssl_test_bad('auth_s', []) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem' + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem' # Send in just a trustfile to an 'authenticatePeer': 'yes', 'requireSsl': 'yes' listener and make sure it fails. def test_ssl_trustfile_to_auth(self): self.ssl_test_bad('auth_s', ['trustfile']) - # qdstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem + # skstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem # --ssl-key /path/to/client-private-key.pem --ssl-password client-password # Without a trustfile, this test fails def test_ssl_cert_to_auth(self): self.ssl_test_bad('auth_s', ['client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem # --ssl-certificate /path/to/client-certificate.pem # --ssl-key /path/to/client-private-key.pem --ssl-password client-password # This has everything, the test should pass. def test_ssl_trustfile_cert_to_auth(self): self.ssl_test('auth_s', ['trustfile', 'client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem # --ssl-certificate /path/to/client-certificate.pem --ssl-key /path/to/client-private-key.pem # --ssl-password client-password # Bad trustfile should be rejected. def test_ssl_bad_trustfile_to_auth(self): self.ssl_test_bad('auth_s', ['bad_trustfile', 'client_cert_all']) - # qdstat -b amqps://localhost: --general --sasl-mechanisms EXTERNAL + # skstat -b amqps://localhost: --general --sasl-mechanisms EXTERNAL # --ssl-certificate /path/to/client-certificate.pem --ssl-key /path/to/client-private-key.pem # --ssl-password client-password --ssl-trustfile /path/to/ca-certificate.pem' def test_ssl_cert_explicit_external_to_auth(self): self.ssl_test('auth_s', ['sasl_external', 'client_cert_all', 'trustfile']) # Unsecured SSL listener, allows non-SSL - # qdstat -b amqp://localhost: --general + # skstat -b amqp://localhost: --general def test_ssl_none_to_unsecured(self): self.ssl_test('unsecured', []) - # qdstat -b amqps://localhost: --general + # skstat -b amqps://localhost: --general def test_ssl_schema_to_unsecured(self): self.ssl_test_bad('unsecured_s', []) - # qdstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem --ssl-key + # skstat -b amqps://localhost: --general --ssl-certificate /path/to/client-certificate.pem --ssl-key # /path/to/client-private-key.pem --ssl-password client-password # A trustfile is required, test will fail def test_ssl_cert_to_unsecured(self): self.ssl_test_bad('unsecured_s', ['client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem' + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem' # Just send in the trustfile, should be all good. def test_ssl_trustfile_to_unsecured(self): self.ssl_test('unsecured_s', ['trustfile']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/ca-certificate.pem # --ssl-certificate /path/to/client-certificate.pem --ssl-key /path/to/client-private-key.pem # --ssl-password client-password # We have everything, this should work. def test_ssl_trustfile_cert_to_unsecured(self): self.ssl_test('unsecured_s', ['trustfile', 'client_cert_all']) - # qdstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem'] + # skstat -b amqps://localhost: --general --ssl-trustfile /path/to/bad-ca-certificate.pem'] # Bad trustfile, test will fail. def test_ssl_bad_trustfile_to_unsecured(self): self.ssl_test_bad('unsecured_s', ['bad_trustfile']) @@ -890,19 +890,19 @@ def test_ssl_peer_name_verify_disabled(self): with self.assertRaises(RuntimeError, msg="expected fail: host name wrong") as exc: - self.run_qdstat(address="amqps://127.0.0.1:%s" % self.strict_port, + self.run_skstat(address="amqps://127.0.0.1:%s" % self.strict_port, args=['--general'] + params) # repeat the same operation but using # --ssl-disable--peer-name-verify. This should succeed: - self.run_qdstat(address="amqps://127.0.0.1:%s" % self.strict_port, + self.run_skstat(address="amqps://127.0.0.1:%s" % self.strict_port, args=['--general', '--ssl-disable-peer-name-verify'] + params) @unittest.skipIf(_has_ssl() is False, "Proton SSL support unavailable") -class QdstatSslTestSslPasswordFile(QdstatSslTest): +class SkstatSslTestSslPasswordFile(SkstatSslTest): """ Tests the --ssl-password-file command line parameter """ @@ -921,8 +921,8 @@ def get_ssl_args(self): @unittest.skipIf(_has_ssl() is False, "Proton SSL support unavailable") -class QdstatSslNoExternalTest(QdstatTestBase): - """Test qdstat can't connect without sasl_mech EXTERNAL""" +class SkstatSslNoExternalTest(SkstatTestBase): + """Test skstat can't connect without sasl_mech EXTERNAL""" @staticmethod def ssl_file(name): @@ -934,7 +934,7 @@ def sasl_path(): @classmethod def setUpClass(cls): - super(QdstatSslNoExternalTest, cls).setUpClass() + super(SkstatSslNoExternalTest, cls).setUpClass() # Write SASL configuration file: with open('tests-mech-NOEXTERNAL.conf', 'w') as sasl_conf: sasl_conf.write("mech_list: ANONYMOUS DIGEST-MD5 PLAIN\n") @@ -974,7 +974,7 @@ def ssl_test(self, url_name, arg_names): urls.update(zip(['none_s', 'strict_s', 'unsecured_s', 'auth_s'], (Url(a, scheme="amqps") for a in addrs))) - self.run_qdstat(['--general'] + sum([args[n] for n in arg_names], []), + self.run_skstat(['--general'] + sum([args[n] for n in arg_names], []), address=str(urls[url_name]), regex=r'(?s)Router Statistics.*Mode\s*Standalone') diff --git a/tests/system_tests_socket_address_family.py b/tests/system_tests_socket_address_family.py index fee4f75e1..8670e3642 100644 --- a/tests/system_tests_socket_address_family.py +++ b/tests/system_tests_socket_address_family.py @@ -22,7 +22,7 @@ from proton.reactor import Container from system_test import TestCase, Qdrouterd, main_module from system_test import unittest -from qpid_dispatch_internal.policy.policy_util import is_ipv6_enabled +from skupper_router_internal.policy.policy_util import is_ipv6_enabled class SocketAddressFamilyTest(TestCase): diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py index 2d55b0b16..d752c0ce5 100644 --- a/tests/system_tests_ssl.py +++ b/tests/system_tests_ssl.py @@ -33,7 +33,7 @@ from proton import SASL, Url, SSLDomain, SSLUnavailable from proton.utils import BlockingConnection -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from system_test import TestCase, main_module, Qdrouterd, DIR from system_test import unittest @@ -747,7 +747,7 @@ def get_router_nodes(self): url = Url("amqp://0.0.0.0:%d/$management" % self.PORT_NO_SSL) node = Node.connect(url) - response = node.query(type="org.apache.qpid.dispatch.router.node", attribute_names=["id"]) + response = node.query(type="io.skupper.router.router.node", attribute_names=["id"]) router_nodes = [] for resp in response.get_dicts(): router_nodes.append(resp['id']) @@ -899,7 +899,7 @@ def get_router_nodes(self): url = Url("amqp://0.0.0.0:%d/$management" % self.PORT_NO_SSL) node = Node.connect(url) - response = node.query(type="org.apache.qpid.dispatch.router.node", attribute_names=["id"]) + response = node.query(type="io.skupper.router.router.node", attribute_names=["id"]) router_nodes = [] for resp in response.get_dicts(): router_nodes.append(resp['id']) @@ -1052,7 +1052,7 @@ def get_router_nodes(self): url = Url("amqp://0.0.0.0:%d/$management" % self.PORT_NO_SSL) node = Node.connect(url) - response = node.query(type="org.apache.qpid.dispatch.router.node", attribute_names=["id"]) + response = node.query(type="io.skupper.router.router.node", attribute_names=["id"]) router_nodes = [] for resp in response.get_dicts(): router_nodes.append(resp['id']) diff --git a/tests/system_tests_tcp_adaptor.py b/tests/system_tests_tcp_adaptor.py index 84adb401e..ab2f59231 100644 --- a/tests/system_tests_tcp_adaptor.py +++ b/tests/system_tests_tcp_adaptor.py @@ -510,8 +510,8 @@ def router(name, mode, connection, extra=None): for rtr in interior_rtrs: # query each interior for addresses p = Process( - ['qdstat', '-b', str(cls.router_dict[rtr].addresses[0]), '-a'], - name='qdstat-snap1', stdout=PIPE, expect=None, + ['skstat', '-b', str(cls.router_dict[rtr].addresses[0]), '-a'], + name='skstat-snap1', stdout=PIPE, expect=None, universal_newlines=True) out = p.communicate()[0] # examine what this router can see; signal poll loop to continue or not @@ -550,9 +550,9 @@ def tearDownClass(cls): cls.echo_server_NS_CONN_STALL.wait() super(TcpAdaptor, cls).tearDownClass() - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or str(self.router_dict['INTA'].addresses[0]), + ['skmanage'] + cmd.split(' ') + ['--bus', address or str(self.router_dict['INTA'].addresses[0]), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) @@ -952,11 +952,11 @@ def test_70_half_closed(self): # connector/listener stats def test_80_stats(self): - tname = "test_80 check stats in qdmanage" + tname = "test_80 check stats in skmanage" self.logger.log(tname + " START") # Verify listener stats query_command = 'QUERY --type=tcpListener' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) for output in outputs: if output['name'].startswith("ES"): # Check only echo server listeners @@ -966,7 +966,7 @@ def test_80_stats(self): assert output["bytesIn"] == output["bytesOut"] # Verify connector stats query_command = 'QUERY --type=tcpConnector' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) for output in outputs: assert output['address'].startswith("ES") assert "connectionsOpened" in output @@ -1174,7 +1174,7 @@ def setUpClass(cls): cls.e_router.wait_ready() def _query_links_by_addr(self, router_mgmt, owning_addr): - oid = 'org.apache.qpid.dispatch.router.link' + oid = 'io.skupper.router.router.link' attrs = ['owningAddr', 'linkDir'] links = [] @@ -1190,8 +1190,8 @@ def test_01_mgmt(self): Create and delete TCP connectors and listeners. Ensure that the service address is properly removed on the interior router. """ - LISTENER_TYPE = 'org.apache.qpid.dispatch.tcpListener' - CONNECTOR_TYPE = 'org.apache.qpid.dispatch.tcpConnector' + LISTENER_TYPE = 'io.skupper.router.tcpListener' + CONNECTOR_TYPE = 'io.skupper.router.tcpConnector' mgmt = self.e_router.management diff --git a/tests/system_tests_topology.py b/tests/system_tests_topology.py index c5dcf0866..4a5f6a064 100644 --- a/tests/system_tests_topology.py +++ b/tests/system_tests_topology.py @@ -56,12 +56,12 @@ def __init__(self, reply_addr): self.reply_addr = reply_addr def make_connector_query(self, connector_name): - props = {'operation': 'READ', 'type': 'org.apache.qpid.dispatch.connector', 'name' : connector_name} + props = {'operation': 'READ', 'type': 'io.skupper.router.connector', 'name' : connector_name} msg = Message(properties=props, reply_to=self.reply_addr) return msg def make_connector_delete_command(self, connector_name): - props = {'operation': 'DELETE', 'type': 'org.apache.qpid.dispatch.connector', 'name' : connector_name} + props = {'operation': 'DELETE', 'type': 'io.skupper.router.connector', 'name' : connector_name} msg = Message(properties=props, reply_to=self.reply_addr) return msg @@ -576,7 +576,7 @@ def _create_router(self, name, config = [ ('router', {'id': name, 'mode': 'interior', - # these are the default values from qdrouter.json + # these are the default values from skrouter.json 'raIntervalSeconds': ra_interval or 30, 'raIntervalFluxSeconds': ra_flux or 4, 'remoteLsMaxAgeSeconds': ra_stale or 60}), @@ -695,7 +695,7 @@ def test_01_reboot_INT_A(self): # immediately rather than waiting for the remoteLsMaxAgeSeconds timeout mgmt = INT_C.management - a_type = 'org.apache.qpid.dispatch.router.address' + a_type = 'io.skupper.router.router.address' rsp = mgmt.query(a_type).get_dicts() while any('closest/on_A' in a['name'] for a in rsp): time.sleep(0.25) @@ -730,7 +730,7 @@ def test_02_shutdown_INT_A(self): # wait for INT_A mobile addresses to be removed from INT_C, this # should happen after ra_stale seconds mgmt = INT_C.management - a_type = 'org.apache.qpid.dispatch.router.address' + a_type = 'io.skupper.router.router.address' rsp = mgmt.query(a_type).get_dicts() while any('closest/on_A' in a['name'] for a in rsp): time.sleep(0.25) diff --git a/tests/system_tests_topology_disposition.py b/tests/system_tests_topology_disposition.py index 25e8046c8..9edbcef7a 100644 --- a/tests/system_tests_topology_disposition.py +++ b/tests/system_tests_topology_disposition.py @@ -27,7 +27,7 @@ from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container -from qpid_dispatch_internal.compat import UNICODE +from skupper_router_internal.compat import UNICODE from system_test import TestCase, Qdrouterd, main_module @@ -68,19 +68,19 @@ def __init__(self, reply_addr) : self.reply_addr = reply_addr def make_connector_query(self, connector_name) : - props = {'operation': 'READ', 'type': 'org.apache.qpid.dispatch.connector', 'name' : connector_name} + props = {'operation': 'READ', 'type': 'io.skupper.router.connector', 'name' : connector_name} msg = Message(properties=props, reply_to=self.reply_addr) return msg def make_connector_delete_command(self, connector_name) : - props = {'operation': 'DELETE', 'type': 'org.apache.qpid.dispatch.connector', 'name' : connector_name} + props = {'operation': 'DELETE', 'type': 'io.skupper.router.connector', 'name' : connector_name} msg = Message(properties=props, reply_to=self.reply_addr) return msg def make_router_link_query(self) : props = {'count': '100', 'operation': 'QUERY', - 'entityType': 'org.apache.qpid.dispatch.router.link', + 'entityType': 'io.skupper.router.router.link', 'name': 'self', 'type': 'org.amqp.management' } diff --git a/tests/system_tests_two_routers.py b/tests/system_tests_two_routers.py index 018c3af2e..4230cb43b 100644 --- a/tests/system_tests_two_routers.py +++ b/tests/system_tests_two_routers.py @@ -29,7 +29,7 @@ from proton.reactor import Container, AtLeastOnce from proton.utils import BlockingConnection -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from system_test import Logger, TestCase, Process, Qdrouterd, main_module, TIMEOUT, TestTimeout, PollTimeout from system_test import AsyncTestReceiver @@ -98,9 +98,9 @@ def router(name, connection): def address(self): return self.routers[0].addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -116,7 +116,7 @@ def test_01_pre_settled(self): self.assertIsNone(test.error) local_node = Node.connect(self.routers[0].addresses[0], timeout=TIMEOUT) - outs = local_node.query(type='org.apache.qpid.dispatch.router') + outs = local_node.query(type='io.skupper.router.router') # deliveriesTransit must most surely be greater than num_msgs pos = outs.attribute_names.index("deliveriesTransit") @@ -294,7 +294,7 @@ def test_19_delete_inter_router_connection(self): prevented from doing so. """ query_command = 'QUERY --type=connection' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) identity = None passed = False @@ -304,7 +304,7 @@ def test_19_delete_inter_router_connection(self): if identity: update_command = 'UPDATE --type=connection adminStatus=deleted --id=' + identity try: - json.loads(self.run_qdmanage(update_command)) + json.loads(self.run_skmanage(update_command)) except Exception as e: if "Forbidden" in str(e): passed = True @@ -324,7 +324,7 @@ def test_20_delete_connection(self): connection = BlockingConnection(self.address(), properties=CONNECTION_PROPERTIES_UNICODE_STRING) query_command = 'QUERY --type=connection' - outputs = json.loads(self.run_qdmanage(query_command)) + outputs = json.loads(self.run_skmanage(query_command)) identity = None passed = False @@ -334,17 +334,17 @@ def test_20_delete_connection(self): if output.get('properties'): conn_properties = output['properties'] # Find the connection that has our properties - CONNECTION_PROPERTIES_UNICODE_STRING - # Delete that connection and run another qdmanage to see + # Delete that connection and run another skmanage to see # if the connection is gone. if conn_properties.get('int_property'): identity = output.get("identity") if identity: update_command = 'UPDATE --type=connection adminStatus=deleted --id=' + identity try: - self.run_qdmanage(update_command) + self.run_skmanage(update_command) query_command = 'QUERY --type=connection' outputs = json.loads( - self.run_qdmanage(query_command)) + self.run_skmanage(query_command)) no_properties = True for output in outputs: if output.get('properties'): @@ -461,7 +461,7 @@ def on_link_opened(self, event): request = Message() request.address = "amqp:/_local/$management" request.properties = { - 'type': 'org.apache.qpid.dispatch.connection', + 'type': 'io.skupper.router.connection', 'operation': 'QUERY'} request.reply_to = self.mgmt_receiver.remote_source.address self.mgmt_sender.send(request) @@ -470,7 +470,7 @@ def on_link_opened(self, event): def poll_timeout(self): request = Message() request.address = "amqp:/_local/$management" - request.properties = {'type': 'org.apache.qpid.dispatch.connection', + request.properties = {'type': 'io.skupper.router.connection', 'operation': 'QUERY'} request.reply_to = self.mgmt_receiver_2.remote_source.address self.mgmt_sender.send(request) @@ -493,7 +493,7 @@ def on_message(self, event): request.address = "amqp:/_local/$management" request.properties = { 'identity': identity, - 'type': 'org.apache.qpid.dispatch.connection', + 'type': 'io.skupper.router.connection', 'operation': 'UPDATE' } request.body = { @@ -1478,7 +1478,7 @@ def addr_text(self, addr): def on_timer_task(self, event): local_node = Node.connect(self.parent.address1, timeout=TIMEOUT) - res = local_node.query('org.apache.qpid.dispatch.router.address') + res = local_node.query('io.skupper.router.router.address') name = res.attribute_names.index('name') found = False for results in res.results: @@ -1818,9 +1818,9 @@ def setUpClass(cls): def address(self): return self.routers[0].addresses[0] - def run_qdmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): + def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK, address=None): p = self.popen( - ['qdmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], + ['skmanage'] + cmd.split(' ') + ['--bus', address or self.address(), '--indent=-1', '--timeout', str(TIMEOUT)], stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect, universal_newlines=True) out = p.communicate(input)[0] @@ -1840,7 +1840,7 @@ def can_terminate(self): return False def check_connections(self): - res = self.local_node.query(type='org.apache.qpid.dispatch.connection') + res = self.local_node.query(type='io.skupper.router.connection') results = res.results # If DISPATCH-1093 was not fixed, there would be an additional @@ -1864,20 +1864,20 @@ def test_create_connectors(self): self.local_node = Node.connect(self.routers[0].addresses[0], timeout=TIMEOUT) - res = self.local_node.query(type='org.apache.qpid.dispatch.connection') + res = self.local_node.query(type='io.skupper.router.connection') results = res.results self.assertEqual(1, len(results)) - long_type = 'org.apache.qpid.dispatch.connector' '' + long_type = 'io.skupper.router.connector' '' create_command = 'CREATE --type=' + long_type + ' --name=foo' + ' host=0.0.0.0 port=' + str(TwoRouterConnection.B_normal_port_1) - self.run_qdmanage(create_command) + self.run_skmanage(create_command) create_command = 'CREATE --type=' + long_type + ' --name=bar' + ' host=0.0.0.0 port=' + str(TwoRouterConnection.B_normal_port_2) - self.run_qdmanage(create_command) + self.run_skmanage(create_command) self.schedule_num_connections_test() diff --git a/tests/system_tests_user_id.py b/tests/system_tests_user_id.py index 3ecc10595..0ffe80dc2 100644 --- a/tests/system_tests_user_id.py +++ b/tests/system_tests_user_id.py @@ -20,7 +20,7 @@ import os from system_test import TestCase, Qdrouterd, DIR, main_module from system_test import unittest -from qpid_dispatch.management.client import Node +from skupper_router.management.client import Node from proton import SSLDomain @@ -249,73 +249,73 @@ def test_ssl_user_id(self): addr = self.address(0).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) - user_id = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[0][0] + user_id = node.query(type='io.skupper.router.connection', attribute_names=['user']).results[0][0] self.assertEqual("3eccbf1a2f3e46da823c63a9da9158983cb495a3", user_id) addr = self.address(1).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("72d543690cb0a8fc2d0f4c704c65411b9ee8ad53839fced4c720d73e58e4f0d7", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[1][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[1][0]) addr = self.address(2).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("c6de3a340014b0f8a1d2b41d22e414fc5756494ffa3c8760bbff56f3aa9f179a5a6eae09413fd7a6afbf36b5fb4bad8795c2836774acfe00a701797cc2a3a9ab", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[2][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[2][0]) addr = self.address(3).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("72d543690cb0a8fc2d0f4c704c65411b9ee8ad53839fced4c720d73e58e4f0d7;127.0.0.1;Client;Dev;US;NC", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[3][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[3][0]) addr = self.address(4).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("3eccbf1a2f3e46da823c63a9da9158983cb495a3;US;NC", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[4][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[4][0]) addr = self.address(5).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("US;NC;c6de3a340014b0f8a1d2b41d22e414fc5756494ffa3c8760bbff56f3aa9f179a5a6eae09413fd7a6afbf36b5fb4bad8795c2836774acfe00a701797cc2a3a9ab", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[5][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[5][0]) addr = self.address(6).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("127.0.0.1;NC;Dev;US;Client", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[6][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[6][0]) addr = self.address(7).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("NC;US;Client;Dev;127.0.0.1;Raleigh", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[7][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[7][0]) addr = self.address(8).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("C=US,ST=NC,L=Raleigh,OU=Dev,O=Client,CN=127.0.0.1", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[8][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[8][0]) addr = self.address(9).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) self.assertEqual("C=US,ST=NC,L=Raleigh,OU=Dev,O=Client,CN=127.0.0.1", - node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[9][0]) + node.query(type='io.skupper.router.connection', attribute_names=['user']).results[9][0]) addr = self.address(10).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) - user = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[10][0] + user = node.query(type='io.skupper.router.connection', attribute_names=['user']).results[10][0] self.assertEqual("C=US,ST=NC,L=Raleigh,OU=Dev,O=Client,CN=127.0.0.1", str(user)) # authenticatePeer is set to 'no' in this listener, the user should anonymous on the connection. addr = self.address(11).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) - user = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[11][0] + user = node.query(type='io.skupper.router.connection', attribute_names=['user']).results[11][0] self.assertEqual("anonymous", user) addr = self.address(12).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) - user = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[12][0] + user = node.query(type='io.skupper.router.connection', attribute_names=['user']).results[12][0] self.assertEqual("user12", str(user)) addr = self.address(13).replace("amqp", "amqps") node = Node.connect(addr, ssl_domain=domain) - user_id = node.query(type='org.apache.qpid.dispatch.connection', attribute_names=['user']).results[13][0] + user_id = node.query(type='io.skupper.router.connection', attribute_names=['user']).results[13][0] self.assertEqual("user13", user_id) node.close() diff --git a/tests/system_tests_user_id_proxy.py b/tests/system_tests_user_id_proxy.py index 85a2417a6..497c33f8a 100644 --- a/tests/system_tests_user_id_proxy.py +++ b/tests/system_tests_user_id_proxy.py @@ -23,7 +23,7 @@ import proton from proton import SSLDomain, Delivery from proton.utils import BlockingConnection -from qpid_dispatch_internal.compat import BINARY +from skupper_router_internal.compat import BINARY class QdSSLUseridTest(TestCase): diff --git a/tests/test_command.py b/tests/test_command.py index ef926ade2..b86c4f675 100644 --- a/tests/test_command.py +++ b/tests/test_command.py @@ -21,11 +21,11 @@ import sys from itertools import combinations -from qpid_dispatch_internal.tools.command import (main, - UsageError, - parse_args_qdstat, - _qdmanage_parser, - _qdstat_parser) +from skupper_router_internal.tools.command import (main, + UsageError, + parse_args_skstat, + _skmanage_parser, + _skstat_parser) from system_test import unittest @@ -36,7 +36,7 @@ def mock_error(self, message): argparse.ArgumentParser.error = mock_error # type: ignore[assignment] # Cannot assign to a method -# Since BusManager file is defined in tools/qdmanage.in -> tools/qdmanage +# Since BusManager file is defined in tools/skmanage.in -> tools/skmanage # otherwise it could be just imported @@ -60,15 +60,15 @@ def show_all(self): pass FBM = FakeBusManager -class TestParseArgsQdstat(unittest.TestCase): +class TestParseArgsSkstat(unittest.TestCase): def setUp(self): super().setUp() - self.parser = _qdstat_parser(BusManager=FBM) + self.parser = _skstat_parser(BusManager=FBM) - def test_parse_args_qdstat_print_help(self): + def test_parse_args_skstat_print_help(self): self.parser.print_help() - def test_parse_args_qdstat_mutually_exclusive(self): + def test_parse_args_skstat_mutually_exclusive(self): options1 = ["-g", "-c", "-l", "-n", "-e", "-a", "-m", "--autolinks", "--log", "--all-entities"] @@ -82,11 +82,11 @@ def _call_pairs(options): _call_pairs(options1) _call_pairs(options2) - def test_parse_args_qdstat_default(self): - args = parse_args_qdstat(FBM, argv=[]) + def test_parse_args_skstat_default(self): + args = parse_args_skstat(FBM, argv=[]) self.assertEqual(FBM.displayGeneral.__name__, args.show) - def test_parse_args_qdstat_method_show_matching(self): + def test_parse_args_skstat_method_show_matching(self): matching = [("-g", FBM.displayGeneral.__name__), ("-c", FBM.displayConnections.__name__), ("-l", FBM.displayRouterLinks.__name__), @@ -102,7 +102,7 @@ def test_parse_args_qdstat_method_show_matching(self): args = self.parser.parse_args([option]) self.assertEqual(expected, args.show) - def test_parse_args_qdstat_limit(self): + def test_parse_args_skstat_limit(self): args = self.parser.parse_args([]) self.assertEqual(None, args.limit) @@ -110,21 +110,21 @@ def test_parse_args_qdstat_limit(self): self.assertEqual(1, args.limit) -class TestParseArgsQdmanage(unittest.TestCase): +class TestParseArgsSkmanage(unittest.TestCase): def setUp(self): super().setUp() self.operations = ["HERE", "SOME", "OPERATIONS"] - self.parser = _qdmanage_parser(operations=self.operations) + self.parser = _skmanage_parser(operations=self.operations) - def test_parse_args_qdmanage_print_help(self): + def test_parse_args_skmanage_print_help(self): self.parser.print_help() - def test_parse_args_qdmanage_operation_no_args(self): + def test_parse_args_skmanage_operation_no_args(self): argv = "-r r1 QUERY --type some --name the_name -b 127.0.0.1:5672" opts, args = self.parser.parse_known_args(argv.split()) self.assertEqual("QUERY", args[0]) - def test_parse_args_qdmanage_operation_and_args(self): + def test_parse_args_skmanage_operation_and_args(self): argv = "-r r1 QUERY arg1=val1 --type some other=argument --name the_name -b 127.0.0.1:5672" opts, args = self.parser.parse_known_args(argv.split()) self.assertEqual(["QUERY", "arg1=val1", "other=argument"], args) diff --git a/tests/tox.ini.in b/tests/tox.ini.in index 93262474c..370b9aa67 100644 --- a/tests/tox.ini.in +++ b/tests/tox.ini.in @@ -31,8 +31,8 @@ commands = ${CMAKE_SOURCE_DIR}/docs \ ${CMAKE_SOURCE_DIR}/tests \ ${CMAKE_SOURCE_DIR}/tools \ - ${CMAKE_SOURCE_DIR}/tools/qdstat \ - ${CMAKE_SOURCE_DIR}/tools/qdmanage + ${CMAKE_SOURCE_DIR}/tools/skstat \ + ${CMAKE_SOURCE_DIR}/tools/skmanage # TODO(pylint#5648): crash while parsing system_test.py pylint --jobs 2 --rcfile ${CMAKE_BINARY_DIR}/tests/tox.ini \ @@ -41,15 +41,15 @@ commands = ${CMAKE_SOURCE_DIR}/docs \ ${CMAKE_SOURCE_DIR}/tests \ ${CMAKE_SOURCE_DIR}/tools \ - ${CMAKE_SOURCE_DIR}/tools/qdstat \ - ${CMAKE_SOURCE_DIR}/tools/qdmanage + ${CMAKE_SOURCE_DIR}/tools/skstat \ + ${CMAKE_SOURCE_DIR}/tools/skmanage mypy --config-file ${CMAKE_BINARY_DIR}/tests/tox.ini \ ${CMAKE_SOURCE_DIR}/python \ ${CMAKE_SOURCE_DIR}/docs \ ${CMAKE_SOURCE_DIR}/tests \ ${CMAKE_SOURCE_DIR}/tools \ - ${CMAKE_BINARY_DIR}/python/qpid_dispatch_site.py + ${CMAKE_BINARY_DIR}/python/skupper_router_site.py deps = hacking==4.1.0 diff --git a/tools/scraper/common.py b/tools/scraper/common.py index 20ed3d143..0217379cf 100755 --- a/tools/scraper/common.py +++ b/tools/scraper/common.py @@ -106,7 +106,7 @@ def module_key_in_line(self, key, line): ''' Sense if the key is a log module name in the log line. The name can't be too far into the string or else it finds - false positives when a user uses qdstat to get a log file. + false positives when a user uses skstat to get a log file. MAX_POSITION defines what constitutes 'too far'. :param key: :param line: @@ -188,9 +188,9 @@ def html_escape(text): def strings_of_proton_log(text): ''' Given a transfer log text string like: - "\x00SpE\x00Ss\xd0\x00\x00\x002\x00\x00\x00\x06@@@@\xa1$amqp:/_edge/EB1/temp.RkCWe_Is4jc3bcN\xa1\x0232\x00St\xd1\x00\x00\x00\x8c\x00\x00\x00\x0c\xa1\x04name\xa1\x04self\xa1\x04type\xa1\x13org.amqp.management\xa1\x09operation\xa1\x05QUERY\xa1\x0aentityType\xa1'org.apache.qpid.dispatch.router.address\xa1\x06offsetU\x00\xa1\x05count\x81\x00\x00\x00\x00\x00\x00\x01\xf4\x00Sw\xd1\x00\x00\x00Q\x00\x00\x00\x02\xa1\x0eattributeNames\xd0\x00\x00\x008\x00\x00\x00\x04\xa1\x04name\xa1\x0fsubscriberCount\xa1\x0bremoteCount\xa1\x0econtainerCount" + "\x00SpE\x00Ss\xd0\x00\x00\x002\x00\x00\x00\x06@@@@\xa1$amqp:/_edge/EB1/temp.RkCWe_Is4jc3bcN\xa1\x0232\x00St\xd1\x00\x00\x00\x8c\x00\x00\x00\x0c\xa1\x04name\xa1\x04self\xa1\x04type\xa1\x13org.amqp.management\xa1\x09operation\xa1\x05QUERY\xa1\x0aentityType\xa1'io.skupper.router.router.address\xa1\x06offsetU\x00\xa1\x05count\x81\x00\x00\x00\x00\x00\x00\x01\xf4\x00Sw\xd1\x00\x00\x00Q\x00\x00\x00\x02\xa1\x0eattributeNames\xd0\x00\x00\x008\x00\x00\x00\x04\xa1\x04name\xa1\x0fsubscriberCount\xa1\x0bremoteCount\xa1\x0econtainerCount" return the strings thereof: - "SpE Ss @@@@ $amqp:/_edge/EB1/temp.RkCWe_Is4jc3bcN name self type org.amqp.management operation QUERY entityType org.apache.qpid.dispatch.router.address offsetU count Sw attributeNames name subscriberCount remoteCount containerCount" + "SpE Ss @@@@ $amqp:/_edge/EB1/temp.RkCWe_Is4jc3bcN name self type org.amqp.management operation QUERY entityType io.skupper.router.router.address offsetU count Sw attributeNames name subscriberCount remoteCount containerCount" The intended use for this is to help decode management and router frames in the transfer nickname dump. :param text: :return: strings embedded in text diff --git a/tools/scraper/test_data/A-two-instances.log b/tools/scraper/test_data/A-two-instances.log index 41e4c4646..622b0eb51 100644 --- a/tools/scraper/test_data/A-two-instances.log +++ b/tools/scraper/test_data/A-two-instances.log @@ -1,19 +1,19 @@ -2018-10-15 10:57:32.149418 -0400 AGENT (debug) Add entity: LogEntity(enable=trace+, identity=log/DEFAULT, includeSource=False, includeTimestamp=True, module=DEFAULT, name=log/DEFAULT, outputFile=taj-GRN.log, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.149739 -0400 AGENT (debug) Add entity: LogEntity(identity=log/HTTP, module=HTTP, name=log/HTTP, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.149990 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_LS, module=ROUTER_LS, name=log/ROUTER_LS, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.150202 -0400 AGENT (debug) Add entity: LogEntity(identity=log/PYTHON, module=PYTHON, name=log/PYTHON, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.150459 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_MA, module=ROUTER_MA, name=log/ROUTER_MA, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.150681 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONN_MGR, module=CONN_MGR, name=log/CONN_MGR, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.150949 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_HELLO, module=ROUTER_HELLO, name=log/ROUTER_HELLO, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.151172 -0400 AGENT (debug) Add entity: LogEntity(identity=log/SERVER, module=SERVER, name=log/SERVER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.151411 -0400 AGENT (debug) Add entity: LogEntity(identity=log/POLICY, module=POLICY, name=log/POLICY, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.151673 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONTAINER, module=CONTAINER, name=log/CONTAINER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.151943 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AGENT, module=AGENT, name=log/AGENT, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.152198 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ERROR, module=ERROR, name=log/ERROR, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.152471 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_CORE, module=ROUTER_CORE, name=log/ROUTER_CORE, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.152716 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER, module=ROUTER, name=log/ROUTER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.152958 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AUTHSERVICE, module=AUTHSERVICE, name=log/AUTHSERVICE, type=org.apache.qpid.dispatch.log) -2018-10-15 10:57:32.336561 -0400 AGENT (debug) Add entity: RouterEntity(allowUnsettledMulticast=False, area=0, defaultDistribution=balanced, helloIntervalSeconds=1, helloMaxAgeSeconds=3, hostName=taj.localdomain, id=central-qdr-green, mode=interior, raIntervalFluxSeconds=4, raIntervalSeconds=30, remoteLsMaxAgeSeconds=60, saslConfigName=qdrouterd, type=org.apache.qpid.dispatch.router, workerThreads=4) +2018-10-15 10:57:32.149418 -0400 AGENT (debug) Add entity: LogEntity(enable=trace+, identity=log/DEFAULT, includeSource=False, includeTimestamp=True, module=DEFAULT, name=log/DEFAULT, outputFile=taj-GRN.log, type=io.skupper.router.log) +2018-10-15 10:57:32.149739 -0400 AGENT (debug) Add entity: LogEntity(identity=log/HTTP, module=HTTP, name=log/HTTP, type=io.skupper.router.log) +2018-10-15 10:57:32.149990 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_LS, module=ROUTER_LS, name=log/ROUTER_LS, type=io.skupper.router.log) +2018-10-15 10:57:32.150202 -0400 AGENT (debug) Add entity: LogEntity(identity=log/PYTHON, module=PYTHON, name=log/PYTHON, type=io.skupper.router.log) +2018-10-15 10:57:32.150459 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_MA, module=ROUTER_MA, name=log/ROUTER_MA, type=io.skupper.router.log) +2018-10-15 10:57:32.150681 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONN_MGR, module=CONN_MGR, name=log/CONN_MGR, type=io.skupper.router.log) +2018-10-15 10:57:32.150949 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_HELLO, module=ROUTER_HELLO, name=log/ROUTER_HELLO, type=io.skupper.router.log) +2018-10-15 10:57:32.151172 -0400 AGENT (debug) Add entity: LogEntity(identity=log/SERVER, module=SERVER, name=log/SERVER, type=io.skupper.router.log) +2018-10-15 10:57:32.151411 -0400 AGENT (debug) Add entity: LogEntity(identity=log/POLICY, module=POLICY, name=log/POLICY, type=io.skupper.router.log) +2018-10-15 10:57:32.151673 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONTAINER, module=CONTAINER, name=log/CONTAINER, type=io.skupper.router.log) +2018-10-15 10:57:32.151943 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AGENT, module=AGENT, name=log/AGENT, type=io.skupper.router.log) +2018-10-15 10:57:32.152198 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ERROR, module=ERROR, name=log/ERROR, type=io.skupper.router.log) +2018-10-15 10:57:32.152471 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_CORE, module=ROUTER_CORE, name=log/ROUTER_CORE, type=io.skupper.router.log) +2018-10-15 10:57:32.152716 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER, module=ROUTER, name=log/ROUTER, type=io.skupper.router.log) +2018-10-15 10:57:32.152958 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AUTHSERVICE, module=AUTHSERVICE, name=log/AUTHSERVICE, type=io.skupper.router.log) +2018-10-15 10:57:32.336561 -0400 AGENT (debug) Add entity: RouterEntity(allowUnsettledMulticast=False, area=0, defaultDistribution=balanced, helloIntervalSeconds=1, helloMaxAgeSeconds=3, hostName=taj.localdomain, id=central-qdr-green, mode=interior, raIntervalFluxSeconds=4, raIntervalSeconds=30, remoteLsMaxAgeSeconds=60, saslConfigName=qdrouterd, type=io.skupper.router.router, workerThreads=4) 2018-10-15 10:57:32.337966 -0400 SERVER (warning) HTTP support is not available 2018-10-15 10:57:32.338005 -0400 SERVER (info) Container Name: central-qdr-green 2018-10-15 10:57:32.338082 -0400 CONTAINER (trace) Container Initialized @@ -44,22 +44,22 @@ 2018-10-15 10:57:42.866323 -0400 SERVER (trace) [1]:0 -> @begin(17) [remote-channel=0, next-outgoing-id=0, incoming-window=2147483647, outgoing-window=2147483647] 2018-10-15 10:57:42.866441 -0400 SERVER (trace) [1]:0 -> @attach(18) [name="29b38f24-8c87-4964-8a19-0b4f3aa44660", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="collectd/telemetry", durable=0, expiry-policy=:"session-end", timeout=0, dynamic=false], target=@target(41) [durable=0, expiry-policy=:"session-end", timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0] 2018-10-15 10:57:42.866591 -0400 SERVER (trace) [1]:0 <- @flow(19) [next-incoming-id=0, incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647, handle=0, delivery-count=0, link-credit=10, drain=false] -2018-10-15 10:59:07.454660 -0400 AGENT (debug) Add entity: LogEntity(enable=trace+, identity=log/DEFAULT, includeSource=False, includeTimestamp=True, module=DEFAULT, name=log/DEFAULT, outputFile=taj-GRN.log, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.454984 -0400 AGENT (debug) Add entity: LogEntity(identity=log/HTTP, module=HTTP, name=log/HTTP, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.455250 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_LS, module=ROUTER_LS, name=log/ROUTER_LS, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.455460 -0400 AGENT (debug) Add entity: LogEntity(identity=log/PYTHON, module=PYTHON, name=log/PYTHON, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.455720 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_MA, module=ROUTER_MA, name=log/ROUTER_MA, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.455943 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONN_MGR, module=CONN_MGR, name=log/CONN_MGR, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.456202 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_HELLO, module=ROUTER_HELLO, name=log/ROUTER_HELLO, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.456422 -0400 AGENT (debug) Add entity: LogEntity(identity=log/SERVER, module=SERVER, name=log/SERVER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.456658 -0400 AGENT (debug) Add entity: LogEntity(identity=log/POLICY, module=POLICY, name=log/POLICY, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.456926 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONTAINER, module=CONTAINER, name=log/CONTAINER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.457184 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AGENT, module=AGENT, name=log/AGENT, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.457435 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ERROR, module=ERROR, name=log/ERROR, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.457704 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_CORE, module=ROUTER_CORE, name=log/ROUTER_CORE, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.457951 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER, module=ROUTER, name=log/ROUTER, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.458187 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AUTHSERVICE, module=AUTHSERVICE, name=log/AUTHSERVICE, type=org.apache.qpid.dispatch.log) -2018-10-15 10:59:07.583032 -0400 AGENT (debug) Add entity: RouterEntity(allowUnsettledMulticast=False, area=0, defaultDistribution=balanced, helloIntervalSeconds=1, helloMaxAgeSeconds=3, hostName=taj.localdomain, id=central-qdr-green, mode=interior, raIntervalFluxSeconds=4, raIntervalSeconds=30, remoteLsMaxAgeSeconds=60, saslConfigName=qdrouterd, type=org.apache.qpid.dispatch.router, workerThreads=4) +2018-10-15 10:59:07.454660 -0400 AGENT (debug) Add entity: LogEntity(enable=trace+, identity=log/DEFAULT, includeSource=False, includeTimestamp=True, module=DEFAULT, name=log/DEFAULT, outputFile=taj-GRN.log, type=io.skupper.router.log) +2018-10-15 10:59:07.454984 -0400 AGENT (debug) Add entity: LogEntity(identity=log/HTTP, module=HTTP, name=log/HTTP, type=io.skupper.router.log) +2018-10-15 10:59:07.455250 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_LS, module=ROUTER_LS, name=log/ROUTER_LS, type=io.skupper.router.log) +2018-10-15 10:59:07.455460 -0400 AGENT (debug) Add entity: LogEntity(identity=log/PYTHON, module=PYTHON, name=log/PYTHON, type=io.skupper.router.log) +2018-10-15 10:59:07.455720 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_MA, module=ROUTER_MA, name=log/ROUTER_MA, type=io.skupper.router.log) +2018-10-15 10:59:07.455943 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONN_MGR, module=CONN_MGR, name=log/CONN_MGR, type=io.skupper.router.log) +2018-10-15 10:59:07.456202 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_HELLO, module=ROUTER_HELLO, name=log/ROUTER_HELLO, type=io.skupper.router.log) +2018-10-15 10:59:07.456422 -0400 AGENT (debug) Add entity: LogEntity(identity=log/SERVER, module=SERVER, name=log/SERVER, type=io.skupper.router.log) +2018-10-15 10:59:07.456658 -0400 AGENT (debug) Add entity: LogEntity(identity=log/POLICY, module=POLICY, name=log/POLICY, type=io.skupper.router.log) +2018-10-15 10:59:07.456926 -0400 AGENT (debug) Add entity: LogEntity(identity=log/CONTAINER, module=CONTAINER, name=log/CONTAINER, type=io.skupper.router.log) +2018-10-15 10:59:07.457184 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AGENT, module=AGENT, name=log/AGENT, type=io.skupper.router.log) +2018-10-15 10:59:07.457435 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ERROR, module=ERROR, name=log/ERROR, type=io.skupper.router.log) +2018-10-15 10:59:07.457704 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER_CORE, module=ROUTER_CORE, name=log/ROUTER_CORE, type=io.skupper.router.log) +2018-10-15 10:59:07.457951 -0400 AGENT (debug) Add entity: LogEntity(identity=log/ROUTER, module=ROUTER, name=log/ROUTER, type=io.skupper.router.log) +2018-10-15 10:59:07.458187 -0400 AGENT (debug) Add entity: LogEntity(identity=log/AUTHSERVICE, module=AUTHSERVICE, name=log/AUTHSERVICE, type=io.skupper.router.log) +2018-10-15 10:59:07.583032 -0400 AGENT (debug) Add entity: RouterEntity(allowUnsettledMulticast=False, area=0, defaultDistribution=balanced, helloIntervalSeconds=1, helloMaxAgeSeconds=3, hostName=taj.localdomain, id=central-qdr-green, mode=interior, raIntervalFluxSeconds=4, raIntervalSeconds=30, remoteLsMaxAgeSeconds=60, saslConfigName=qdrouterd, type=io.skupper.router.router, workerThreads=4) 2018-10-15 10:59:07.584383 -0400 SERVER (warning) HTTP support is not available 2018-10-15 10:59:07.584421 -0400 SERVER (info) Container Name: central-qdr-green 2018-10-15 10:59:07.584498 -0400 CONTAINER (trace) Container Initialized diff --git a/tools/scraper/test_data/test_data.txt b/tools/scraper/test_data/test_data.txt index 3cda5891c..662433221 100644 --- a/tools/scraper/test_data/test_data.txt +++ b/tools/scraper/test_data/test_data.txt @@ -11,7 +11,7 @@ 2018-07-20 10:58:40.179187 -0400 SERVER (trace) [2]:0 -> @begin(17) [next-outgoing-id=0, incoming-window=2147483647, outgoing-window=2147483647] (/home/chug/git/qpid-dispatch/src/server.c:106) 2018-07-20 10:58:40.180136 -0400 SERVER (trace) [2]:0 <- @attach(18) [name="qdlink.xgqQHT+EqTH14nA", handle=3, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [durable=0, expiry-policy=:"session-end", timeout=0, dynamic=false, capabilities=:"qd.router-data"], target=@target(41) [durable=0, expiry-policy=:"session-end", timeout=0, dynamic=false, capabilities=:"qd.router-data"], initial-delivery-count=0, max-message-size=0] (/home/chug/git/qpid-dispatch/src/server.c:106) 2018-07-20 10:58:40.180171 -0400 SERVER (trace) [2]:0 <- @flow(19) [next-incoming-id=0, incoming-window=2147483647, next-outgoing-id=0, outgoing-window=2147483647, handle=1, delivery-count=0, link-credit=1000, drain=false] (/home/chug/git/qpid-dispatch/src/server.c:106) -2018-07-20 10:58:41.811112 -0400 SERVER (trace) [2]:0 <- @transfer(20) [handle=2, delivery-id=1, delivery-tag=b"\x0f\x00\x00\x00\x00\x00\x00\x00", message-format=0] (320) "\x00SpE\x00Sr\xd1\x00\x00\x00k\x00\x00\x00\x08\xa3\x0bx-opt-qd.to\xa1\x15_topo/0/C/$management\xa3\x0ex-opt-qd.trace\xd0\x00\x00\x00\x09\x00\x00\x00\x01\xa1\x030/A\xa3\x10x-opt-qd.ingress\xa1\x030/A\xa3\x09x-opt-qd.\xa1\x01X\x00Ss\xd0\x00\x00\x002\x00\x00\x00\x06@@@@\xa1$amqp:/_topo/0/A/temp.Q+EzDvtPUeSkHaD\xa0\x0212\x00St\xd1\x00\x00\x00j\x00\x00\x00\x08\xa1\x09operation\xa1\x05QUERY\xa1\x0aentityType\xa1\x1forg.apache.qpid.dispatch.router\xa1\x04type\xa1\x13org.amqp.management\xa1\x04name\xa1\x04self\x00Sw\xd1\x00\x00\x00\x15\x00\x00\x00\x02\xa1\x0eattributeNamesE" (/home/chug/git/qpid-dispatch/src/server.c:106) +2018-07-20 10:58:41.811112 -0400 SERVER (trace) [2]:0 <- @transfer(20) [handle=2, delivery-id=1, delivery-tag=b"\x0f\x00\x00\x00\x00\x00\x00\x00", message-format=0] (320) "\x00SpE\x00Sr\xd1\x00\x00\x00k\x00\x00\x00\x08\xa3\x0bx-opt-qd.to\xa1\x15_topo/0/C/$management\xa3\x0ex-opt-qd.trace\xd0\x00\x00\x00\x09\x00\x00\x00\x01\xa1\x030/A\xa3\x10x-opt-qd.ingress\xa1\x030/A\xa3\x09x-opt-qd.\xa1\x01X\x00Ss\xd0\x00\x00\x002\x00\x00\x00\x06@@@@\xa1$amqp:/_topo/0/A/temp.Q+EzDvtPUeSkHaD\xa0\x0212\x00St\xd1\x00\x00\x00j\x00\x00\x00\x08\xa1\x09operation\xa1\x05QUERY\xa1\x0aentityType\xa1\x1fio.skupper.router.router\xa1\x04type\xa1\x13org.amqp.management\xa1\x04name\xa1\x04self\x00Sw\xd1\x00\x00\x00\x15\x00\x00\x00\x02\xa1\x0eattributeNamesE" (/home/chug/git/qpid-dispatch/src/server.c:106) 2018-07-20 10:58:41.811312 -0400 SERVER (trace) [2]:0 -> @disposition(21) [role=true, first=1, settled=true, state=@accepted(36) []] (/home/chug/git/qpid-dispatch/src/server.c:106) 2018-07-20 10:58:55.893356 -0400 SERVER (trace) [2]:0 -> @close(24) [error=@error(29) [condition=:"amqp:connection:framing-error", description="connection aborted"]] (/home/chug/git/qpid-dispatch/src/server.c:106) 2018-07-20 10:58:55.893366 -0400 SERVER (trace) [2]: <- EOS (/home/chug/git/qpid-dispatch/src/server.c:106) diff --git a/tools/qdmanage b/tools/skmanage similarity index 94% rename from tools/qdmanage rename to tools/skmanage index 68b426742..3f1c710fe 100755 --- a/tools/qdmanage +++ b/tools/skmanage @@ -24,13 +24,13 @@ import json import re from collections.abc import Mapping, Sequence -import qpid_dispatch_site -qpid_dispatch_site.populate_pythonpath() +import skupper_router_site +skupper_router_site.populate_pythonpath() -from qpid_dispatch.management.client import Node -from qpid_dispatch_internal.tools.command import (UsageError, _qdmanage_parser, check_args, - main, opts_ssl_domain, opts_url, opts_sasl) -from qpid_dispatch_internal.management.qdrouter import QdSchema +from skupper_router.management.client import Node +from skupper_router_internal.tools.command import (UsageError, _skmanage_parser, check_args, + main, opts_ssl_domain, opts_url, opts_sasl) +from skupper_router_internal.management.qdrouter import QdSchema INTEGER_TYPE = "integer" @@ -54,11 +54,11 @@ def attr_split(attrstr, qd_schema, type): class QdManage(): def __init__(self): self.qd_schema = QdSchema() - self.prefix = 'org.apache.qpid.dispatch.' + self.prefix = 'io.skupper.router.' self.operations = ['QUERY', 'CREATE', 'READ', 'UPDATE', 'DELETE', 'GET-TYPES', 'GET-OPERATIONS', 'GET-ATTRIBUTES', 'GET-ANNOTATIONS', 'GET-MGMT-NODES', 'GET-SCHEMA', 'GET-LOG'] - self.op = _qdmanage_parser(self.operations) + self.op = _skmanage_parser(self.operations) def clean_opts(self): attr_type = self.opts.type diff --git a/tools/qdstat b/tools/skstat similarity index 94% rename from tools/qdstat rename to tools/skstat index 55fa47a54..d3f225408 100755 --- a/tools/qdstat +++ b/tools/skstat @@ -23,17 +23,17 @@ import sys from datetime import datetime from time import ctime, strftime, gmtime -import qpid_dispatch_site -qpid_dispatch_site.populate_pythonpath() +import skupper_router_site +skupper_router_site.populate_pythonpath() -from qpid_dispatch.management.client import Node -from qpid_dispatch_internal.management.qdrouter import QdSchema -from qpid_dispatch_internal.tools import Display, Header, Sorter, TimeLong, TimeShort, BodyFormat, PlainNum -from qpid_dispatch_internal.tools import NumKMG -from qpid_dispatch_internal.tools.command import (parse_args_qdstat, main, - opts_ssl_domain, opts_sasl, - opts_url) -from qpid_dispatch_internal.compat import UNICODE +from skupper_router.management.client import Node +from skupper_router_internal.management.qdrouter import QdSchema +from skupper_router_internal.tools import Display, Header, Sorter, TimeLong, TimeShort, BodyFormat, PlainNum +from skupper_router_internal.tools import NumKMG +from skupper_router_internal.tools.command import (parse_args_skstat, main, + opts_ssl_domain, opts_sasl, + opts_url) +from skupper_router_internal.compat import UNICODE def get(obj, attr): @@ -109,7 +109,7 @@ class BusManager: return text def displayRouterId(self): - objects = self.query('org.apache.qpid.dispatch.router') + objects = self.query('io.skupper.router.router') router = objects[0] if router: print(router.id) @@ -132,7 +132,7 @@ class BusManager: heads.append(Header("tenant")) rows = [] - objects = self.query('org.apache.qpid.dispatch.connection', limit=self.opts.limit) + objects = self.query('io.skupper.router.connection', limit=self.opts.limit) if not objects: if show_date_id: @@ -196,7 +196,7 @@ class BusManager: heads.append(Header("tenant")) rows = [] - objects = self.query('org.apache.qpid.dispatch.connection', limit=self.opts.limit) + objects = self.query('io.skupper.router.connection', limit=self.opts.limit) if show_date_id: self.display_datetime_router_id() @@ -217,7 +217,7 @@ class BusManager: except: pass - # This is so that, this qdstat can be used against older routers without Python keyerrors + # This is so that, this skstat can be used against older routers without Python keyerrors if has_last_dlv: heads.append(Header("last dlv")) if has_uptime: @@ -307,7 +307,7 @@ class BusManager: heads.append(Header("value")) rows = [] - objects = self.query('org.apache.qpid.dispatch.router') + objects = self.query('io.skupper.router.router') router = objects[0] @@ -342,7 +342,7 @@ class BusManager: # Overall delivery related counts. # These overall statistics were introduced in 1.1 version. - # Wrap these in a try except so that newer versions of qdstat works with older version of router + # Wrap these in a try except so that newer versions of skstat works with older version of router try: rows.append(('Presettled Count', PlainNum(router.presettledDeliveries))) rows.append(('Dropped Presettled Count', PlainNum(router.droppedPresettledDeliveries))) @@ -392,7 +392,7 @@ class BusManager: 'creditAvailable', 'zeroCreditSeconds', 'adminStatus', 'operStatus', 'linkName', 'priority', 'settleRate') - objects = self.query('org.apache.qpid.dispatch.router.link', cols, limit=self.opts.limit) + objects = self.query('io.skupper.router.router.link', cols, limit=self.opts.limit) has_dropped_presettled_count = False has_priority = False @@ -498,7 +498,7 @@ class BusManager: heads.append(Header("neighbors")) heads.append(Header("valid-origins")) rows = [] - objects = self.query('org.apache.qpid.dispatch.router.node', limit=self.opts.limit) + objects = self.query('io.skupper.router.router.node', limit=self.opts.limit) # Find the most recent topo change in this neighborhood. lastTopoChange = 0.0 @@ -553,7 +553,7 @@ class BusManager: 'deliveriesIngress', 'deliveriesEgress', 'deliveriesTransit', 'deliveriesToContainer', 'deliveriesFromContainer', 'name', 'priority') - objects = self.query('org.apache.qpid.dispatch.router.address', cols, limit=self.opts.limit) + objects = self.query('io.skupper.router.router.address', cols, limit=self.opts.limit) has_priority = False @@ -614,7 +614,7 @@ class BusManager: rows = [] cols = ('address', 'direction', 'externalAddress', 'linkRef', 'operStatus', 'lastError') - objects = self.query('org.apache.qpid.dispatch.router.config.autoLink', cols, limit=self.opts.limit) + objects = self.query('io.skupper.router.router.config.autoLink', cols, limit=self.opts.limit) if show_date_id: self.display_datetime_router_id() @@ -655,7 +655,7 @@ class BusManager: 'totalAllocFromHeap', 'heldByThreads', 'batchesRebalancedToThreads', 'batchesRebalancedToGlobal') - objects = self.query('org.apache.qpid.dispatch.allocator', cols) + objects = self.query('io.skupper.router.allocator', cols) if show_date_id: self.display_datetime_router_id() @@ -693,7 +693,7 @@ class BusManager: # this may not be present on all platforms rows = [] try: - objects = self.query('org.apache.qpid.dispatch.router', ['memoryUsage']) + objects = self.query('io.skupper.router.router', ['memoryUsage']) mem = objects[0].memoryUsage except Exception: mem = None @@ -719,7 +719,7 @@ class BusManager: heads.append(Header("value")) rows = [] - objects = self.query('org.apache.qpid.dispatch.policy') + objects = self.query('io.skupper.router.policy') policy = objects[0] @@ -762,7 +762,7 @@ class BusManager: def displayVhosts(self, show_date_id=True): disp = Display(prefix=" ", bodyFormat=self.bodyFormat) - vhosts = self.query('org.apache.qpid.dispatch.vhost') + vhosts = self.query('io.skupper.router.vhost') if len(vhosts) == 0: print("No Vhosts") @@ -799,7 +799,7 @@ class BusManager: def displayVhostgroups(self, show_date_id=True): disp = Display(prefix=" ", bodyFormat=self.bodyFormat) - vhosts = self.query('org.apache.qpid.dispatch.vhost') + vhosts = self.query('io.skupper.router.vhost') schema = self.node.get_schema() vg_schema = schema['entityTypes']['vhostUserGroupSettings']['attributes'] @@ -878,7 +878,7 @@ class BusManager: def displayVhoststats(self, show_date_id=True): disp = Display(prefix=" ", bodyFormat=self.bodyFormat) - vstats = self.query('org.apache.qpid.dispatch.vhostStats') + vstats = self.query('io.skupper.router.vhostStats') if len(vstats) == 0: print("No Vhost Stats") @@ -1003,7 +1003,7 @@ class BusManager: def run(argv): - args = parse_args_qdstat(BusManager) + args = parse_args_skstat(BusManager) bm = BusManager(args) try: bm.display()