Package: cdrouter
cdrouterSimple Python wrapper for the CDRouter Web
API.https://support.qacafe.com/cdrouter/cdrouter-web-api/For more information on CDRouter, please visithttp://www.qacafe.com/.Installing/Upgradingcdrouter is available on PyPI.  To install the latest stable version from PyPI:$pipinstall-Ucdroutercdrouter supports Python 3.5 or newer.DocumentationSeehttp://cdrouterpy.readthedocs.io/.Unit TestsUnit tests for cdrouter.py are written using pytest
(https://docs.pytest.org) and run with tox (https://tox.wiki).  Each
test starts up an ephemeral CDRouter Docker container to test against.
Tests are stored in thetests/directory.  The following tooling
is required to run the unit tests:Docker must be installed and thedockercommand runnable by the
current user.  Follow the official install instructions
(https://docs.docker.com/engine/install/) to ensure this is the
case.Python 3.8 must be installed with apython3.8binary available
in yourPATH.toxmust be installed viapip3:$pip3install-UtoxIf you do not already havepip3installed, follow the official
install instructions (https://pip.pypa.io/en/stable/installation/)
or use theget-pip.pyscript below to perform the installation
automatically:$curl-shttps://bootstrap.pypa.io/pip/get-pip.py|python3The unit tests are controlled by a number of a environment variables,
some required while others are optional.  Optional environment
variables are listed further below.  The required environment
variables are:CDR_DOCKER_IMAGE: The CDRouter Docker image to use to test
against.  The unit tests automatically create and teardown Docker
containers running this image during testing.  Its value should be a
Docker image name that can be passed directly todocker run.  A
good default is:CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latestwhich should always be the latest CDRouter release.CDR_DOCKER_LICENSE: The base64-encoded contents of a CDRouter
license file with all addons enabled to be used in the CDRouter
Docker containers which are created during testing.  If the CDRouter
license file to be used exists at/path/to/cdrouter.lic, set
this variable to:CDR_DOCKER_LICENSE=$(base64-w0/path/to/cdrouter.lic)Finally, run the unit tests via:$CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest\CDR_DOCKER_LICENSE=$(base64-w0/path/to/cdrouter.lic)\tox-pThis will both lint the codebase usingpylintand run all unit
tests.  You may sometimes want to run only a subset of tests.  To run
just the tests intests/test_configs.py, run:$CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest\CDR_DOCKER_LICENSE=$(base64-w0/path/to/cdrouter.lic)\tox-epy38--tests/test_configs.pyTo run just thetest_listtest in theTestConfigsclass oftests/test_configs.py, run:$CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest\CDR_DOCKER_LICENSE=$(base64-w0/path/to/cdrouter.lic)\tox-epy38--tests/test_configs.py::TestConfigs::test_listBelow are the optional environment variables used by the unit tests:CDR_DOCKER_PULL: By default, the unit tests will ensure the
Docker image specified byCDR_DOCKER_IMAGEis present and up to
date via a call todocker pull.  Sometimes this isn’t necessary
or desired, in which case settingCDR_DOCKER_PULL=0will cause
the unit tests to skip this step and assume the Docker image is
already present and up to date.  SettingCDR_DOCKER_PULL=0is
often necessary ifCDR_DOCKER_IMAGEis set to a locally-built
image rather than one pulled down from a Docker registry.CLOUDSHARK_URL&CLOUDSHARK_TOKEN: These variables specify
the URL and valid API token of a CloudShark appliance.  If these are
not set, tests which require uploading capture files to a CloudShark
appliance are skipped.RUN_LOUNGE_TESTS,LOUNGE_EMAIL,LOUNGE_URL&LOUNGE_INSECURE: By default, tests which require communicating
with the QA Cafe Lounge are skipped.  These tests can be run by
settingRUN_LOUNGE_TESTS=1, in which caseLOUNGE_EMAILmust
be set to a valid email address for a contact in same Lounge account
as the CDRouter license stored inCDR_DOCKER_LICENSE.
Additionally,LOUNGE_URLandLOUNGE_INSECUREcan be used to
have the tests talk to a non-production Lounge.