欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

concepts.script

Software Testing Automation Framework (STAF)的开发代码
SCRIPT
第 1 页 / 共 2 页
字号:
is STAF if the STAF_Instance_Name environment variable is not specified.:li.STAF/Config/Machine - The name of this machine:li.STAF/Config/MachineNickname - The nickname for this machine.  This defaultsto the same value as STAF/Config/Machine unless overridden using the MACHINENICKNAMEconfiguration setting.:li.STAF/Config/Mem/Physical/Bytes - The amount of physical memory in bytes:li.STAF/Config/Mem/Physical/KB - The amount of physical memory in kilobytes:li.STAF/Config/Mem/Physical/MB - The amount of physical memory in megabytes:li.STAF/Config/OS/Name - The name of the operating system, e.g., OS2 or WIN95:li.STAF/Config/OS/MajorVersion - This is operating system specific:li.STAF/Config/OS/MinorVersion - This is operating system specific:li.STAF/Config/OS/Revision - This is operating system specific:li.STAF/Config/Sep/Command - The character(s) used to separate multiplecommands concatenated together in a single line:li.STAF/Config/Sep/File - The character(s) used to separate files anddirectories in a path:li.STAF/Config/Sep/Line - The character(s) used to separate lines in a textfile:li.STAF/Config/Sep/Path - The character(s) used to separate paths in a pathlist:li.STAF/Config/STAFRoot - The directory in which STAF is installed:li.STAF/DataDir - The directory that STAF and its services use to write data(based on the DATADIR operational parameter):li.STAF/Env/* - All environment variables accessable via STAF:li.STAF/Version - The version of STAF installed:eul.:p.:h3 id=varconbasics.The Basics of Variable References:p.To substitute a variable's value, write the name of the variable in curly braces:"{STAF/Config/OS/Name}" is a valid reference to the variable STAF/Config/OS/Name.Assuming STAF/Config/OS/Name=Win2000, string "Operating system is {STAF/Config/OS/Name}"resolves to "Operating system is Win2000".:p.Variable references can be used in many places when submitting a STAF request.For example::ul compact.:li.When submitting a request to any service, the machinename and service name can contain STAF variables.:li.When using the Variable service, the string being resolved can contain STAF variables.:li.When starting a process via the Process service, the values of any of its request optionscan contain STAF variables.:li.When logging a message via the Log service, the value of the message can containSTAF variables.:eul.:p.See section :hdref refid=varservice. for more information on setting and resolvingvariables..*.*---------------------------------------------------------------------.*:i1.security:h2 id=trstcon.Security:p.Security in STAF can be defined at the machine level and/or the user level.In other words, you grant access to machines and/or to userids.Access in STAF is granted by specifying a certain trust level for a machine oruser, where trust level 0 indicates no access and trust level 5 indicates all access.Each service in STAF defines what trust level is required in order to use the variousfunctions the service provides.:ih1.trust:i2.levels:p.A basic description of each level follows:ul compact.:li.Level 0 - No access:li.Level 1 - Restricted access.  Only PING and helps available.:li.Level 2 - Limited access.  Only query/view facilities available.:li.Level 3 - Standard access.  Non-destructive updates allowed, e.g., logging.:li.Level 4 - Advanced access.  Update abilities, e.g., copying files, deletinglog files.:li.Level 5 - All access, e.g., SHUTDOWN, Process invocation, Trust definitionmanipulation:eul.:p.In order to use user trust security in STAF, you must have at leastone authenticator registered.:note.The local machine can be granted a trust level by specifyinginterface "local" and a system identifier of "local".:p.User authentication overrides machine authentication.  For example,if the machine trust level is 3 and the authenticated user has a trustlevel of 4, then the handle will have a trust level of 4.If the user has been authenticated, but there are no user authenticationtrust matches, the machine trust level is used.  If there is no machinetrust level specified, then the default trust level is used..*.*---------------------------------------------------------------------.*:ih1.queues:i2.concepts:h2 id=queuecon.Queues:p.Each handle in STAF has a priority queue associated with it.  This queueis used to accept/retrieve messages from other processes/machines.  Eachmessage in the queue has the following data associated with it.:ul compact.:li.Priority - An unsigned long value (0 - 4294967296) representing theimportance of the message, with 0 representing the most important message:li.Timestamp - The date/time the message was received:li.Machine - The machine which sent the message:li.Process name - The registered name of the process which sent the message:li.Handle - The handle of the process which sent the message:li.Message - The actual message itself:eul.:p.STAF allows you to register to receive notifications for certain events,such as STAF starting and shutting down.  These events will appear in thequeue of the requesting process.  They will reveal the originating handle ashandle 1 of the originating machine, which is the reserved STAF Process handle..*.*---------------------------------------------------------------------.*:ih1.codepage:i2.concepts:ih1.strings:i2.concepts:h2 id=stringcon.Strings and Codepages:p.The requests submitted to STAF and the results received from STAF are allstrings.  These strings may contain any arbitrary set of characters, includingthe NULL (i.e., 0) character.  When working in an environment with aheterogeneous set of codepages, STAF will translate the request and resultstrings from and to the necessary codepages.  This ensures that the request andresult strings are not misinterpreted by the receiver.:p.In general, when using STAF services, there shouldn't be any round trip problems."Round trip" in this context means when all requests are originating from the same system, even if the requests are sent to, and the data is stored on, a systemwith a different codepage.  However, if you send, for example, a request to logdata containing Japanese codepage specific characters to any system and thenquery the log from a system using a US English codepage, you won't get the"correct" data, as that is not a valid "round trip". :note.All STAF generated strings are composed of only ASCII-7 characters andwill safely survive the translation from/to different codepages..* XXX: Commented out since don't support REXX in STAF V3.*:note text=Caution.If you use a STAF service that is written in REXX, it .*can have round trip codepage translation problems.  All of STAF services.*currently provided are written in C++/Java so they do not have this problem.:p.:h3.Windows Codepage Translation Anomalies:p.If you need to specify non-ASCII characters in  a request, then you need to beaware of some anomalies if your target system is a Windows system that isn'tusing an English codepage and whose ANSI codepage (ACP) identifier is differentfrom the OEM codepage (OEMCP) identifier.  The system locale determines whichcodepages are defaults for the Windows system.  However, some European localessuch as French and German set different values for the ACP and OEMCP.By default, STAF uses the OEM codepage when doing codepage translation.But, depending on where the data is input, it may be necessary to tell STAFto use the ANSI codepage.  The ANSI codepage is used in the window managerand graphics device interface and by many applications.  However, the Windowscommand line and bat files use the OEM codepage as they are interpreted bycmd.exe.  You can use CHCP to display or change the codepage used by thecommand line.  Note that these anomalies occur only on Windows systems.:p.To avoid these Windows codepage anomalies, you may need to change the codepageused by STAF using one of these methods::p.:ul.:li.Change the OEMCP value to be set to the same data as the ACP value in theWindows Registry.  You can use REGEDIT to start the Windows Registry Editorand select Edit->Find and type in ACP to find its value data and then do thesame for OEMCP to find its value data.  Assuming they are different, youcould change the value data for OEMCP to be the same as the value data forACP by highlighting OEMCP and selecting Edit->Modify and enter the new valuedata for OEMCP and then exit the REGEDIT program.  The system must berebooted for the registry change to take effect.  Also, if the system isabnormally rebooted, it's possible that the Windows operating system mayreset the registry value.  This is the recommended method.:note text=Caution.You should NOT change the ACP value to the OEMCP value.:p.:li.Or, you can override the codepage used by STAF by setting theSTAFCODEPAGEOVERRIDE environment variable to the ANSI codepage and thenstart STAFProc.:eul.:note.To see the codepage that STAF is using, check the value ofSTAF variable STAF/Config/CodePage.  For example: :xmp.    STAF testmach1 VAR RESOLVE STRING {STAF/Config/CodePage}:exmp.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -