Menu

qTest Automation Host 2.x Installation Guide on Linux

In this article, we will walk you through how to install the qTest Automation Host version 2.x on a Linux machine.

Download qTest Automation Host 2.x

  1. From the Download Automation Host page, download the qTest Automation Host 2.x for Linux. It is highly recommended that you download the latest 2.x version to benefit from bug fixes and enhancements.
  2. Open the Terminal.
  3. Move the downloaded file agentctl-[version]-linux-x64-full.tgz to /usr/local directory:
    $ sudo mv agentctl-[version]-linux-x64-full.tgz /usr/local
    Notes:
    • You can move the package to /usr/local or wherever you'd like; sudo is only needed depending on the location it will be moved.
    • Replace [version] in the command to the actual version that you have chosen to download, e.g. 2.0.1
  4. Change the current directory to /usr/local:
    $ cd /usr/local
  5. Extract the bundle:
    $ tar -zxf agentctl-[version]-linux-x64-full.tgz
  6. Change the current directory to the extracted agentctl:
    $ cd agentctl-[version]

Acquire your qTest API Token

  1. Login to qTest Manager as an Administrator and access to the Resources page.
  2. Expand the APIs and SDK section.
  3. Copy the API Token, as shown below.

token.png

Install and Configure the Automation Host

Execute the following command to install and configure the Automation Agent.

/usr/local/agentctl-[version]$ ./agentctl config -Phost=[ip_address] -Pport=[agent_port] -Pqtest.url=[qtest_url] -Pqtest.token=[qtest_token] -Pproxy.enable=[true|false] -Pproxy.host=[proxy_host] -Pproxy.port=[proxy_port] -Pproxy.username=[proxy_username] -Pproxy.password=[proxy_password] -Pproxy.script=[proxy_script_url]

Command Parameters and Descriptions:

Parameter Name Description
 config Execute the configuration command.
-Phost IP address or hostname or domain name of this machine. If this parameter is omitted, the agent will use the current IP address of this machine.
-Pport

Specify a port that your automation host will be running. If this parameter is omitted, port 6789 will be used.

-Pqtest.url URL of your qTest Manager instance.
-Pqtest.token The qTest API token generated for your qTest Manager account. You can copy it from API & SDK section in qTest Manager's Resource page.
-Pproxy.enable Possible value is true or false. If the value is set to true, you will need to provide proxy settings, otherwise, set it to false or you can discard this parameter.
-Pproxy.host The IP address or machine name of the proxy server. This parameter and value are required when -Pproxy.enable is set to true.
-Pproxy.port The port that the proxy server is running on. This parameter and value are required when -Pproxy.enable parameter is set to true.
-Pproxy.username If your proxy server requires basic authentication, enter the username to authenticate with the proxy.
-Pproxy.password If your proxy server requires basic authentication, enter the password to authenticate with the proxy.
-Pproxy.script If your proxy server is configured with a script, enter the URL to access your PAC (Proxy Auto-Configuration) file.

Configure qTest Automation Host without a Proxy

The EXAMPLE command below shows how to configure the qTest Automation Host 2.x in a non-proxy environment. The values for each parameter are highlighted in bold.

/usr/local/agentctl-[version]$ ./agentctl config -Phost=192.168.76.29 -Pport=6789 -Pproxy.enable=false -Pqtest.url=https://demo.qtestnet.com -Pqtest.token=c2FuZGJveHxodXluZ3V5ZW5AcWFzeW1wFAqrrAWEdOEsdqOTODRSFwNTMxODhlZDY5NTg2ZmMyYzA2NDA5MWNmMQ

Configure qTest Automation Host with Proxy Settings

The EXAMPLE command below shows how to configure the qTest Automation Host 2.0 in a proxy environment. The values for each parameter are highlighted in bold.

If your proxy does not require authentication:

/usr/local/agentctl-[version]$ ./agentctl config -Phost=192.168.76.29 -Pport=6789 -Pqtest.url=https://demo.qtestnet.com -Pqtest.token=c2FuZGJveHxodXluZ3V5ZW5AcWFzeW1wFAqrrAWEdOEsdqOTODRSFwNTMxODhlZDY5NTg2ZmMyYzA2NDA5MWNmMQ -Pproxy.enable=true -Pproxy.host=192.168.76.138 -Pproxy.port=3128

If your proxy does require basic authentication with a username and password:

/usr/local/agentctl-[version]$ ./agentctl config -Phost=192.168.76.29 -Pport=6789 -Pqtest.url=https://demo.qtestnet.com -Pqtest.token=c2FuZGJveHxodXluZ3V5ZW5AcWFzeW1wFAqrrAWEdOEsdqOTODRSFwNTMxODhlZDY5NTg2ZmMyYzA2NDA5MWNmMQ -Pproxy.enable=true -Pproxy.host=192.168.76.138 -Pproxy.port=3128 -Pproxy.username=proxyuser@qasymphony.com -Pproxy.password=s0mething#0923

Your proxy is configured with a script:

/usr/local/agentctl-[version]$ ./agentctl config -Phost=192.168.76.29 -Pport=6789 -Pqtest.url=https://demo.qtestnet.com -Pqtest.token=c2FuZGJveHxodXluZ3V5ZW5AcWFzeW1wFAqrrAWEdOEsdqOTODRSFwNTMxODhlZDY5NTg2ZmMyYzA2NDA5MWNmMQ -Pproxy.enable=true -Pproxy.script=https://proxytestlab.sampleproxy.com/proxy.pac

Note: If you specify both a script-based proxy server and a proxy server host, the Automation Host will connect to THE script based one first, then connect to the proxy host when the connection to script based one was failed.

SSL Proxy Configuration

If your organization uses an SSL proxy that alters all certificates on the internet to your own certificate that is not trusted by our embedded Java, you need to add your own certificate to the default cacerts keystore.

In order to accomplish that, run the following command:

./server-jre/bin/keytool -import -noprompt -trustcacerts -alias <AliasName> -file <certificate> -keystore ./server-jre/jre/lib/security/cacerts -storepass changeit

  • <AliasName> an alias for this certificate
  • <certificate> the path to your certificate

IMPORTANT: Add System Environment Variable

Open the Terminal and execute this command to identify your Java version:
$ java -version

If the execution result showing your machine is running Java whose version is between 1.8.0_77 and 1.8.0_151, you must add an environment variable to make proxy with basic authentication work properly following the steps below:

  1. Run the command below to edit the bash_profile file:
    $ vi ~/.bash_profile
  2. Add this line to the bash_profile file:
    export JAVA_TOOL_OPTIONS=-Djdk.http.auth.tunneling.disabledSchemes=""
    The image below shows how your updated bash_profile file will look like.bash_profile.png
  3. Save the file when you're done.
  4. Next, execute the command below to load the updated bash_profile:
    $ source ~/.bash_profile
  5. Verify the variable is loaded:
    $ echo JAVA_TOOL_OPTIONS
  6. If you see the output -Djdk.http.auth.tunneling.disabledSchemes= printed in the Terminal, then you have successfully added a new environment variable.

Start the Automation Host

To start the automation host, run start command with the optional -Phostname parameter. (Entered during the Installation and Congifuration of the Automation Host.)
Note: If you do not specify a -Phostname parameter, the default host name is set to "Sample Agent".

/usr/local/agentctl-[version]$ ./agentctl start -Phostname="[agent_host_name]"

Example:

/usr/local/agentctl-[version]$ ./agentctl start -Phostname="My Automation Host Name"

Access qTest Automation Host

Open your browser and enter the URL: http://<host>:<port>

Install the Automation Host as a Service

Access the agentctl directory and execute following commands:

/usr/local/agentctl-[version]$ ./agentctl stop
/usr/local/agentctl-[version]$ sudo ./install
/usr/local/agentctl-[version]$ sudo systemctl status qtest-automation-agent

Uninstall Service

If you want to uninstall the  Automation Agent 2.x service, open the Terminal and execute the following commands:

/usr/local/agentctl-[version]$ sudo ./uninstall
/usr/local/agentctl-[version]$ sudo systemctl status qtest-automation-agent

Subscribe To Our Blog
Powered by Zendesk