Installation guide

System Administration
Adding Custom Tests
13-30
String getServiceStatus(list serviceNames, debug=0)
Gets the status for a list of services. Returns a hash containing the
result_data key. The value of this key is a hash with a key for each
service in the serviceNames. The value of the service hash is one of the
following strings:
Stopped
Running
Paused
Not Installed
Nothing startService(serviceName,debug=0)
Starts the service serviceName if it is stopped or paused.
Nothing stopService(serviceName,debug=0)
Stops the service serviceName if it is started or paused.
Registry API
Registry key parameters use HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, HKEY_USER to specify the
subtree of the registry. For example,
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion.
For performance reasons, it is important to use the same case when specifying the same registry key in
multiple calls. Even though the windows registry is not case-sensitive, the test result cache is case-
sensitive.
Dict getRegEnumKeys(string key, debug=0
Returns a hash containing the
result_data key. The value of this
key is a list of subkeys under key.
Dict getRegEnumValues(string key, debug=0)
Returns a hash containing the
result_data key. The value of this
key is a list of values under key.
String getRegQueryValue(string key, string value, debug=0)
Returns the data associated with the value as a string.
Boolean getRegValueExists(string key, string value, debug=0)
Check to see if a value exists in the registry. Returns the following:
1 if exists
0 if it does not exist
The BasicTests API accesses these functions with the SABase self.bt member. All methods throw an
exception that should be caught if an unexpected error occurs.
Return Value Public Method
Table 13-2.BasicTests API (cont.)