📄 varsrv.script
字号:
.***************************************************************************.* Software Testing Automation Framework (STAF).* (C) Copyright IBM Corp. 2001.*.* This software is licensed under the Common Public License (CPL) V1.0..****************************************************************************.*************************-START-OF-PROLOG-****************************.*.* File Name : VarSrv SCRIPT.* Descriptive Name : Software Test Automation Framework Variable Service.* Detail:.*.* This file describes the STAF Variables Service..*.**************************-END-OF-PROLOG-*****************************:i1.variable service:ih1.services:i2.variable service:h2 id=varservice.Variable (VAR) Service:h3.Description:p.The Variable Service, called VAR, is one of the internal STAF services. Itallows you to manage the system, shared, and per-process variable pools. It providesthe following commands.:ul compact.:li.SET - Sets the value of a given variable:li.GET - Retrieves the value of a given variable:li.LIST - Retrives a list of all the variables and their associated values fora given variable pool:li.RESOLVE - Resolves the values of all variables in a given string:li.DELETE - Deletes a given variable:li.&help.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.SET:i3.variable service:h3.SET:p.SET will set a variable to a certain value. The variable is created if itdoes not exist.:p.Note that you may SET multiple variables with a single request.:h4.Syntax:xmp.SET &lbrk.SYSTEM | SHARED | HANDLE <Handle>&rbrk. VAR <Name=Value> &lbrk.VAR <Name=Value>&rbrk....:exmp.:p.:xph.SYSTEM:exph. specifies that you want to set the value of the variablein the system variable pool.:p.:xph.SHARED:exph. specifies that you want to set the value of the variablein the shared variable pool.:p.:xph.HANDLE:exph. indicates that you want to set the value of the variablein the variable pool associated with the specified handle.:p.If options :xph.SYSTEM:exph., :xph.SHARED:exph., and :xph.HANDLE:exph. arenot specified, the variable will be set in the variable pool associated with thehandle of the process that submitted the request unless the request came from anothermachine, in which case the variable will be set in the system variable pool.:h4.Security:p.&seclvl. 3.:h4.Return Codes:p.All return codes from SET are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain no data on return from a SET command.:h4.Examples:p.:ul.:li.:hp2.Goal::ehp2. Set the system WebServer variable to testsrv1.test.austin.ibm.com.br:hp2.Request::ehp2. :xph.SET SYSTEM VAR WebServer=testsrv1.test.austin.ibm.com:exph.:p.:li.:hp2.Goal::ehp2. Set the shared TestDirectory variable to /tests.br:hp2.Request::ehp2. :xph.SET SHARED VAR TestDirectory=/tests:exph.:p.:li.:hp2.Goal::ehp2. In the process local variable pool, set variable "Good String"to "Command completed successfully", and set variable "Bad String" to "SYS3175".br:hp2.Request::ehp2. :xph.SET VAR &colon.42&colon.Good String=Command completed successfully VAR "Bad String=SYS3175":exph.:p.:li.:hp2.Goal::ehp2. Set the variable STAF/Service/Log/Mask to "FATAL ERRORWARNING" in the variable pool associated with handle 37.br:hp2.Request::ehp2. :xph.SET HANDLE 37 VAR "STAF/Service/Log/Mask=FATAL ERROR WARNING":exph.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.GET:i3.variable service:h3.GET:p.GET will retrieve the value of a variable.:p.:note.You almost never want to use the GET command. Instead, you should useRESOLVE to retrieve the value of a variable.:h4.Syntax:xmp.GET &lbrk.SYSTEM | SHARED | HANDLE <Handle>&rbrk. VAR <Name>:exmp.:p.:xph.SYSTEM:exph. specifies that you want to get the value of the variablefrom the system variable pool.:p.:xph.SHARED:exph. specifies that you want to get the value of the variablefrom the shared variable pool.:p.:xph.HANDLE:exph. indicates that you want to get the value of the variablefrom the variable pool associated with the specified handle.:p.If options :xph.SYSTEM:exph., :xph.SHARED:exph., and :xph.HANDLE:exph. arenot specified, the value of the variable will be retrieved from the variablepool associated with the handle of the process that submitted the requestunless the request came from another machine, in which case the variable willbe retrieved from the system variable pool.:h4.Security:p.&seclvl. 2.:h4.Return Codes:p.All return codes from GET are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain the value of the variable.:h4.Examples:p.:ul.:li.Goal&colon. Get the value of the variable WebServer from the systemvariable pool.br:hp2.Request::ehp2. :xph.GET SYSTEM VAR WebServer:exph.:p.:li.Goal&colon. Get the value of the varible TestDirectory from the sharedvariable pool.br:hp2.Request::ehp2. :xph.GET SHARED VAR TestDirectory:exph.:p.:li.Goal&colon. Get the value of the variable "Good String" from the processlocal variable pool.br:hp2.Request::ehp2. :xph.GET VAR "Good String":exph.:p.:li.Goal&colon. Get the value of the variable ConfigData from the variable poolassociated with handle 59.br:hp2.Request::ehp2. :xph.GET HANDLE 59 VAR ConfigData:exph.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.LIST:i3.variable service:h3.LIST:p.LIST will return a list of all variables and their values.:h4.Syntax:xmp.LIST &lbrk.SYSTEM | SHARED | HANDLE <Handle> | ASHANDLE <Handle> | REQUEST &lbrk.<Number>&rbrk.&rbrk.:exmp.:p.:xph.SYSTEM:exph. specifies that you want the list of variables from thesystem variable pool only.:p.:xph.SHARED:exph. specifies that you want the list of variables from theshared variable pool only.:p.:xph.HANDLE:exph. specifies that you want the list of variables from the handle variable pool only.:p.:xph.ASHANDLE:exph. indicates that you want the list of a merged set of variables from the specified handle's variable pool, its system's shared variable pool, and its system's system variable pool. Variables in a pool earlier in the list override variables in a pool later in the list.:p.:xph.REQUEST:exph. with a request number indicates that you want a list of a merged set of variables which will use variables from the originating handle's pool associated with the request number, the originating system's shared pool, the local system's shared pool, and the local system's system pool if the request came from remote; otherwise, will use the originating handle's pool associated with the request number, the local system's shared pool, and the local system's system pool if the request came from local. Variables in a pool earlier in the list override variables in a pool later in the list. :p.If a LIST REQUEST request is made without specifying a request number, the list is constructed in the context of the LIST REQUEST request, itself.:p.If a LIST request is made without specifying :xph.SYSTEM:exph., :xph.SHARED:exph., :xph.HANDLE:exph., :xph.ASHANDLE:exph., and :xph.REQUEST:exph., the behavior will be identical to a LIST REQUEST request being made with no request number specified.:h4.Security:p.&seclvl. 2.:h4.Return Codes:p.All return codes from LIST are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain a marshalled:xph.<Map&colon.STAF/Service/Var/VarInfo>:exph. with an entry for each variable.The map is defined as follows: :table cols='* * * 3*'.:tcap.Definition of map class STAF/Service/Var/VarInfo:tnote text='Description'.This map class represents the variables.:thd.:c.Key Name:c.Display Name:c.Type:c.Format / Value:ethd.:row.:c.<Variable Name>:c.<Variable Name>:c.&stringObj.:c.:tnote text='Notes'.This map is dynamically generated with the key being a variable name and thevalue being the value for the variable.:etnote.:etable.:p.If the request is submitted from the command line, the result, in default format, could look like::xmp.Bad String : SYS3175Good String : Command completed successfullySTAF/Config/BootDrive : C:STAF/Config/Machine : automate.austin.ibm.comSTAF/Config/MachineNickname : automateSTAF/Config/Memory/Physical/Bytes : 49938432STAF/Config/Memory/Physical/KB : 48768STAF/Config/Memory/Physical/MB : 47STAF/Config/OS/MajorVersion : 20STAF/Config/OS/MinorVersion : 40STAF/Config/OS/Name : OS2STAF/Config/OS/Revision : 0STAF/Config/Sep/File : \STAF/Config/Sep/Line :STAF/Config/Sep/Path : ;STAF/Config/STAFRoot : D:\STAF\BINSTAF/Service/Monitor/Directory : {STAF/Config/BootDrive}\STAF\MonitorSTAF/Service/Monitor/MaxRecordSize : 256STAF/Service/Monitor/ResolveMessage: 1STAF/Service/Monitor/Retry : 3WebServer : testsrv1.test.austin.ibm.com:exmp.:h4.Examples:p.:ul.:li.:hp2.Goal::ehp2. Retrieve the list of system variables.br:hp2.Request::ehp2. :xph.LIST SYSTEM:exph.:p.:li.:hp2.Goal::ehp2. Retrieve the list of shared variables.br:hp2.Request::ehp2. :xph.LIST SHARED:exph.:p.:li.:hp2.Goal::ehp2. Retrieve the list of variables associated with handle 54.br:hp2.Request::ehp2. :xph.LIST HANDLE 54:exph.:p.:li.:hp2.Goal::ehp2. Retrieve the combined list of global variables and variablesassociated with handle 62.br:hp2.Request::ehp2. :xph.LIST ASHANDLE 62:exph.:p.:li.:hp2.Goal::ehp2. Retrieve the combined list of variables from originating handle's pool associated with request number 48, the local system's shared pool, and the local system's system pool if the request came from local; otherwise, from the originating handle's pool associated with request number 48, the originating system's shared pool, the local system's shared pool, and the local system's system pool if the request came from remote..br:hp2.Request::ehp2. :xph.LIST REQUEST 48:exph.:p.:li.:hp2.Goal::ehp2. Retrieve the combined list of variables from originating handle's pool associated with the current request's request number, the local system's
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -