Program a Vuser script on Linux
LoadRunner Professional provides a base template for manually programming and compiling a Vuser script on Linux.
Create a script from the template
LoadRunner Professional 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:
This creates a directory using the defined name, containing the template script file name.c, plus additional files.
creates a directory called test, which contains the template script file test.c, and the files test.usr, test.cfg, and makefile.
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 Vuser script from a Linux command line.