C H A P T E R  6

Using the SunVTS Command-Line Interface

This chapter describes the command-line interface used in controlling SunVTS test sessions. Topics include:



Note - The man pages for these commands are installed in the /usr/sunvts/man/man1m directory.



Command-Line Interface Overview



Note - SunVTS must first be started before selecting a user interface. See Starting SunVTS.


vts_cmd is a UNIX shell application that enables you to send a single command to the SunVTS kernel (vtsk) from the command line. The SunVTS kernel processes the command and sends the response back to the command line.

To control a SunVTS test session, vtsk must first be running. While the test is running, you can control the session by using the vts_cmd commands.

The SunVTS application programming interface (API) is character-based, which means that a string of characters (in the form of a command) can be sent to the SunVTS kernel. This action returns a reply back in the form of a string of characters.

vts_cmd enables you to send commands and receive replies from a UNIX command-line. vtstalk is a utility used to establish a connection to the SunVTS kernel.


Command Options

vts_cmd and vtstalk uses the commands listed in this section. In all cases, the commands (and any command arguments) must follow vts_cmd (for vts_cmd commands) or vtstalk(hostname)-> (for vtstalk commands) For reference, see the example section in each command option listed.



Note - The examples sections show vts_cmd commands. If using vtstalk commands, replace ./vts_cmd with vtstalk(hostname)-> in the below examples.


get_agent_summary

Displays the summary of the agent in the test machine. The information includes the agent machine name, the operating system running on the agent, the version of SunVTS software currently installed on the agent, and the health of the agent.

Example:


# ./vts_cmd get_agent_summary
Host Name:diag035,OS:SunOS 5.10,Vts Version:SunVTS7.0build6,Status:testing/elapseTime=000.30.56/Error=1

get_host_config

Displays the configuration information of test machine.

Example:


# ./vts_cmd get_host_config
Host Machine Name:diag035;Operating System:SunOS 5.10;Machine Type:sun4u;IP Address:10.12.150.35;Number of Processors:1;Architecture:sparc;Hardware Platform:SUNW,Sun-Blade-1500

get_status test-name

Displays the testing status information of the system. If you specify the name of a test, get_status displays the status information of the test.

Example:

To get the global status of the system, type:


# ./vts_cmd get_status
idle/elapseTime=000.00.00/Error=0

To get the status of a test, append the test name to get_status.


# ./vts_cmd get_status Memory
Memory:idle/pass=0/error=0/elapseTime=000:00:00

list_tests

Displays all the tests that have been successfully probed by the system. The display information further shows all the related details of the test. The details include information on whether the test is selected or not, its scheduling policy (time or pass based), the stress factor (high or low), the progress percentage of the test (when executed), and its status (idle, testing, completed, or failed).

Example:


# ./vts_cmd list_tests
Test:Processor;Enabled:False;Scheduling Policy:Time=600;Stress:high;Progress:100;
Status:completed(Pass=0/Error=0);
Test:Memory;Enabled:True;Scheduling Policy:Pass=2;Stress:low;Progress:50;
Status:testing(Pass=1/Error=0)

enable_test test-name / all

Enables a test on the listed test name or all the tests if the word all is selected next to the enable_test command. When a test enabled, vts_cmd displays the word DONE. If the command fails, an error string is displayed along with the usage help.

Example:


# ./vts_cmd enable_test Processor
DONE

disable_test test-name / all

Disables a test or all the tests. When a test disabled, vts_cmd displays the word DONE. If the command fails, an error string is displayed along with the usage help.

Example:


# ./vts_cmd disable_test Processor
DONE

get_mode

Displays the current test mode - Online Stress or System Exerciser or Component Stress.

Example:


# ./vts_cmd get_mode
Test Mode:System Exerciser

set_mode [mode]

To change test mode, provide the mode name (Online Stress or System Exerciser or Component Stress) as per the testing requirement. If SunVTS successfully sets the test mode, vts_cmd displays the word DONE.

Example:


# ./vts_cmd set_mode [Online Stress]
DONE

If setting the options fails (for example, an error due to format or a misspelled word), an error string displays with the usage help.

Example:


# ./vts_cmd set_mode [Online Stress]
Usage: ’vts_cmd set_mode [modeValue] where ’modeValue’ can be Online Stress/System Exerciser/Component Stress’

get_global_options

Displays the global options that apply to all the tests. The parameters for the global options includes duration of testing (in minutes), and verbose option (whether enabled or disabled). The parameters are defined as type of display, the chosen or default value, and the choices or range of the values.

Example:


# ./vts_cmd get_global_options
Duration of Testing, NUMERIC, 20, 0/99999;
Verbose, CHECKBOX, Enable

set_global_options [Duration of Testing:<0-99999 mins>,Verbose:Enable/Disable]

To set the global options, you must provide all the option parameters (duration of testing and verbose) with a value in the format shown in the syntax. You can determine the values from the options listed by the get_global_options command, as per testing requirements. If SunVTS successfully sets the global options, vts_cmd displays the word DONE. If setting the options fails, an error string displays along with the usage help.

Example:


# ./vts_cmd set_global_options [Duration of Testing:60,Verbose:Enable]
DONE

Setting of global options can fail if there is a misspelled parameter or the value of a parameter is missing. In the following example, the parameter Verbose is typed as Verb, so the option was not set.


# ./vts_cmd set_global_options [Duration of Testing:60,Verb:Enable]
Format Error: Verb is not a valid value.
Usage:’vts_cmd set_global_options [Duration of Testing:<0-
99999>,Verbose:Enable/Disable]’

Setting global options is not allowed when the vts kernel is not in the idle state. An error will be displayed as shown.


# ./vts_cmd set_global_options [Test Mode:System Exerciser, Duration of Testing:60,Verbose:Enable]
ERROR: Setting of options allowed only when vts kernel is idle.

get_test_options test-name

Displays the test options. The parameters for the test options includes stress factor (high or low), scheduling policy (test passes or test time in minutes), and error limit. The parameters have been defined under type of display, the chosen or default value, and the choices or range of the values.

Example:


# ./vts_cmd get_test_options Processor
Stress, RADIO, low, low/high;
Scheduling Policy, RADIO, Test Time,
[Test Time, NUMERIC, 10, 0/99999|
Test Passes, NUMERIC, 0, 0/99999];
Error Limit, NUMERIC, 1, 0/99999

set_test_options test-name [Stress:low/high,Scheduling Policy:Test Time<mins>/Test Passes,Test Time<mins>:x*,Test Passes:y*,Error Limit:z*]

Where x,y, and z denote time, pass, and error count, respectively.

To set the test options, you must provide all the option parameters (stress, scheduling policy and error limit} with a value in the format shown. You can determine the values from the options listed by the get_test_options command, as per testing requirements. On success with setting the test options, vts_cmd displays the word DONE. If setting the options fails, an error string displays along with the usage help.

Example:


# ./vts_cmd set_test_options Disk [Stress:high,Scheduling Policy:Test Time,Test Time:50,Test Passes:0,Error Limit:2]
DONE

Setting options can fail if a parameter is misspelled, or the value of a parameter is missing. In the following example, the error limit parameter is missing. For this reason, the setting of that test option failed.

 


# ./vts_cmd set_test_options Disk [Stress:high,Scheduling Policy:Test Time,Test Time:50,Test Passes:0,Error Limit:]
Format Error: blank space is not a valid value
Usage:’vts_cmd set_test_options TestName[Stress:low/high,Scheduling Policy:Test Time<mins>/Test Passes,Test Time<mins>:x,Test Passes:y,Error Limit:z]’,
        where x,y and z denotes time, pass and error count

Setting global options is not allowed when the vts kernel is not in the idle state. An error displays as shown.


# ./vts_cmd set_test_options Disk [Stress:high,Scheduling Policy:Test Time,Test Time:50,Test Passes:0,Error Limit:2]
ERROR: Setting of options allowed only when vts kernel is idle.

get_device_options [testname.devicename]

Displays the devices and the options exported for the test.

Example:


# ./vts_cmd get_device_options Disk.c3d0p
Iostate, RADIO, Disable, Enable/Disable;
Write Threshold(KB/s), TEXT, 0, 0;
Read Threshold(KB/s), TEXT, 0, 0

set_device_options [testname.devicename: Exported Variable1:Value1, Exported Variable2:Value 2,...]

To set the device options exported for the test that you need to provide the command with testname and its device name with the exported variable and its value.

Example:


# ./vts_cmd set_device_options Disk.c3d0p [Iostat:Enable]
DONE 
 
# ./vts_cmd set_device_options Disk.c3d0p0 [Iostat:Enable, Write Threshold\(KB/s\):30000]
DONE

save_session [overwrite:yes/no, defaultMode:test mode, name:session name]

To create a new session file you must provide the name of the session as an input parameter. The command has two more attributes: overwrite:yes/no and defaultMode:test mode. A value of yes for the option overwrite will overwrite the existing session file (default value is no). You can use any of the test modes (Online Stress, System Exerciser, or Component Stress) as a value for defaultMode. Whatever the default mode, the session file saves all the options separately for each of the three modes. The default mode only decides which mode will be active once the session is loaded. If you do not provide any input for the defaultMode option, then SunVTS will make the current selected Test Mode as the default active Test Mode. On success, command returns DONE.

Example:


# ./vts_cmd save_session [overwrite:yes,defaultMode:Online Stress, name:sunvts_session]
DONE

In case of misspelled parameters or a missing value, an appropriate usage error message is returned by the command.

Example:


# ./vts_cmd save_session [overite:yes,defaultMode:Online Stress, name:sunvts_session]
Format Error:overite is not a valid value.

Usage: vts_cmd save_session [overwrite:yes,defaultMode:Component Stress,name:vijay] where the name argument is the required parameter.

list_sessions

The list_sessions can be used to see the list of available session files in the system, and then you can load any session file based on the availability. The command will return the “,” separated list of all the existing session files available in system.

Example:


# ./vts_cmd list_sessions
sunvts_session1,sunvts1,sunvts3, session_a, session_b

load_session[defaultMode:testMode, name:sessionName]

To load an existing session file, the load_session command needs to be used to load an existing session file. The command has two input options: defaultMode and name. You must provide the name of the session file for this command to load the session file. The defaultMode option is not mandatory, it provides a way to set the defaultMode as the active mode and load the session options corresponding to that test mode. With no default mode, SunVTS will load the named session file and make the default test mode stored in the session file as the current test mode for the loaded session file. On success, command will return DONE, otherwise an appropriate error will be displayed by the command.

Example:


# ./vts_cmd load_session [name:sunvts_session]
DONE

In case of misspelled parameters or a missing value, an appropriate usage error message will be returned by the command.

Example:


# ./vts_cmd load_session
Format Error: Command is not in a correct format.

Usage: vts_cmd load_session [defaultMode:Component Stress,name:sunVTS] where the name argument is the required parameter.

get_session_name

You can use the get_session_name command to get the currently loaded session name. If no session is currently loaded, then command will return a blank string.

Example:


# ./vts_cmd get_session_name
sunvts_session

delete_session sessionName

This command can be used to delete the existing session file. To remove a session file, you must enter the session file name as a parameter to delete_session. If the session file does not exist then an error will be thrown. On success, command will return DONE and the session file will be deleted.

Example:


# ./vts_cmd delete_session sunvts_session
DONE

In case the file does not exist, an error message is displayed.


# ./vts_cmd delete_session sunvts_session xyz
Error: Session xyz does not exist. Please give valid session to remove.

reset_session

Once the complete execution of a session file is over, you can use the reset_session command to restore the default values of the SunVTS session without quitting from the SunVTS application.

Example:


# ./vts_cmd reset_session
DONE

start

Starts all enabled SunVTS tests. A reply with the word DONE confirms that the tests have started.


# ./vts_cmd start
DONE

stop

Stops all running SunVTS tests. A reply with the word DONE means the tests have stopped testing.


# ./vts_cmd stop
DONE

reset

Resets all the tests pass, error, and time limit counts to zero. A reply with the word DONE confirms that the values of the parameters have been set to zero.


# ./vts_cmd reset
DONE

Reset is only possible if the vtsk system status is idle. If the system status is not idle, then an error is returned.


# ./vts_cmd start
ERROR: Reset allowed only when kernel is idle.

reprobe

Probes all the devices on the test machine and updates the SunVTS kernel device list. A reply with the word DONE reply confirms that the vtsk has been informed to reprobe the devices.


# ./vts_cmd reprobe
DONE

Reprobing is only possible if the vtsk system status is idle. If the system status is not IDLE, then an error is printed on the screen.


# ./vts_cmd reprobe
ERROR: Reprobe allowed only when kernel is idle.

get_modesequencer_options

Displays the Auto mode sequencer options and its values. Type the following command to get the modesequencer options:


# ./vts_cmd get_modesequencer_options
Sequencer,                 RADIO,       Disable,        Enable/Disable,,       Enabling the Sequencer will switch on the mode sequencer feature;
 
First,                 RADIO,   None,   None/Online Stress/System Exerciser/Component Stress,,  Select the first mode to run in the sequence;
 
Second,                 RADIO,  None,   None/Online Stress/System Exerciser/Component Stress,,  Select the second mode to run in the sequence;
 
Third,                 RADIO,   None,   None/Online Stress/System Exerciser/Component Stress,,  Select the third mode to run in the sequence;
 
Loop, NUMERIC,  1,      1/99999,,       Specify the loops that the sequence should keep repeating

set_modesequencer_options

Displays the Auto mode sequencer options and its values.

To set the auto mode sequencer options, you must provide all the option parameters with a value as shown in the syntax. You can determine the values from the options listed by the get_modesequencer_options command. If SunVTS successfully sets the modesequencer options, vts_cmd returns the word DONE. If setting the options fails, an error string displays along with the usage help.


# ./vts_cmd set_modesequencer_options [Sequencer:Enable,First:Online Stress,Second:System Exerciser,Third:Component Stress,Loop:1]
DONE

Where each of the modes - Online Stress, System Exerciser and Component Stress can be also typed as O, S and C (case does not matter).

Setting mode sequencer options can fail if one of the options is given a wrong or misspelled value, or if the value is missing. In the following example, a wrong value has been typed in for the option "Sequencer". The command then returns with an error.


# bash-3.00# ./vts_cmd set_modesequencer options [Sequencer:Ena,First:Online Stress,Second:System Exerciser,Third:Component Stress,Loop:1]
 
Format Error: Ena is not a valid value.
Usage: ’vts_cmd set_modesequencer_options [First:Online_Stress/System_Exerciser/Component_Stress, Second:Online_Stress/System_Exerciser/Component_Stress, Third:Online_Stress/System_Exerciser/Component_Stress, Loop:<1-99999>]’

quit

Terminates the SunVTS kernel (vtsk). A reply with the word DONE confirms that the vtsk quit.


# ./vts_cmd quit
DONE

Quitting the vtsk is only possible if the vtsk system status is idle. If the system status is not idle, then an error is returned.


# ./vts_cmd start
ERROR: Quit allowed only when kernel is idle.