IBM Support

Running tests from the command line on Linux

Troubleshooting


Problem

Attempts to run IBM Rational Performance Tester (RPT) and Rational Test Workbench (RTW) components to schedule and test from the command line on Linux fails if no X server is available.

Symptom

You are unable to run a test or schedule from the command line on a Linux computer with no X server. The Java traceback includes the following:

Caused by: org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
        at org.eclipse.swt.SWT.error(SWT.java:3803)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:855)
        at org.eclipse.swt.widgets.Display.create(Display.java:843)

Cause

Even though RPT/RTW does not open any GUI windows when run from the command line on Linux, several of the RPT/RTW components depend on the X server. For example, this can occur on computers with no physical display device.

Note: Setting the DISPLAY variable does not resolve the problem.

Diagnosing The Problem

Check that the DISPLAY environment variable is set, either directly or by running xterm:

$ echo $DISPLAY

$ xterm
xterm Xt error: Can't open display:
xterm:  DISPLAY is not set
$

Resolving The Problem

Use the X virtual framebuffer (Xvfb) to provide the necessary components to run tests from the command line on Linux on computers with no physical display device.

The Xvfb package is bundled with most Linux distributions. See the documentation for your Linux distribution to find out how to install and use Xvfb.

Using Xvfb

On any of the supported distributions of Linux, as a non-root user, launch Xvfb:

$ Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
$ export DISPLAY=:5

The values for display number, screen, resolution and depth are arbitrary. RPT/RTW does not require specific values for the display number, screen, resolution, or depth.

The xlsclients utility lists client applications that are running on a display. A warning might be displayed when you run the xlsclients utility. This same warning is reported when RPT/RTW accesses the X Server. These warning messages can be ignored.

$ xlsclients
FreeFontPath: FPE "unix/:7100" refcount is 2, should be 1; fixing.

On SUSE Linux Enterprise 10 or Red Hat Enterprise Linux 4, you might see the following messages:

Could not init font path element /usr/X11R6/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!

You can now run RPT/RTW from the command line. During execution, the same font warning messages are displayed:

...
Parameters accepted, starting the test run.
Instantiated adapter with /opt/IBM/SDP
FreeFontPath: FPE "unix/:7100" refcount is 2, should be 1; fixing.
February 3, 2010 10:47:20 PM EST
Test execution completed in 113.448 seconds.
$

To stop Xvfb cleanly, use the kill command to send the SIGTERM signal.

If another application is using the same DISPLAY value, a useful message is displayed:

$ Xvfb :1019 -fp /usr/share/X11/fonts/misc -screen 0 1280x1024x8 -fbdir /tmp

Fatal server error:
Server is already active for display 1019
        If this server is no longer running, remove /tmp/.X1019-lock
        and start again.

unlink: No such file or directory
unlink  failed, errno 2

A sample shell script is attached, which demonstrates starting and stopping Xvfb for command-line execution.

Disclaimer

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.



run-cmdline-with-Xvfb.zip

[{"Product":{"code":"SSMMM5","label":"IBM Rational Performance Tester"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Test Execution","Platform":[{"code":"PF016","label":"Linux"}],"Version":"6.1;6.1.0.1;6.1.1;6.1.2;7.0;7.0.0.1;7.0.0.2;7.0.1;7.0.1.1;7.0.1.2;7.0.2;7.0.2.1;7.0.2.2;7.0.2.3;8.0;8.0.0.1;8.0.0.2;8.0.0.3;8.1;8.1.0.1;8.1.0.2;8.1.0.3;8.1.1;8.1.1.1;8.1.1.2;8.2;8.2.0.1;8.2.0.2","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SSBLQQ","label":"Rational Test Workbench"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General Information","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21421214