⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 genwl.script

📁 Software Testing Automation Framework (STAF)的开发代码
💻 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          : GenWL SCRIPT.*  Descriptive Name   : Software Test Automation Framework Generic Workload.*  Detail:.*.*     This file contains information on the Generic Workload processor..*.**************************-END-OF-PROLOG-*****************************:ih1.GenWL:ih1.workload:i2.generic workload processor:h1 id=genwl.Generic Workload Processor:p.The Generic Workload Processor, GenWL (pronounced Jen-Wall), allows you todefine a workload based on a set of machines, processes, and variables, andthen provides a means to start, stop, and query the workload..*.*---------------------------------------------------------------------.*:ih1.GenWL:i2.syntax:h2 id=genwlsyntax.GenWL Syntax:p.The syntax for the Generic Workload Processor is:xmp.GenWL <Workload Definition File> -<Start[&colon.<Actions>] | Stop | Query | Free>      [-<Include | Exclude>&colon.<MACHINE | PROCESS>&colon.<List>]      [-Quiet | -Verbose]:exmp.:p.The :xph.<Workload Definition File>:exph. defines the workload and isdiscussed in the next section.  The default file extension is .gwl.:p.:xph.-Start:exph. is used to start the workload.  The processes arestarted asynchronously in the order that they are defined in the :xph.<WorkloadDefinition File>:exph.  You may optionally specify which actions will takeplace when you start a workload.  These are specified in a comma separatedlist in place of :xph.<Actions>:exph. above.  No spaces should be used betweenthe commas and the actions.  The following are the valid actions::ul compact.:li.GlobalVar - Causes global variables to be set:li.MachineVar - Causes machine variables to be set:li.Var - Causes GlobalVar and MachineVar actions to occur:li.Process - Causes processes to be executed:li.All - Causes GlobalVar, MachineVar, and Process actions to occur (this isthe default):eul.:p.:xph.-Stop:exph. is used to stop the workload.:p.:xph.-Query:exph. is used to query the workload.:p.:xph.-Free:exph. is used to free the termination information for theworkload.:p.:xph.-Include:exph. and :xph.-Exclude:exph. allow you to specify thata certain set of machines or processes should be included or excluded fromprocessing.  The list of machines or processes is separated by commas andmay contain a trailing *, as a wildcard, on any value.  No spaces should beused between the commas and the values.  These lists are usedin place of :xph.<List>:exph. above.  :xph.-Includes:exph. are processedbefore :xph.-Excludes:exph..:p.:xph.-Quiet:exph. supresses all informational messages while processing:p.:xph.-Verbose:exph. provides additional informational messages whileprocessing:h4.Examples:note.GenWL is a REXX program.  On non-OS/2 systems, you will need to prefacethe following examples with :xph.REXX:exph..:p.Goal&colon. Start the workload defined in WebTests.gwl:xmp.GenWL WebTests -Start:exmp.:p.Goal&colon. Query the workload defined in Ogre.cfg:xmp.GenWL Ogre.cfg -Query:exmp.:p.Goal&colon. Set all global variables defined in MyTest.gwl on machinesclient1, client2, and client3.:xmp.GenWL MyTest -Start&colon.GlobalVar -Include&colon.MACHINE&colon.client1,client2,client3:exmp.:p.Goal&colon. Query the workload defined in MyTest.gwl, but exclude machineswhose names begin with bad.:xmp.GenWL MyTest -Query -Exclude&colon.MACHINE&colon.bad*:exmp.:p.Goal&colon. Stop the processes named Test1 and Test2 on machines client1 andclient2 that are defined in workload MyTest.gwl:xmp.GenWL MyTest -Stop -Include&colon.MACHINE&colon.client1,client2 -Include&colon.PROCESS&colon.Test1,Test2:exmp..*.*---------------------------------------------------------------------.*:h2 id=genwlwdf.Workload Definition File:p.The workload definition file defines the various machines, processes, andvariables that will be used in the workload.  The language used in thesefiles consists of the following elements, which will be discussed below.:ul compact.:li.Comment:li.Workload statement - declares the name of the workload:li.Variable statement - defines a workload, machine, or process variable:li.Machine block - defines the variables and processes for a machine:li.Process block - defines a process:li.Process references - provides a reference to a previously defined process:eul.:p.Blank lines in the file are ignored..*.*---------------------------------------------------------------------.*:h3.Comment:p.A comment begins with a pound sign, #, and continues through to the endof the line.:h4.Examples:xmp.WORKLOAD "Web Tests"      # Set the workload name:exmp..*.*---------------------------------------------------------------------.*:h3.Workload statement:p.The WORKLOAD statement defines the name of the workload.:h4.Syntax:xmp.WORKLOAD <Name>:exmp.:h4.Examples:xmp.WORKLOAD "Web Tests"WORKLOAD Ogre:exmp.:p.You must have a WORKLOAD statement in your workload definition file.  If youhave more than one, the last one takes precedence..*.*---------------------------------------------------------------------.*:h3.Variable statement:p.A variable statement allows you to specify a variable and its value.A variable statement inside of a process block is local to that particularprocess.  A variable statement inside of a machine block, but outside of aprocess block, is global to that machine.  A variable statement outside of amachine block is a workload variable, and is set as a global variable on allthe machines defined in the workload definition file.:h4.Syntax:xmp.VAR <Name=Value>:exmp.:h4.Examples:xmp.VAR WebServer=testsrv1.test.austin.ibm.comVAR "Good String=Command completed successfully":exmp..*.*---------------------------------------------------------------------.*:h3.Machine block:p.A machine block defines a machine you wish to use in the workload as wellas any global variables on that machine and any processes to run on thatmachine.:h4.Syntax:xmp.MACHINE <Name>    &lbrk.One or more variable statements&rbrk.    &lbrk.One or more process blocks&rbrk.    &lbrk.One or more process references&rbrk.END:exmp.:h4.Examples:xmp.MACHINE Client1    VAR LogDirectory=d:\logs    VAR MonitorDirectory=d:\monitor    PROCESS        COMMAND d:\testcase\tc1.exe    END    PROCREF tc2END:exmp..*.*---------------------------------------------------------------------.*:h3.Process block:p.A process block defines a process.  If the process is defined within amachine block then the process is specific to that machine.  If the processis defined outside of a machine block, then the process is global in natureand may be referenced by any machine block using a PROCREF statement (see:hdref refid=procref.).:h4.Syntax:xmp.PROCESS    &lbrk.NAME <Name>&rbrk.    COMMAND <Command>    &lbrk.WORKDIR <WorkDir>&rbrk.    &lbrk.TITLE <Title>&rbrk.    &lbrk.ENV <Name=Value>&rbrk.  &lbrk.ENV <Name=Value>&rbrk. ...    &lbrk.One or more variable statements&rbrk.END:exmp.:p.:xph.NAME:exph. specifies the name of the process.  This is used to referback to the process via a PROCREF.:p.:xph.COMMAND:exph., :xph.PARMS:exph., :xph.WORKDIR:exph., :xph.TITLE:exph.,and :xph.ENV:exph. are defined as in :hdref refid=procsrv..:h4.Examples:xmp.PROCESS    NAME WebTest1    COMMAND cmd.exe    PARMS "/c d:\\webtests\\webtest1.cmd"    WORKDIR d:\webtests    TITLE "Web Test 1"    ENV USEHOSTS=1    VAR WebServer=testsrv2.test.austin.ibm.comENDPROCESS COMMAND d:\webtests\webtest2.exe END:exmp..*.*---------------------------------------------------------------------.*:h3 id=procref.Process reference:p.A process reference is a reference to a previously defined process.  It isused inside a machine block to indicate that the previously defined processis to be executed by this machine.:h4.Examples:xmp.PROCREF WebTest1PROCREF "Big bad stress test":exmp..*.*---------------------------------------------------------------------.*:h2 id=genwlnotes.Notes on querying a workload:p.When you query a workload, you will see a section for each machine asdefined in the workload definition file.  In this section there will be oneline of information per process defined on that machine.  Each line containsthe handle of the process, with the registered name of the process inparentheses.  Following this information is either any available MONITORdata, if the process is still running, or completion information, if theprocess is no longer running.:h3.Examples:xmp.Client1-------42(WebTest1) - 19980215-13:12:17 Starting loop 12343(WebTest2) - 19980215-13:10:39 ERROR: invalid internal html linkClient2-------35(WebTest1) - Completed at 19980205-10:19:48, RC: 043(WebTest3) - 19980215-13:11:26 Entering JavaScript verification phase:exmp.:p.You may also receive warning messages if there are a greater or lessernumber of processes running under the context of the workload on a givenmachine than are defined in the workload definition file.  For example, ifClient1 is running three processes with the workload name "Web Tests", butonly two are defined in the workload definition file, you will get a warningindicating that there is one more process running than defined..*.*---------------------------------------------------------------------.*:ih1.examples:i2.GenWL:ih1.GenWL:i2.example:h2 id=genwlexmp.GenWL Example:h3.GenWL Input:xmp keep=4.# This is a  generic workload definition file for use with test environment 08# It makes use of the sitloop command file to start test cases.Workload "ST08 Environment Tests"## Define a workload variable#VAR WorkLoadID=ST08T5VAR Success_msg="Command completed successfully"VAR LogDirectory={STAF/Config/BootDrive}\ITLUTIL\STAFLogVAR MonitorDirectory={STAF/Config/BootDrive}\ITLUTIL\STAFMon## Define some processes for later use#PROCESS    NAME VACPP02    TITLE VACPP02    COMMAND cmd.exe    PARMS "/c sitloop /lc=1 /lt=600 /tc=vacpp02 /cmd=vacpp02_staf.cmd c: c:"ENDPROCESS    NAME VACPP03    TITLE VACPP03    COMMAND cmd.exe    PARMS "/c sitloop /lc=1 /lt=600 /tc=vacpp03 /cmd=vacpp03_staf.cmd c: c:"END#--------# ST08S04#--------Machine cd1b    PROCESS        TITLE L123G_1        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=600 /tc=L123G_1 /cmd=sitl123g_staf.cmd /p=s04held"    ENDEnd  # End of the machine block#--------# ST08R01#--------Machine cd1c    PROCESS        TITLE DB2_1        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=DB2_1 /cmd=sitdb2r_staf.cmd /c=1"    END    PROCESS        TITLE EXER_CCC        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=exer_ccc /cmd=exer_ccc_staf.cmd /S-ST08S04"    END    PROCESS        TITLE INTEROPA        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=INTEROPA /staf /cmd=sitls01.cmd /alias=s05util"    END    PROCESS        TITLE NW_1        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=20 /lt=600 /tc=NW_1 /cmd=itlnw211_staf.cmd"    END    PROCESS        TITLE L123G_1        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=5 /lt=600 /tc=L123G_1 /cmd=sitl123g_staf.cmd /p=s04held"    ENDEnd  # End of the machine block#--------# ST08R02#--------Machine cf2b    PROCESS        TITLE EXER_WEB        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=exer_web /cmd=exer_web_staf.cmd /ID-WEB"    END    PROCESS        TITLE INTEROPB        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=INTEROPB /staf /cmd=sitls01.cmd /alias=s01util"    END    PROCESS        TITLE Notes_TestNSF        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=4 /lt=600 /tc=notes_testnsf /cmd=sittnsf_staf.cmd"    END    PROCESS        TITLE BAPCO_3        COMMAND cmd.exe        PARMS "/c bapstart03_staf /lh=2"    END    PROCREF VACPP02    PROCREF VACPP03End  # End of the machine block#--------# ST08R09#--------Machine cd3b    PROCESS        TITLE EXER_WEB        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=10 /lt=60 /tc=exer_web /cmd=exer_web_staf.cmd /WS-ST08R09 /h-cd1b /ms-600 /ID-WEB"    END    PROCESS        TITLE ITLPing01        COMMAND cmd.exe        PARMS "/c sitloop /hours=2 /lc=20 /lt=60 /tc=itlping01 /cmd=itlping01_staf.cmd cf2c"    ENDEnd  # End of the machine block:exmp..*.*---------------------------------------------------------------------.*:ih1.GenWL:i2.query output:h3.GenWL Output:xmp keep=3.cd1b----5(nw_1) - 19980428-19:31:09 ST08T5---COMPLETED PASS: 18, SLEEP FOR 448SECcd1c----84(DB2_1) - Completed at 19980428-17:41:29, RC: 185(exer_ccc) - 19980428-19:31:04 ST08T5---STARTING PASS: 2786(INTEROPA) - 19980428-19:31:00 SITLS01---PASS 19: COPY 8MB.DAT FROM REMOTE COMPLETE87(NW_1) - 19980428-19:27:37 ST08T5---COMPLETED PASS: 19, SLEEP FOR 446SEC88(L123G_1) - Completed at 19980428-18:55:39, RC: 1cf2b----Warning: There were 6 more processes running on this machine than were         defined in st08.gwl2(exer_web) - Completed at 19980417-18:07:08, RC: 03(INTEROPB) - 19980417-14:36:32 SITLS01---PASS 1: COPY 8MB.DAT TO REMOTE COMPLETE4(notes_testnsf) - Completed at 19980417-15:14:25, RC: 15(bapco_3) - Completed at 19980417-14:51:16, RC: 06(vacpp02) - 19980417-14:28:44 ST08T5---STARTING PASS: 17(vacpp03) - 19980417-14:28:44 ST08T5---STARTING PASS: 110(exer_web) - 19980428-19:26:20 ST08T5---STARTING PASS: 1411(INTEROPB) - 19980428-17:35:17 ST08T5---STARTING PASS: 112(notes_testnsf) - 19980428-19:24:19 ST08T5---COMPLETED PASS: 3, SLEEP FOR 237SEC13(bapco_3) - 19980401-14:04:27 COMPLETED PASS: 114(vacpp02) - 19980428-17:35:17 ST08T5---STARTING PASS: 115(vacpp03) - 19980428-17:35:17 ST08T5---STARTING PASS: 1cd3b----6(exer_web) - 19980428-19:27:04 ST08T5---STARTING PASS: 117(itlping01) - 19980428-19:30:44 ST08T5---COMPLETED PASS: 103, SLEEP FOR 53SEC:exmp.

⌨️ 快捷键说明

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