PrkwyDrv
PrkwyDrv

Reputation: 1

Setting up a Windows agent for Jenkins to work with Squish

Rather an answer than a question, but I thought there might be other people running into the same issue.

Thus I want to document and share the solution I found here:

We have been using Squish to test our Qt based application on Windows agents, orchestrated by Jenkins. The problem is the following: Since Java Web start was dropped as a connection method, the recommended solution is to connect agents via SSH to Jenkins. However, connecting via SSH to a Windows agent, there will be no Desktop/UI session. It is possible to execute Squish, but the results are not representative and often enough unexpected errors will happen, since there is no real UI of the AUT. Simply running the agent.jar with the jnlp as argument will also not work, due to additional redirections and authentication in our network.

Upvotes: 0

Views: 365

Answers (1)

PrkwyDrv
PrkwyDrv

Reputation: 1

Solution:

  1. Make sure, the Instance Identity plugin is installed in your Jenkins instance.
  2. Configure the agent to use "Launch agent by connecting it to the controller" as launch method.
  3. Save and go back to the Status page of the agent. It will be disconnected and there are instructions on how to connect it.
  4. Manually download the agent.jar and the jnlp file for this agent.
  5. Copy the agent.jar to the agent's file system.
  6. On the agent machine, call the following command from a cmd:
java -cp agent.jar hudson.remoting.jnlp.Main PASTE_SECRET_FROM_JNLP PASTE_NODE_NAME_FROM_JNLP PASTE_ALL_OTHER_ARGUMENT_AND_VALUES_FROM_JNLP -direct JENKINS_HOST:TCP_PORT -instanceIdentity INSTANCE_IDENTITY

Most of the values in capital can be found inside the jnlp file (which is plain xml), except the Jenkins' hostname and tcp port for agent connections. Further, the instance identity can be found out by posting a GET request to the top-level Jenkins address, e.g. https://host.name/jenkins/.

Preferably, a batch file containing the command is created and copied into shell:startup to ensure connection to Jenkins on startup.

Upvotes: 0

Related Questions