Scripting

Top  Previous  Next

BurnInTest includes a simple scripting language that allows tests to be executed in a sequence.

A PASS/FAIL indication for all of the tests included in the script can be displayed at the end of the scripted test run. To achieve this you should select “Accumulate logs until manually cleared” from the Logging Preferences and results should be cleared before or at the start of the scripted test run.

 

Script files are ASCII text files that you can create with a text editor (e.g. notepad). The file name must end with the extension ‘.bits’. To start a script use the ‘Test / Execute script’ menu item.

 

Each script command must appear on its own line in the text file and the entire command must appear on a single line. (i.e. a single command can not be split across multiple lines).

 

The command and its parameters must be separated by one or more spaces. Comments can be included by starting the line with the ‘#’ character.

 

The scripting is similar to the Windows version of BurnInTest but a few keywords are not available (REBOOT, REBOOTEND, SETPLUGIN, EXECUTEWAIT).

The following commands are available in the current version of the software

 

EXECUTE COMMAND

Overview:

Executes an external file and continues processing the script.

 

Syntax:

EXECUTE <Filename> <Parameters>

 

Parameters:

<Filename>                The name of the file to execute. The file name must be enclosed in double quotes (“”). The file must be an executable.

<Parameters>        Any command line parameters which you wish to pass to your executable. Each new parameter should be separated with a ',' character , eg param1,param2.

 

Examples:

#Start up text editor with some results before starting tests.

EXECUTE "/usr/bin/emacs" "/tmp/doc.txts"

RUN CONFIG

 

EXIT COMMAND

Syntax:

EXIT

 

Parameters:

none        

Note: BurnInTest will exit with a return code indicating whether the tests run during the script passed or failed. An exit code of 0 means SUCCESS, while and exit code of 1 means FAILURE.

 

Examples:

RUN CONFIG

#Exit BurnInTest and return an exit code to the batch file

EXIT

 

LOAD COMMAND

Syntax:

LOAD  "<File name>"

 

Parameters:

<File name>        The full path name to a configuration file. This configuration file is expected to be in BurnInTest binary format (previously created from within BurnInTest GUI version). A partial path name can be used to load a configuration file from the BurnInTest executable directory. A loaded configuration file will over write all preferences currently selected.  The file name must be enclosed in double quotes (“”)

 

Examples:

#Load the low load configuration file that we created earlier

LOAD “/tmp/LowLoad.bitcfg”

 

 

LOADXML COMMAND

Syntax:

LOADXML  "<File name>"

 

Parameters:

<File name>        The full path name to a configuration file. This configuration file is expected to be in BurnInTest text format, such as one created for use with the BurnInTest command line version. A partial path name can be used to load a configuration file from the current BurnInTest executable directory. A loaded configuration file will over write all preferences currently selected.  The file name must be enclosed in double quotes (“”)

 

Examples:

#Load the low load configuration file that we created earlier

LOAD “/tmp/LowLoad.txt

 

LOG COMMAND

Overview:

Writes text to the detailed error and status log history.

 

Syntax:

LOG <Text>

 

Parameters:

Text        The text to be added to the detailed error and status log history.

 

Examples:

#Start an S1 sleep and log the start and stop times

LOG "Sleep S1 Duration 60 seconds starting"

EXECUTEWAIT SLEEPER -S1 -D 60

LOG "Sleep S1 Duration 60seconds complete"

 

LOOP

Syntax:

LOOP <number of iterations>

 <Tasks to repeat>

}

 

Parameters:

< number of iterations >        The number of times the Tasks within brackets will be repeated.

 

Examples:

LOG "Start"

SETDURATION 1

LOOP 3

 LOG "CPU Test"

 RUN MMX

}

 

SETDURATION COMMAND

Syntax:

SETDURATION  <Duration>

 

Parameters:

<Duration>        Sets the test duration in minutes. Using this command is the same as changing the auto-stop period from the preferences window.

 

Examples:

#Set the test duration to 90 seconds

SETDURATION  1.5

 

SETCYCLES COMMAND

Syntax:

SETCYCLES <Number of test cycles>

 

Parameters:

< Number of test cycles >        Sets the number of test cycles that will lead to an automatic stopping of the test runs after all selected tests have reached or exceeded this number of test cycles. Using this command is the same as changing the auto-stop number of cycles from the preferences window.

 

Examples

#Set the number of test cycles to 1

SETCYCLES 1

 

#Run each test one cycle in series.

SETCYCLES 1

SETDURATION 0

LOG "Run Maths Test”

RUN MATHS

LOG "Run MMX Test”

RUN MMX

Etc…

 

SETDUTYCYCLE COMMAND

Syntax:

SETDUTYCYCLE  <Test Name>  <Duty setting>

 

Parameters:

<Test Name>        See below for a list of all test names.

<Duty setting>        Sets the duty cycle for the specified test to the value specified. Values must be between 1 and 100. Using this command is the same as changing the duty cycle value from the Test duty cycle window.

 

Examples:

#Set the disk test to maximum load

SETDUTYCYCLE  DISK  100

#Set the CPU test to medium  load

SETDUTYCYCLE  DISK  65

 

SETSERIAL COMMAND

Syntax:

SETSERIAL < Serial Number >

 

Parameters:

<Serial Number>        The serial number string. Must be enclosed in double quotes (“”).

 

Examples:

#Set the serial number

SETSERIAL "1234-shdfgdhs-GHGHG"

 

SETMACHINETYPE COMMAND

Syntax:

SETMACHINETYPE < Machine Name>

Parameters:

< Machine Name >        The Machine Name. Must be enclosed in double quotes (“”).

Examples:

#Set Machine type

SETMACHINETYPE "Dell XPS800"

 

SETNOTES COMMAND

Syntax:

SETNOTES <Notes >

 

Parameters:

< Notes >        The Notes. Must be enclosed in double quotes (“”).

 

Examples:

#Set Notes

SETNOTES "Test notes defined by the external application."

 

SETLOG COMMAND

Syntax:

SETLOG "<Filename>"

 

Parameters:

<Filename>        The name of the log file. The file name must be enclosed in double quotes (“”). This can be a path, eg  "/tmp/bitlog/" and the default filename will be used, or a filename, eg "/tmp/bitlog/scriptlog" and BurnInTest will append .log to the filename before creation.

 

Examples:

#Set log file with full path

SETLOG "/tmp/plugin_log"

#Set log file with path relative to BurnInTest application path

SETLOG "plugin_log"

 

Note:

Loading a saved configuration file will overwrite this setting. The currently saved logging settings, such as trace settings, are used when loading a script.

 

SETPCIE COMMAND

Syntax:

SETPCIE <Num >

 

Parameters:

< Num >        Number of PCIe cards to test

 

Examples:

#Set Notes

SETPCIE 2

 

SLEEP COMMAND

Syntax:

SLEEP  <Delay period>

 

Parameters:

< Delay period >        An integer that represents the number of milliseconds to pause before continuing with the next command in the script..

 

Examples:

#Pause 2 seconds

SLEEP 2000

 

RUN COMMAND

Syntax:

RUN  <Test Name>

 

Parameters:

<Test Name>        See below for a list of all test names.

 

Examples:

#Run the CD test with the current settings

RUN CD

#Run all the tests in the current configuration simultaneously

RUN CONFIG

 

<Test Name> Parameter

The test name parameter can takes the following values. The first value “CONFIG” is special because it does not refer to the name of an individual test. When used with the RUN command it causes all tests in the current configuration file to be started simultaneously.

CONFIG

MATHS

CD

DISK

MEMORY

NETWORK

PARALLEL

SERIAL

USB

2D

3D

PCIE

 

Example

#Load my preferred test configuration

LOAD "MyConfiguration1.bitcfg"

#Override the test duration for all tests

SETDURATION 60

MESSAGE "Click on OK to start test run"

RUN MATHS

MESSAGE "Insert test discs into both the CD and DVD drive"

RUN CD

#Load my preferred test configuration for disk testing

LOAD "MyDiskConfig.bitcfg"

RUN CONFIG