Scripting |

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 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. If any of these parameters are filenames, you should enclose them in double quotes (“”)

Examples:

#Start up Notepad with some results before starting tests.

EXECUTE "c:\winnt\system32\notepad.exe" "c:\MyResults\Results.txt"

RUN CONFIG

EXECUTEWAIT COMMAND

Overview:

Runs an executable file and waits for that process to finish before continuing to process the script.

Passing configuration information from an external program to BurnInTest.

The executable file may produce a file of scripting commands that are to be run by BurnInTest once the executable file has closed. As an example, this may be used to set the Machine type, serial number, test notes etc at the start of a script file..

The only script commands that will be processed by BurnInTest are the SET… commands. All other commands will be ignored. If this file, called a Sub-Script file, is created is must:

- | be placed in the same directory as the EXECUTEWAIT executable file;

- | must be called “bit-script-input.txt”; and

- | must conform to the scripting file format.

After processing the script commands in this file, BurnInTest will delete the file.

See STARTLOGGING.

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. If any of these parameters are filenames, you should enclose them in double quotes (“”)

Examples:

#Start PassMark’s Sleeper application with user defined parameters.

EXECUTEWAIT "sleeper.exe" -S1000 -R 30 -N 1 –E

#Start up Notepad with some results before starting tests.

EXECUTEWAIT "c:\winnt\system32\notepad.exe" "c:\MyResults\Results.txt"

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 must have been previously created from within BurnInTest. A partial path name can be used to load a configuration file from the current default directory (e.g. My Documents\<UserName>\PassMark\BurnInTest\) or the bit.exe directory (e.g. C:\Program Files\BurnInTest\). A loaded configuration file will over write all preferences currently selected.

Examples:

#Load the low load configuration file that we created earlier

LOAD “C:\ConfigurationFiles\LowLoad.bitcfg”

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 CPU

}

MESSAGE COMMAND

Syntax:

MESSAGE <Message Text>

Parameters:

< Message Text > | A single line of text that will be displayed in a window with an OK button. The user must click on the OK button to continue with the script.

Examples:

MESSAGE “Insert the test disc into the DVD drive then click on OK to proceed with the test”

SETCUSTOMER COMMAND

Syntax:

SETCUSTOMER < Customer name >

Parameters:

<Customer name> | The customer name string. Must be enclosed in double quotes (“”).

Examples:

#Set the customer name

SETCUSTOMER "The big PC store"

NOTE: SETSERIAL, SETMACHINETYPE, SETNOTES, SETCUSTOMER, SETTECHNICIAN commands should be included as the first commands in a script so that the report settings are included in any log file System Information.

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.

Example 1:

#Set the number of test cycles to 1

SETCYCLES 1

Example : Run each test one cycle in series.

SETCYCLES 1

SETDURATION 0

LOG "Run CPU Test”

RUN CPU

Etc…

NOTE: Automatic stopping after a set number of test cycles is only supported in the licensed version of BurnInTest.

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

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

SETLOG COMMAND

Syntax:

SETLOG <Filename>

Parameters:

<Filename> | The name of the log file. The file name must be enclosed in double quotes (“”).

Examples:

#Set log file with full path

SETLOG "C:\Program Files\Plugin\plugin_log"

#Set log file with path relative to BurnInTest drive

SETLOG "\Program Files\Plugin\plugin_log"

#Set log file with path relative to BurnInTest application path

SETLOG "plugin_log"

Notes:

Loading a saved configuration file will overwrite this setting.

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"

NOTE: SETSERIAL, SETMACHINETYPE, SETNOTES, SETCUSTOMER, SETTECHNICIAN commands should be included as the first commands in a script so that the report settings are included in any log file System Information.

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."

NOTE: SETSERIAL, SETMACHINETYPE, SETNOTES, SETCUSTOMER, SETTECHNICIAN commands should be included as the first commands in a script so that the report settings are included in any log file System Information.

SETPLUGIN COMMAND

Sets up the first external test plug-in application executable file name.

Syntax:

SETPLUGIN <Filename>

Parameters:

<Filename> | The name of the plugin file. The file name must be enclosed in double quotes (“”). The file must be an executable, and the “.exe” must be included.

Examples:

#Set plug-in test application file with full path

SETPLUGIN "C:\Program Files\Plugin\plugin.exe”

#Set plug-in test application file with path relative to BurnInTest drive

SETPLUGIN "\Program Files\Plugin\plugin.exe”

#Set plug-in test application file with path relative to BurnInTest application path

SETPLUGIN "plugin.exe”

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"

NOTE: SETSERIAL, SETMACHINETYPE, SETNOTES, SETCUSTOMER, SETTECHNICIAN commands should be included as the first commands in a script so that the report settings are included in any log file System Information.

SETTECHNICIAN COMMAND

Syntax:

SETTECHNICIAN < Technician name >

Parameters:

<Technician name> | The technician (or testers) name. Must be enclosed in double quotes (“”).

Examples:

#Set the technician name

SETTECHNICIAN "Bill Smith"

NOTE: SETSERIAL, SETMACHINETYPE, SETNOTES, SETCUSTOMER, SETTECHNICIAN commands should be included as the first commands in a script so that the report settings are included in any log file System Information.

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

STARTLOGGING COMMAND

To set report items like serial number in the report (log file) a script command, STARTLOGGING, is used to turn logging on and create a log file (start logging). The intent of this is to allow any test script reporting items to be configured before the log file is created.

Syntax:

STARTLOGGING

Parameters:

None.

Examples:

#Run an external application to set the report configuration subscript and pass this to BurnInTest via the bit-script-input.txt file

EXECUTEWAIT ".\bitsetup.exe"

#Start logging using current settings with the SETXXX commands in the resulting bit-script-input.txt file

STARTLOGGING

#Set first test duration time for 1 minute

SETDURATION 1

#Run the test

RUN CONFIG

REBOOT and REBOOTEND COMMAND

Note: These commands should only be used where multiple reboots within one script are required. The commands are designed in such a way that they ONLY make sense in the following context…

BurnInTest must be launched automatically at start up using a shortcut to bit.exe in the Start-Up directory. The shortcut must use the /s command line parameter to automatically run the script, which contains the REBOOT command. So if, for example the script file containing the REBOOT command was called ‘Reboot.bits’, then the command line ‘Target’ of the shortcut would look something like

“C:\Program Files\BurnInTest\bit.exe” /r /s Reboot.bits

These commands require that the Rebooter application is present in the BurnInTest application directory. Any reboots occurring as a result of these commands will use the current Rebooter settings. BurnInTest must have write access to the directory that the script is located in.

Overview:

REBOOT reboots the computer. After the computer boots up, and BurnInTest restarts, the script will continue to execute at the line following the REBOOT command.

REBOOTEND reboots the computer. After the computer boots up, BurnInTest will restart, but the script will no longer continue to execute.

Example:

MESSAGE “Run some 3D tests”

RUN 3D

MESSAGE “Reboot for the first time”

REBOOT

MESSAGE “Run some 2D tests”

RUN 2D

MESSAGE “Reboot for the second time”

REBOOT

MESSAGE “And now one final reboot”

REBOOTEND

MESSAGE “This message will never be displayed”

Note: It is recommended to use “Accumulate logs” when using REBOOT and REBOOTEND.

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

CPU (or MATHS)

CD

DISK

MEMORY

NETWORK

PARALLEL

PRINTER

SERIAL

SOUND

TAPE

USB

2D

3D

VIDEO

PLUGIN

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 CPU

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