Squish for Qt: Execute Shell-Like commands on Remote Host

Important: The following information applies for Squish for Qt only.

Squish allows you to do remote testing with the squishrunner running on one host and squishserver (that starts your AUT) on another host. The script interpreter is living in the squishrunner process. So all script commands are executed on the first host and not on the second host that is running your AUT. Only Qt objects (and function you execute on them) are forwarded to the second host and are executed there.

So if you create e.g. a Python file object in your test script, you can only access the file system of the first host. But if you create a QFile object, you can actually access the file system of the second host. But for this to work, the AUT has to be running. And you need some knowledge of the Qt API.

In froglogic we use a dummy application that provides simple shell-like features that are actually executed on the remote host. So if you need such a functionality, read on to find out how to use this in your own test setting.

First, you have to download the source code for the shellhelper application:

Shell helper source

You need to compile this (including the squishidl steps). If you are building Squish from sources, it is easiest if you simply unpack the .zip file into your Squish’s source directory. Then you need to edit the Builddir file and add one line at the end of the file:

shellhelper

If you now call build in the Squish directory, it builds the shellhelper application (a commandline application) and the wrapper library for some classes in the shellhelper application. (If you don’t use a Squish source package, you have to integrate the build steps into your own build system.)

If you want to use it in your test script (provided that you use Python as your scripting language), grab the remoteshell.py.txt file, rename it to remoteshell.py (the blog system did not allow me to upload a Python script for security reasons) and put it into your shared scripts directory.

Now you can create an instance of the class RemoteShell and use commands like mkdir() or execute() on the object to create a directory or execute a subprocess on the remote host.

4 Responses to “Squish for Qt: Execute Shell-Like commands on Remote Host”

  1. sagar Says:

    I don’t understand how you are building shellhelper, I tried it but the instructions don’t seem to work out? What do you mean by call ‘build’ in the Squish directory? There is no such file.

    I’d really like to try this out.

  2. Rainer Schmid Says:

    Are you using a Squish source package? Calling “build” only works in the source package. If you are not using a source package, you have to convert the build steps from the Buildsub to whatever build system you would like to use.

  3. Ravibabu Says:

    I am not able to download the files remoteshell.py.txt or shell helper source. Please let me know the proper links to download the above sources.

Leave a Reply

You must be logged in to post a comment.