beakerlib-virtualX - Man Page

virtualX ā€” Helpers for handling virtual X server

Description

This module provides a simple way to start and stop virtual X server (framebuffer).

Functions

Virtual X Server

Functions providing simple way how to start and stop virtual X server.

rlVirtualXStart

Start a virtual X server on a first free display. Tries only first N displays, so you can run out of them.

    rlVirtualXStart name [N]
name

String identifying the X server.

N

Maximum number of displays to try. Defaults to 3.

Returns 0 when the server is started successfully.

rlVirtualXGetDisplay

Get the DISPLAY variable for specified virtual X server.

    rlVirtualXGetDisplay name
name

String identifying the X server.

Displays the number of display where specified virtual X server is running to standard output. Returns 0 on success.

rlVirtualXStop

Kill the specified X server.

    rlVirtualXStop name
name

String identifying the X server.

Returns 0 when the server is stopped successfully.

Example

Below is a simple example of usage. Note that a lot of usefull debugging information is reported on the DEBUG level, so you can run your test with DEBUG=1 make run to get them.

    rlVirtualXStart $TEST
    rlAssert0 "Virtual X server started" $?
    export DISPLAY="$( rlVirtualXGetDisplay $TEST )"
    # ...your test which needs X...
    rlVirtualXStop $TEST
    rlAssert0 "Virtual X server killed" $?

These are "Requires" lines for your scripts - note different package names for different RHEL versions:

    @echo "Requires: xorg-x11-server-Xvfb" >> $(METADATA) # RHEL-5
    @echo "Requires: xorg-x11-Xvfb"        >> $(METADATA) # RHEL-4
    @echo "Requires: XFree86-Xvfb"         >> $(METADATA) # RHEL-3

Authors

Info

2024-11-06 perl v5.40.0 User Contributed Perl Documentation