Question For Sensetalk Doug

We are running multi-product integrated tests (all products talking to one another). Each product is using a different SUT and we test using four SUTs at the same time.

We are setting up a framework that allows us to run tests in an infinite loop (if needed) with a CICD pipeline.

We use RHEL 8 and Eggplant Functional 22.4.0.r3-Linux-64.

When running these tests with the CICD pipeline, we will be running Eggplant from the command line with a cron job. Eggplant needs to communicate with the X server, so in our bash script, we used export DISPLAY=$(w -h $USER | awk ‘$3 ~ /:[0-9.]*/{print $3}’) to grab the users display variable. Every user machine has a different one, so we need to grab it from whatever user is running the bash script.

Right now, we are just passing the display variable as DISPLAY=:0.0 for example. It seems to work and the Eggplant scripts are running, but we have only been testing this with a “Framework” test that “connects” to the SUT and runs a wait command and then disconnects and ends the test.

We are concerned that we may need to pass the host and the port of the SUT to the display variable for four different SUTs in our Linux environment. We won’t be able to do that, because there is only one linux display variable.

QUESTIONS

When setting up the display variable in linux to give Eggplant a display to look at for the X server communication, would we need to feed in the host and port of the SUT display (example: DISPLAY=sut_variable.5901) or will using our local display number (example: DISPLAY=:1) work for Eggplant communicating with the X server?

Does Eggplant care about the display variable for the SUT or do we just need to give it any display variable?

Isn’t that more of a question about how VNC supports different displays? I would expect that you would have to pass your local display number as an environment variable on the command line that executes the runscript command, i.e $ export DISPLAY=:1;runscript $SCRIPTARGS …

Just to be clear in the intention behind that statement, every process can start to execute with a different value for an environment variable if the variable is set appropriately when the command is executed, it isn’t the case that there is only one linux display variable per host, there is only one per running process (which can be changed using setenv() to a different value within the process). The value of the display variable has to correctly identify the vncserver port being listened to by vncserver, so if you have two vncserver processes the first may be listening on 5901, the second on 5902, and so on - you can’t use a random number for the value - but I’m sure you’d spotted that. I think the basic answer requires a read of the manual page for (1) vncserver in the unix manuals.

2 Likes