Environment and Internal Variable Arguments

prevnext

Arguments of EnvironmentOp


The following table describes the valid values of the first argument (envVar) of EnvironmentOp. Note the following about LogData_control and LogEvent_control:

Name
Type/Values/(default)
Contains
Delay_dly_scale integer 0-2000000000 percent (100) The scaling factor applied globally to all timing delays. A value of 100%, which is the default, means no change. A value of 50% means one-half the delay, which is twice as fast as the original; 200% means twice the delay, which is half as fast. A value of zero means no delay.
LogData_control NONE,
PASS,
FAIL,
WARNING,
STOPPED,
INFORMATIONAL,
COMPLETED,
UNEVALUATED
ANYRESULT
Flags indicating the level of detail to log. Specify one or more. These result flags (except the last, which specifies everything) correspond to flags entered with the LogEvent, LogMessage, TestCaseResult, CommandEnd, and LogCommand statements. For example, specifying FAIL selects everything logged by statements that specified flag FAIL.
LogEvent_controlL NONE,
PASS,
FAIL,
WARNING,
STOPPED,
INFORMATIONAL,
COMPLETED,
UNEVALUATED,
TIMERS,
COMMANDS,
ENVIRON,
STUBS,
TSSERROR,
TSSPROXYERROR
ANYRESULT
Flags indicating the level of detail to log for reports. Specify one or more. The first nine result flags (NONE through UNEVALUATED) correspond to flags specified with the LogEvent, LogMessage, TestCaseResult, CommandEnd, and LogCommand statements. The other flags (TIMERS through TSSPROXYERROR) indicate the event objects. For example, FAIL plus COMMANDS selects for reporting all commands that recorded a failed result. ANYRESULTS selects everything.
Log_level string "OFF" ("TIMEOUT") "UNEXPECTED" "ERROR" "ALL" The level of detail to log:
  • OFF - Log nothing.

  • TIMEOUT - Log emulation command time-outs.

  • UNEXPECTED - Log time-outs and unexpected responses from emulation commands.

  • ERROR - Log all emulation commands that set error to a nonzero value. Log entries include error and error_text.

  • ALL - Log everything: emulation command types and IDs, script IDs, source files, and line numbers.

Record_level "MINIMAL" "TIMER" "FAILURE" ("COMMAND") "ALL" The level of detail to log for reporting:
  • MINIMAL - Record only items necessary for reports to run. Use this value when you do not want user activity to be reported.

  • TIMER - MINIMAL plus start_time and stop_time emulation commands. Reports do not contain response times for each emulation command, emulation command failure does not appear, and the result file for each virtual tester is small. Use this setting if you are not concerned with the response times or pass/fail status of individual emulation commands.

  • FAILURE - TIMER plus emulation command failures and some environment variable changes. Use this setting if you want the advantages of a small result file but to show also that no emulation command failed.

  • COMMAND - FAILURE plus emulation command successes and some environment variable changes.

  • ALL - COMMAND plus all environment variable changes. Complete recording.

Suspend_check string ("ON") "OFF" Controls whether you can suspend a virtual tester from a Monitor view:
  • ON - A suspend request is checked before beginning the think time interval by each send emulation command.

  • OFF - Disable suspend checking.

Think_avg integer 0-2000000000 ms (5000) The average think-time delay (the amount of time that, on average, a user delays before performing an action).
Think_cpu_dly_scale integer 0-2000000000 ms (100) The scaling factor applied globally to CPU (processing time) delays. Used instead of Think_dly_scale if Think_avg is less than Think_cpu_threshold. Delay scaling is performed before truncation (if any) by Think_max.
Think_cpu_threshold integer 0-2000000000 ms (0) The threshold value used to distinguish CPU delays from think-time delays.
Think_def string "FS" "LS" "FR" ("LR") "FC" "LC" The starting point of the think-time interval:
  • FS - the submission time of the previous send emulation command

  • LS - the completion time of the previous send emulation command

  • FR - the time the first data of the previous receive emulation command was received

  • LR - the time the last data of the previous receive emulation command was received, or LS if there was no intervening receive emulation command

  • FC - the submission time of the previous connect emulation command (uses the fc_ts internal variable)

  • LC - the completion time of the previous connect emulation command (uses the lc_ts internal variable)

Think_dist string ("CONSTANT") "UNIFORM" "NEGEXP" The think-time distribution:
  • CONSTANT - sets a constant distribution equal to Think_avg

  • UNIFORM - sets a random think-time interval distributed uniformly in the range: [Think_avg - Think_sd, Think_avg + Think_sd]

  • NEGEXP - sets a random think-time interval approximating a bell curve with Think_avg equal to standard deviation

Think_dly_scale integer 0 - 2000000000 ms (100) The scaling factor applied globally to think-time delays. Used instead of Think_cpu_dly_scale if Think_avg is greater than Think_cpu_threshold. Delay scaling is performed before truncation (if any) by Think_max.
Think_max integer 0-2000000000 ms (2000000000) A maximum threshold for think times that replaces any larger setting.
Think_sd integer 0-2000000000 ms (0) Where Think_dist is set to UNIFORM, specifies the think-time standard deviation.

The following table describes the valid values of the second argument (envOp) of EnvironmentOp.

Operation Description
eval Operate on the value at the top of the variable's stack.
pop Remove the variable value at the top of the stack.
push Push a value to the top of a variable's stack.
reset Set the value of a variable to the default and discard any other values in the stack.
restore Set the saved value to the current value.
save Save the value of a variable.
set Set a variable to the specified value.


Example: Manipulating Environment Variables

This example illustrates how to manipulate environment variables.

$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "At start, value is `$ev`\n";

system("tsscmd environmentop think_dist push NEGEXP") == 0
    or errorexit();
$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "After push, value is `$ev`\n";

system("tsscmd environmentop think_dist pop") == 0
    or errorexit();
$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "After pop, value is `$ev`\n";

system("tsscmd environmentop think_dist set NEGEXP") == 0
    or errorexit();
$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "After set, value is `$ev`\n";

system("tsscmd environmentop think_dist save") == 0
    or errorexit();
system("tsscmd environmentop think_dist reset") == 0
    or errorexit();
$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "After save and reset, value is `$ev`\n";

system("tsscmd environmentop think_dist restore") == 0
    or errorexit();
$ev = `tsscmd environmentop think_dist eval`;
errorexit() if $?;
chomp($ev);
print "After restore, value is `$ev`\n";


sub errorexit {
    my $msg, $r;

    $msg = `tsscmd errordetail`;
    $r = $?>>8;
    chomp($msg);
    die "tsscmd call failed, code $r: $msg\n";
}

prevnext


The Command Line Interface to Rational Test Script Services Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com