Configuring stubs to connect to Rational® Test Control Panel and the HTTP proxy

A stub running on its own may not be sufficient in some cases, because it might have dependencies on services such as Rational® Test Control Panel or the HTTP proxy. If the stub is running on the public cloud and the services are running in the enterprise, you must configure the stub to connect to these services.

There are many ways in which you can establish communication between the services - for example, by using SSH reverse tunneling or a virtual private network. An example of how to configure the stub to connect to the services by using the SSH reverse tunneling method is as follows:

Assumptions
  • The stub makes available an HTTP transport using port 80.
  • The stub's HTTP transport is configured to use localhost:3128 as a proxy for pass-through.
  • The stub is configured to connect to Rational® Test Control Panel on localhost:5443.
Procedure
  1. In the enterprise, use SSH to connect to the public cloud instance. This creates tunnels for the stub to connect to Rational® Test Control Panel and the HTTP proxy.
    ssh -R 5443:${RTCP_ENDPOINT} -R 3128:${HTTP_PROXY_ENDPOINT} ${DOCKER_HOST_IP}
  2. Start the stub image by using the following command:
    docker run --net=host -p 80:80 -e RULE_HOST=${DOCKER_HOST_IP} -e RTVS_METRIC_MODE=OFF ${DOCKER_IMAGE}
    where, --net=host makes the ssh tunnels accessible to the docker container, and RTVS_METRIC_MODE=OFF switches off metrics reporting.
    For example:
    docker run --net=host -p 80:80 -e RULE_HOST=mydockerhost.local -e RTVS_METRIC_MODE=OFF dockerimage

    For information about the docker run command, see Running stubs in a Docker container.