Vuser scripts on Linux

You can use Windows Vuser scripts on Linux. You can also use a base template for manually programming and compiling a Vuser script on Linux.

About using Vuser scripts on Linux

You can use Vuser scripts on a Linux environment in the following ways:

  • You can use VuGen to create Vuser scripts that run on Linux platforms. You record your application in a Windows environment and run it in Linux. Recording is not supported on Linux.

Note: VuGen provides a tool to check the compatibility of your script to run on Linux-based load generators. For details, see Check Linux compatibility.

  • Users working in Linux-only environments can program Vuser scripts. Scripts can be programmed in C or C++ and they must be compiled into a dynamic library.

    To create a script through programming, you can use a Vuser template as a basis for larger Vuser scripts. The template provides:

    • Correct program structure
    • Vuser API calls
    • Source code and makefiles for creating a dynamic library

Back to top

Create a script from the template

The product installation includes a utility on Linux that copies a template into your working directory. The utility is called mkdbtest, and is located in $M_LROOT/bin. You run the utility by typing:

mkdbtest  name

This creates a directory using the defined name, containing the template script file name.c, plus additional files.

For example, mkdbtest test creates a directory called test, which contains the template script file test.c, and the files test.usr, test.cfg, and makefile.

Back to top

Manually compile the script

After you modify the template, you compile it with the appropriate Makefile in the script's directory. The compiler creates a dynamic library called libtest.so.

You can modify the Makefile and assign additional compiler flags and libraries by modifying the appropriate sections.

If you are working with a general template, you must include your application's libraries and header files. For example, if your application uses a library called testlib, include it in the LIBS section.

LIBS         = \
    -testlib \
    -lLrun50 \
    -lm

After you modify the Makefile, type make from the command line in the working directory, to create the dynamic library files for the Vuser script.

After you create a script, you check its functionality from the command line. Check that your script communicates with the server and performs all the required tasks. For details, see Run a script from a Linux CLI.

Back to top

See also: