Calling Eggplant script from Windows Box

We have a Windows orchestration tool that we use to run all of our automation in the correct order. We are trying to find a solution to kick off an Eggplant test suite that we can start from a Windows box. My original thought was to use the Eggplant command line from a Putty session on the Windows box to start the test suite, but I get an error saying I must either be the Root user or a console user.
My preference would be to get at least a return code from Eggplant, but if nothing else I could be happy just calling the test suite from the Windows machine.

Thanks in advance,

Geremy

Hello Geremy–

You should be able to SSH via Putty (I used to do this in my previous job as an Eggplant tester) into the account on the Eggplant machine that the scripts reside in and kick them off. You just need to make sure that you provide the full path to runscript (typically /Applications/Eggplant.app/runscript) with the full path to the script(s) to run.

It would probably also be a good idea to set up an SSH keypair between your windows machine and your Eggplant machine (make sure you use the account that the scripts were created in) so that you wouldn’t have to authenticate with the password each time you connect.

Runscript does return a success code or failure code based on whether the script passes or fails.

Thanks Allen. I should have provided more information. I have tried that, I’m connecting to the Eggplant via Putty using SSH on port 22.

Here is the command I’m trying to run: /Applications/Eggplant.app/runscript /Volumes/DataVol/sandbox/ggibson/TestSuite1.suite/Scripts/Ghost.script -host TOOLSGROUP1 -port 5900 -password password

When I run this from Putty I get the following error:
kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only
INIT_Processeses(), could not establish the default connection to the WindowServer.Abort trap

If I’m running from the Eggplant Connector via a terminal and I run the same command with the same credentials it works as expected.

The only way I can get this to work from Putty is to run the command with sudo in front of it with a root user. This is not a good solution as everyone would have to have a root account. How can I run this a regular Eggplant user, as I can from the Eggplant Connector?

Thanks,

Geremy

Hi Geremy–

Sorry I didn’t get back to you sooner.

There are a couple of different ways to approach this. Eggplant needs a connection to the WindowServer, which can only be done by a user on the system. This can be accomplished a couple of different ways:

  1. You can run as root using sudo (as you have discovered)
  2. You can run from within that user session, ie don’t use SSH
  3. Or, you can set up the Eggplant application to run using the setUID flag. There are good instructions here for doing that.

To underscore some points in the post I linked to, setting Eggplant up as you would in either scenarios 1 or 3 will have some side effects that come along with elevating permissions, but at least in #3 the changes will be localized to Eggplant itself.

I hope this helps.