Program a Vuser script on Linux
LoadRunner Professional provides a base template for manually programming and compiling a Vuser script on Linux.
Create script from the template
LoadRunner Professional includes a utility on Linux that copies a template into your working folder. The utility is called mkdbtest, and is located in $M_LROOT/bin. You run the utility by typing:
When you run mkdbtest, it creates a folder called name, which contains the template file, name.c.
For example, if you type:
mkdbtest creates a folder called test, which contains the template script, test.c.
In addition to the folder and the template script file, mkdbtest also creates files called test.usr, test.cfg and makefile, where test is the name you specified for
Manually compile the script
After you modify the template, you compile it with the appropriate Makefile in the script's folder. 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 folder 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.