US 6,311,320 B1Grant
Alterable scripting tool and method
Issue Date:2001-10-30
•20 Claims
•12 Drawing Sheets
Abstract
A scripting tool for executing a script command having at least one parameter includes a display device, a processor, and a memory. The memory has stored therein instructions which when executed by the processor cause the processor to generate a user input control for a parameter of the script command based upon a definition file, and display the user input control upon the display device. The instructions of the memory when executed by the processor further cause the processor to receive user input via the user input control, and generate a parameter value based upon the user input. Moreover, the instructions when executed by the processor cause the processor to set the parameter of the script command equal to the parameter value, and execute the script command based upon the parameter.
Metadata
Assignee
- LSI Logic Corporation
Inventor
- Mahmoud K. Jibbe
Application Information
Application Number:US 09/206,535
Filing Date:1998-12-07
Priority Date:1998-12-07
Art Unit:7
Classifications
IPC:
G06F 945
Field of Search:
717 1717 3717 4717 2345353714 38
Patent Drawings (12 sheets)
Description
BACKGROUND OF THE INVENTION
[0002] The present invention relates generally to scripting tools, and, more particularly to a scripting tool whose operation and user interface are based upon a definition file.
[0003] Scripts are a series of commands which are executed by a program called an interpreter. Each time the interpreter executes a script, the interpreter converts each script command into series of operations and functions which may be executed by a processor, and then causes the processor to execute the series of operations and functions. As a result of the interpreter converting the script each time the script is executed, scripts tend to execute more slowly than compiled programs. However, if a script is modified, then the change will be effected the next time the interpreter executes the script. With a compiled program, the program would have to be recompiled before the change would take effect. As a result, scripts tend to be easier and quicker to modify than compiled programs.
[0004] One environment in which the ease of script modification is advantageous is in the testing of computer devices such as SCSI host adapters, and SCSI devices. For example, a technician may desire to see how the computer device responds to slightly different parameters. By using scripts, the technician may quickly modify the script with the different parameters and re-execute the script to see how the computer device responds.
[0005] While scripts provide a technician with a quick way of testing computer devices, scripting systems have historically suffered from a variety of problems. For example, script writing has historically required a technician which is not only fluent in the scripting language but also is quite knowledgeable about parameter ranges which are supported by the device under test. Moreover, scripting systems especially for testing SCSI devices have historically been limited to computer devices having similar characteristics. In particular, scripting systems have historically utilized low level device specific interfaces in order to test the computer device. As a result, each new computer device requires a new scripting systems be developed or purchased. Moreover, prior scripting systems did not provide an easy mechanism for the technician to determine exactly how the computer device responded to a given command of a test script.
[0006] In light of the above problems suffered by scripting systems, there is clearly a need for a scripting tool which (i) provides an environment that eases the writing of scripts, (ii) may be used to test a variety of computer devices, and (iii) provides a technician with a mechanism to determine how a computer device responds to a given command of a test script.
SUMMARY OF THE INVENTION
[0007] In accordance with one embodiment of the present invention, there is provided a method of utilizing a definition file to define characteristics of at least one parameter of a script command. One step of the method includes displaying for a parameter of the script command, a user input control defined by the definition file. Another step of the method includes receiving user input via the user input control. The method also includes the step of generating a parameter value based upon the user input. Furthermore, the method includes the step of setting the parameter of the script command equal to the parameter value.
[0008] Pursuant to another embodiment of the present invention, there is provided a scripting tool for executing a script command having at least one parameter. The scripting tool includes a display device, a processor, and a memory having stored therein instructions. The instructions when executed by the processor cause the processor to generate a user input control for a parameter of the script command based upon a definition file. The instructions when executed by the processor further cause the processor to (i) display the user input control upon the display device, and (ii) receive user input via the user input control. Moreover, the instructions when executed by the processor further cause the processor to (i) generate a parameter value based upon the user input, (ii) set the parameter of the script command equal to the parameter value, and (iii) execute the script command based upon the parameter.
[0009] Pursuant to yet another embodiment of the present invention, there is provided a method of executing a script command having at least one parameter. The method includes the step of generating a user input control for a parameter of the script command based upon a definition file. Another step of the method includes receiving user input for the parameter via the user input control. The method also includes the steps of generating a parameter value based upon the user input, and setting the parameter equal to the parameter value. Yet another step of the method includes executing the script command based upon the parameter.
[0010] It is an object of the present invention to provide an new scripting method and apparatus.
[0011] It is an object of the present invention to provide an improved scripting method and apparatus.
[0012] It is yet another object of the present invention to provide a scripting method and apparatus for testing computer devices.
[0013] It is yet further object of the present invention to provide a scripting method and apparatus for testing SCSI devices.
[0014] It is still another object of the present invention to provide a scripting method and apparatus in which allowable parameter value ranges may be easily modified.
[0015] It is still yet another object of the present invention to provide a scripting environment in which test scripts may be executed and created.
[0016] It is yet a further object of the present invention to provide a scripting method and apparatus which may be utilized to test a variety of computer devices.
[0017] Another object of the present invention is to provide a scripting method and apparatus in which a user may easily relate the results of executing a script command with the script command that caused the results.
[0018] The above and other objects, features, and advantages of the present invention will become apparent from the following description and the attached drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
[0019] FIG. 1 shows a block diagram of a computer system in which features of the present invention may be incorporated;
[0020] FIG. 2 illustrates a functional block diagram of a scripting tool which may be implemented by the computer system of FIG. 1;
[0021] FIG. 3 illustrates a main application window of the scripting tool shown in FIG. 2;
[0022] FIG. 4 illustrates a select command window of the scripting tool shown in FIG. 2;
[0023] FIG. 5 illustrates an edit window of the scripting tool shown in FIG. 2;
[0024] FIG. 6 illustrates a status window of the scripting tool shown in FIG. 2;
[0025] FIG. 7 illustrates a device list window of the scripting tool shown in FIG. 2;
[0026] FIG. 8 illustrates an exemplary definition file of the scripting tool shown in FIG. 2;
[0027] FIG. 9 illustrates a definition file processing procedure used by the scripting tool shown in FIG. 2;
[0028] FIG. 10 illustrates a commands object built by the scripting tool shown in FIG. 2;
[0029] FIG. 11 illustrates a generic interface used by the scripting tool shown in FIG. 2; and
[0030] FIG. 12 illustrates a flow chart of a basic operating procedure implemented by the scripting tool shown in FIG. 2.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
[0031] While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof have been shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that there is no intent to limit the invention to the particular forms disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the appended claims.
[0032] FIG. 1 illustrates a computer system 100 in which various features of the present invention may be incorporated. In particular, the computer system 100 of FIG. 1 is suitable for implementing a scripting tool in accordance with features of the present invention. To this end, the computer system 100 includes a processor 102, a memory 104, a SCSI device chain 106, a display device 108, and input devices 110. Moreover, the computer system 100 includes a host adapter 112 for controlling the SCSI devices 106 (e.g. disk drives, CD-ROM drives, RAID device, scanners), a display adapter 114 for controlling the display device 108, an I/O controller 116 for controlling the input devices 110 (e.g. mice, keyboards, touch screens), and a system bus 118. The system bus 118 operably couples the processor 102 to the memory 104, the host adapter 112, the display adapter 114, and the I/O controller 116.
[0033] The memory 104 includes random access memory (RAM) such as SRAM (static RAM), DRAM (dynamic RAM), and SDRAM (synchronous DRAM) which store software routines obtained from computer readable medium such as a floppy disk, CD-ROM disc, DVD disc, DAT (digital audio tape), and hard disks. The memory 104 may also include nonvolatile computer readable medium such as PROM (programmable read only memory), EPROM (electrically PROM), EEPROM (electrically erasable PROM), and flash memory that store software routines. In particular, the memory 104 stores instructions defining software routines that, when executed by the processor 102, cause the processor 102 to configure the computer system 100 into a scripting tool that may be used to test the SCSI devices 106 and host adapter 112. Moreover, the memory 104 is further operable to store operating system software such as Microsoft's Windows NT 4.0 operating system.
[0034] The processor 102 is operable to execute the software routines stored in the memory 104, and communicate with the SCSI devices 106, the display device 108, and the input devices 110 via the host adapter 112, the display adapter 114, and the I/O controller 116 respectively. In particular, the processor 102 is operable to execute software routines of the memory 104 which cause the processor 102 to implement a scripting tool that may test the SCSI devices 106 and the host adapter 112.
[0035] In a preferred embodiment of the present invention, the computer system 100 implements a scripting tool 200 that incorporates features of the present invention. A functional block diagram of the scripting tool 200 is shown in FIG. 2. In general, the scripting tool 200 enables a user to create and execute scripts (also referred to as macros) that test SCSI devices coupled to a SCSI controller 106. In particular, the scripting tool 200 enables a user to interactively (i) create a test script by selecting commands from a set of script commands, (ii) define parameter values for the script commands of the test script, and (iii) execute the test script in order to test SCSI devices that are coupled to a SCSI controller. To this end, the scripting tool 200 includes a graphical user interface (GUI) 202, a log file 290, and a definition file 292 that cooperate to provide a user with a mechanism for (i) creating test scripts, and (ii) controlling execution of test scripts in order to test SCSI devices that are coupled to a SCSI controller.
[0036] Scripting Tool GUI
[0037] The GUI 202 includes a test script window 210, a select command dialog window 220, a current command window 230, a status window 240, an edit window 250, a device list window 260, and a command center 270. In a preferred embodiment of the present invention, the test script window 210, the current command window 230, and the command center 270 are combined to form a main application window 204. The main application window 204 is illustrated in FIG. 3. In a preferred embodiment of the present invention, the computer 100 displays the main application window 204 in response to the processor 102 executing a scripting tool application stored in the memory 104. In general, the main application window 204 is operable to (i) provide a user with information concerning a test script, and (ii) provide a user with a interface to the other elements of the GUI 202.
[0038] Specifically, the test script window 210 of the main application window 204 is operable to display a test script. The test script window 210 includes a list box control 212 that is operable to display each script command defining the test script. The list box control 212 is also operable to receive user input via a user input device 110 such as a mouse and/or a keyboard. In particular, the list box control 212 is operable to (i) receive user input, (ii) move a highlight bar 214 in response to the user input, and (iii) identify to the processor 102 the script commands of the test script that are highlighted by the highlight bar 214.
[0039] The current command window 230 of the main application window 204 is operable to display the parameters and parameter values of the script command currently highlighted in the test script window 210. For example, as a result of the ECHO script command being highlighted in the list box control 212, the current command window 230 displays the parameters and parameter values currently associated with the ECHO script command. In particular, the current command window 230 displays the verbose_level parameter with a value of 0, the message parameter set to “Message 1”, and the comment parameter set to the null string of “”. Moreover, in a preferred embodiment of the present invention, the current command window 230 is a view only window. In other words, the current command window 230 is operable to display the parameters and parameter values of the highlighted script command, but is not operable to receive user input for editing the parameter values of the highlighted script command.
[0040] The command center 270 as illustrated in FIG. 3 includes a menu bar 272 and a tool bar 282. In general, the menu bar 272 provides a drop-down menu interface to trigger execution of various scripting tool commands, and the tool bar 282 provides a push button interface to trigger execution of common scripting tool commands. In particular, the menu bar 272 in a preferred embodiment of the present invention includes a file drop-down menu 274, an operation drop-down menu 276, a view drop-down menu 278, and a help drop-down menu 280.
[0041] The file drop-down menu 274 provides a user with an interface to trigger execution of file manipulation commands. In particular, the file drop-down menu 274 provides menu selections for triggering execution of a load test script command, a save test script command, and a print test script command. The load test script command, when executed, provides a user with an interface to load a previously saved test script into the test script window 210. The save test script command, when executed, provides a user with an interface to save the test script displayed in the test script window 210 to a computer readable medium such as a disk drive. The print test script command, when executed, provides the user with an interface to print the test script displayed in the test script window 210 to a printer (not shown) of the computer system 100. In a preferred embodiment of the present invention, a load button 283 of the tool bar 282 provides an alternative mechanism for triggering execution of the load test script command, and a save button 284 of the tool bar 282 provides an alternative mechanism for triggering execution of the save test script command.
[0042] The file drop-down menu 274 also provides a user with an interface to a log file 290 (see FIG. 2) in which the scripting tool 200 records status information. In particular, the file drop-down menu 274 provides menu selections for triggering execution of a view log file command, and a clear log file command. The view log file command, when executed, cause the scripting tool 200 to display the contents of the log file 290, and the clear log file command, when executed causes the scripting tool 200 to clear the contents of the log file 290.
[0043] The operation drop-down menu 276 of the menu bar 272 provides a user with an interface to trigger execution of script editing commands. In particular, the operation drop-down menu 276 provides menu selections for triggering execution of a delete command, a cut command, a copy command, a paste command, an insert command, and an edit command. The delete command, when executed, removes the script command or commands highlighted in the test script window 210 from the test script. The cut command, when executed, removes the script command or commands highlighted in the test script window 210 from the test script, and stores the removed script commands in a buffer area referred to as the clipboard in the Windows NT environment. The copy command, when executed, stores in the clipboard a copy of the script command or commands highlighted in the test script window 210. The paste command, when executed, inserts a copy of the script command or commands stored in the clipboard at the insertion point highlighted in test script window 210 by the highlight bar 212.
[0044] In a preferred embodiment of the present invention, a copy button 288 of the tool bar 282 provides an alternative mechanism for triggering execution of the copy command. Similarly, a cut button 289 of the tool bar 282 provides an alternative mechanism for triggering execution of the cut command. Likewise, a paste button 290 of the tool bar 282 provides an alternative mechanism for triggering execution of the paste command.
[0045] The insert command, when executed, provides a user with an interface to insert a script command into the test script displayed in the test script window 210. In particular, in response to execution of the insert command, the scripting tool 200 displays the select command window 220 of the GUI 202. The select command window 220 is illustrated in FIG. 4. The select command window 220 includes a list box control 222 that is operable to display script commands for generating and executing SCSI common descriptor blocks (CDB), initializing the test environment, handling and recovering from errors, performing file I/O operations, and manipulating buffers. (See Appendix A for a detailed description of the script commands supported by a preferred embodiment of the present invention.) The list box control 222 of the select command window 210 is also operable to (i) receive user input, (ii) move a highlight bar 224 in response to the user input in order to select a script command displayed in the list box control 222, and (iii) identify the selected script command to the processor 102 so that the processor 102 may insert the selected script command into the test script. In particular, the processor 102 inserts the selected script command into the test script at an insertion point indicated in the test script window 210 by the highlight bar 214. In a preferred embodiment of the present invention, an insert button 285 of the tool bar 282 provides an alternative mechanism for triggering execution of the insert command.
[0046] The edit command, when executed, provides a user with an interface for editing parameter values of a script command of the test script. In particular, the edit command, when executed, provides a user interface for editing parameter values of the script command highlighted in the test script window 210 with the highlight bar 214. As illustrated in FIG. 5, when the edit command is executed, the scripting tool 200 generates based upon a definition file 292, an edit window 250 that includes user input controls 2521, 2522. . . 25215for each parameter of the highlighted script command. In particular, the user input controls 2521, 2522. . . 25215are operable to (i) identify each parameter of the highlighted script command, and (ii) display the current parameter value for each parameter. Moreover, the user input controls 2521, 2522. . . 25215are operable to (i) receive user input, (ii) change corresponding parameter values based upon the user input, and (iii) identify the changed parameter values to the processor 102 so that the processor 102 may set the corresponding parameters of the highlighted script command equal to the changed parameter values. In a preferred embodiment of the present invention, an edit button 286 of the tool bar 282 provides an alternative mechanism for triggering execution of the edit command.
[0047] The operation drop-down menu 276 also provides a user with an interface to trigger script execution commands. In particular, the operation drop-down menu 276 provides menu selections for triggering execution of an execute command, a step command, and an auto execute command. The execute command, when triggered, causes the scripting tool 200 to (i) execute the script command or commands that are highlighted in the test script window 210 by the highlight bar 214, and (ii) leave the selected script commands highlighted with the highlight bar 214 after execution.
[0048] Similarly, the step command, when triggered, causes the scripting tool 200 to (i) execute the script command or commands highlighted in the test script window 210 by the highlight bar 214, and (ii) move the highlight bar 214 such that the highlight bar 214 highlights the script command following the executed script commands. In other words, the difference between the execute command and step command is that the location of the highlight bar 214 changes in response to the step command but remains in place in response to the execute command. In a preferred embodiment of the present invention, a step button 287 of the tool bar 282 provides an alternative mechanism for triggering execution of the step command.
[0049] The auto execution command, when triggered, causes the scripting tool 200 to execute the script commands of the test script. In particular, the auto execution command when triggered cause the scripting tool 200 to start executing the test script from the script command highlighted in the test script window 210 and to continue executing the script commands of the test script until the last script command of the test script is executed. In a preferred embodiment of the present invention, a user may halt execution of the test script during auto execution of the test script by entering appropriate user input such as pressing the <Esc>key.
[0050] The operation drop-down menu 276 also provides a user with an interface to an I/O data buffer. In particular, the operation drop-down menu 276 provides a menu selection for triggering execution of an edit I/O data buffer command. The edit I/O data buffer command, when executed, causes the scripting tool 200 to display the contents of the I/O data buffer, and provide a user with an interface for editing the contents of the I/O data buffer. In a preferred embodiment of the present invention, an edit data buffer button 291 of the tool bar 282 provides an alternative mechanism for triggering execution of the edit I/O data buffer command.
[0051] The operation drop-down menu 276 also provides a user with an interface to a status window 240. The status window 240 is operable to display status information and SCSI sense data resulting from execution of script commands. In a preferred embodiment of the present invention, the scripting tool 200 displays the status window 240 such that the status window 240 hides or replaces the current command window 230 (see FIG. 6). In this manner, the scripting tool 200 allows simultaneous display of the test script window 210 and the status information generated from the test script. In a preferred embodiment, the scripting tool 200 uses this simultaneous display to provide a visual correspondence between status information and the script command causing the status information by moving the highlight bar 214 in the test script window 210 as the script is executed. For example, due to the position of the highlight bar 214 in FIG. 6, a user can easily ascertain that the information displayed in the status window 240 resulted from execution of the test script up to the READ script command.
[0052] Moreover, in a preferred embodiment, the scripting tool 200 stores in the log file 290 and displays in the status window 240 certain status information resulting from execution of the test script and does not store and does not display other status information resulting from execution of the test script based upon a verbose level configuration setting. In particular, if the verbose level configuration setting is equal to 0, then the scripting tool 200 stores in the log file 290 and displays in the status window 240 error messages resulting from execution of the test script commands. However, if the verbose level configuration setting is equal to 1, then the scripting tool 200 stores in the log file 290 and displays in the status window 240 not only error messages but also parameter file information. A verbose level of 2 results in the scripting tool 200 logging and displaying the status information of verbose level 2 plus command message information. Finally, a verbose level of 3 results in the scripting tool 200 logging and displaying the status information of verbose level 2 plus all other messages generated due to executing the test script.
[0053] The operation drop-down menu 276 of the menu bar 282 further provides a user with an interface to a device list command. In particular, the operation drop-down menu 276 provides a menu selection for triggering execution of a device list command. The device list command, when executed, causes a device list window 260 to be displayed. The device list window 260 provides a list of devices coupled to the computer system 100 that may be tested by the scripting tool 200. In a preferred embodiment of the present invention, the device list window 260 provides a list of SCSI devices that are coupled to the computer system 100 along with information pertinent to the SCSI device.
[0054] For example, FIG. 7 illustrates in detail the device list window 260 of a preferred embodiment of the present invention. As illustrated, the device list window 260 includes a display window 266 which is operable to display in a columnar fashion for each SCSI device coupled to the computer system 100, the SCSI port value, the Target value, the LUN value, the Vendor string, the Product string, the Unit value, and the Name string obtained from each SCSI device.
[0055] The SCSI port value is the number that should be used for the Host ID parameter of the script commands shown in Appendix A. The SCSI port value is not actually the SCSI bus ID of the device, but is a number assigned to the SCSI device by the Windows NT operating system. The Target value and LUN value are the SCSI device's target ID and logical unit number respectively. The Vendor string and Product string provide vendor and product information obtained from the SCSI device via an inquiry command. The Unit value is a unique number used by the scripting tool 200 to access a given device. The Name string displays the internal name assigned to the SCSI device by the Windows NT operating system.
[0056] In order to obtain this information, the device list window 260 of FIG. 7 includes a scan devices button 262. The scan devices button 262 when selected by the user causes the scripting tool 200 to obtain the above device list information for the SCSI devices detected by the operating system of the computer system 100. In particular, the scan devices button 282 triggers the execution of standard SCSI inquiry commands (see Appendices A and C) in order to obtain the device list information from the SCSI devices. The device list window 260 also includes a filter check box 264. The filter check box 264 when checked causes the scripting tool 200 to filter out (i.e. not display) information obtained from SCSI devices that return non-standard inquiry information.
[0057] Scripting Tool Definition File
[0058] As stated above, the scripting tool 200 generates the edit window 250 based upon the script command highlighted in the test script window 210 and the definition file 292. In particular, the scripting tool 200 generates an edit window 250 for each script command that is based upon parameter and user input control definitions stored in the definition file 292. Portions of an exemplary definition file 292 are illustrated in FIG. 8. In general, the definition file 292 includes a command list section (lines 1-9) and several parameter definition sections (lines 11-125). The command list section lists each script command supported by the scripting tool 200. More specifically, the command list section associates each script command with a command number and a parameter definition section of the definition file 292. The command number is used by the scripting tool 200 to identify software routines that the scripting tool 200 needs to execute in order to perform the function of the script command associated with the command number.
[0059] For example, line 8 of the exemplary definition file 292 associates the DISK_RAND_WR_VER script command with command number 65. The scripting tool 200 includes software routines, identified by the command number 65, which when executed cause the scripting tool to perform the function defined by the DISK_RAND_WR_VER script command. In this manner, the software scripting tool 200 may associate the alterable parameter definition for the DISK_RAND_WR_VER script command with compiled software functions used to implement the DISK_RAND_WR_VER script command without requiring that the scripting tool software be rewritten and recompiled.
[0060] The command list section also associates the script command with a parameter definition section of the definition file 292. The scripting tool 200 utilizes the information of the associated parameter definition section to generate an edit window 250 for the associated script command. In a preferred embodiment of the present invention, the parameter definition section for each script command defines characteristics such as user input prompts, default parameter values, parameter value ranges, parameter value types, and user input control types for each parameter of the associated script command. Specifically, in a preferred embodiment, the parameter section is defined using a combination of the following keywords: NFIELD, PROMPT, INPUT_TYPE, LENGTH, VARIABLE_TYPE, TEXT, RANGE, CHOICES, RETURNS.
[0061] The NFIELD keyword is used to define the number of parameters or fields associated with the script command. For example, line 27 of the definition file 292 sets the NFIELD keyword equal to 15 in order to indicate that the DISK_RAND_WR_VER script command has 15 parameters.
[0062] The PROMPT keyword is used to define a prompt string for identifying the parameter in the edit window 250. For example, line 29 of the definition file 292 sets the PROMPT keyword for the first parameter of the DISK_RAND_WR_VER script command equal to the string “timer.” As a result, the scripting tool generates the edit window 250 for DISK_RAND_WR_VER script command such that the string “timer” identifies the first field of the edit window 250. An exemplary edit window 250 for the DISK_RAND_WR_VER script command is illustrated in FIG. 5.
[0063] The INPUT_TYPE keyword is used to define a user input control type for the associated parameter of the script command. In a preferred embodiment of the present invention, the scripting tool 200 supports an edit box control type, and a combo box control type. In particular, the scripting tool 200 generates a user input control of the edit box control type in response to the INPUT_TYPE keyword being set equal to 0. An edit box control (i.e. a user input control of the edit box control type) allows a user to directly input data via a keyboard or other input device. Since line 62 of the definition file 292 sets the INPUT_TYPE keyword equal to 0, the scripting tool 200 generates an edit box control 2526for the io_cnt parameter of the DISK_RAND_WR_VER script command so that a user may edit the parameter value associated with the io_cnt parameter.
[0064] The scripting tool 200 generates a user input control of the combo box control type in response to the INPUT_TYPE keyword being set equal to 1. Similar to the edit box control, a combo box control (i.e. a user input control of the combo box control type) allows a user to directly input data via a keyboard of other input device. However, the combo box control also (i) provides the user with a drop-down list of valid values from which the user may select, and (ii) limits the input to one of these valid values. Since line 30 of the definition file 292 sets the INPUT_TYPE keyword equal to 1, the scripting tool 200 generates a combo box control 2521for the timer parameter of the DISK_RAND_WR_VER script command so that a user may edit the parameter value associated with the timer parameter.
[0065] It should be appreciated by those skilled in the art that while a preferred embodiment of the present invention utilizes an edit box control type, and a combo-box control type, the scripting tool 200 may be implemented to use other types of user input controls such as a radio-button control type, a check-box control type, and a list box control type.
[0066] The LENGTH keyword is used to define the number of characters that the user is allowed to enter via the associated edit box control. For example, line 63 of the definition file 292 sets the LENGTH keyword equal to 8. Accordingly, a user may only enter up to 8 characters into the edit box control 2526used for the io_cnt parameter.
[0067] The VARIABLE_TYPE keyword is used to define an acceptable data type for the associated parameter. In particular, in the preferred embodiment, the VARIABLE_TYPE keyword may be set to either a string type, a numeric type, or a pattern type by setting the VARIABLE_TYPE keyword to 0, 1, or 2, respectively. If the VARIABLE_TYPE keyword is set equal to 0, then the corresponding user input control will allow a user to input a string of characters for the associated parameter. Similarly, if the VARIABLE_TYPE keyword is set equal to 1, then the corresponding user input control will allow a user to input a number for the associated parameter. Furthermore, if the VARIABLE_TYPE keyword is set equal to 2, then the corresponding user input control will allow a user to input a hexadecimal pattern for the associated parameter. Since line 65 of the definition file 292 sets the VARIABLE_TYPE keyword equal to 1, the scripting tool 200 only allows a user to input a number for the io_cnt parameter of the DISK_RAND_WR_VER script command.
[0068] The TEXT keyword is used to define a default value for the associated parameter. For example, since line 33 of the definition file 292 sets the TEXT keyword equal to disabled, the scripting tool 200 defaults the timer parameter of the DISK_RAND_WR_VER script command to a value of disabled. In other words, unless a user inputs another value for the timer parameter of the DISK_RAND_WR_VER script command, the timer parameter will have a value of disabled.
[0069] The RANGE keyword is used to define an allowable numeric range for the associated parameter. In particular, the RANGE keyword is used to define a minimum value and a maximum value for the associated parameter. For example, line 64 of the definition file 292 defines a minimum value of 0 and a maximum value of 3000000 for the io_cnt parameter of the DISK_RAND_WR_VER script command. Accordingly, the scripting tool 200 limits user input via the edit box control 2526for the io_cnt parameter to values between and including 0 and 3000000.
[0070] The CHOICES keyword is used to define a list of allowable choices for the associated parameter. For example, line 31 of the definition file 292 sets the CHOICES keyword equal to a comma delimited list of enabled and disabled. Accordingly, the combo box control 2521for the timer parameter of the DISK_RAND_WR_VER script command limits the user to choices of enabled and disabled.
[0071] The RETURNS keyword is used to define values to assign the associated parameter in response to choices selected via a combo box control. For example, line 31 of the definition file 292 sets the CHOICES keyword equal to a comma delimited list of enabled and disabled, and line 32 of the definition file 292 sets the RETURNS keyword equal to a comma delimited list of enabled and disabled. Accordingly, if a user selects enabled from the combo box control 2521for the timer parameter of the DISK_RAND_WR_VER script command, then the scripting tool 200 sets the timer parameter equal to enabled. Similarly, if a user selects disabled from the combo box control 2521, then the scripting tool 200 sets the timer parameter equal to disabled.
[0072] Definition File Preprocessing
[0073] In the preferred embodiment of the present invention, the definition file 292 is a simple text file that may be edited with a common text editor. Parsing a text file in order to extract information from the text file can be time consuming and computationally intensive. Accordingly, in order to speed up execution of the scripting tool 200, the scripting tool 200 preprocesses the definition file 292. In particular, the scripting tool 200 preprocesses the definition file 292 to generate a binary definition file that represents the definition information of the definition file 292. Due to the structure of the binary definition file, the scripting tool 200 is able to extract parameter definition information from the binary definition file more quickly than parsing the definition file 292.
[0074] In particular, in a preferred embodiment of the present invention, the scripting tool 200 creates and saves a binary definition file which represents a commands object 1010 illustrated in FIG. 10. Specifically, the scripting tool creates the binary definition file such that the scripting tool may index the binary definition file in order to quickly obtain script command information contained in the commands object 1010. The commands object 1010 includes a NCOMMANDS field 10121and an array field 10122. The NCOMMANDS field 1012 is used to store a value N that indicates the number of script commands defined in the definition file 292. The array field 10122is used to store an array of command objects 10201, 10202, . . . 1020N. In particular, the array field contains a command object 1020xfor each script command defined in the definition file 292.
[0075] Each command object 1020xin a preferred embodiment includes a NAME field 10221, a NFIELDS field 10222, and an array field 10223. The NAME field 10221is used to store a string indicating a script command name for the script command associated with the command object 1020x. The NFIELDS field 10222is used to store a value M that indicates the number of parameters used by the script command represented by the command object 1020x. The array field 10223is used to store an array of field objects 10401, 10402, . . . 1040M. In particular, the array contains a field object 1040xfor each parameter defined in the definition file 292 for the associated script command.
[0076] Each field object 1040xin a preferred embodiment includes an array of definition objects 10501, 10502. . . 105012. In particular, each field object 1040xincludes a PROMPT definition object 10501, an INPUT_TYPE definition object 10502, a VARIABLE_TYPE object 10503, a TEXT definition object 10504, an ACTUAL TEXT definition object 10505, a LENGTH definition object 10506, a MINIMUM definition object 10507, a MAXIMUM definition object 10508, a CHOICES definition object 10509, a RETURNS definition object 105010, a VALUE definition object 105011, and a PATTERN definition object 105012.
[0077] The PROMPT definition object 10501is used to store a string of the definition file 292 that is set equal to the PROMPT keyword. The INPUT_TYPE definition object 10502is used to store the value of the definition file 292 that is set equal to the INPUT_TYPE keyword. The VARIABLE_TYPE definition object 10503is used to store the value of the definition file 292 that is set equal to the VARIABLE_TYPE keyword.
[0078] The TEXT definition object 10504is used to store the string of the definition file 292 that is set equal to the TEXT keyword. The TEXT definition object 10504is also used to store a user input string for the parameter if the user edits the value for the associated parameter. If a user causes a variable to be stored in the TEXT definition object 10504, then the ACTUAL TEXT definition object 10505is used to store the string represented by the variable stored in the TEXT definition object 10504.
[0079] The LENGTH definition object 10506is used to store a value of the definition file 292 that is set equal to the LENGTH keyword. The MINIMUM definition object 10507is used to store a minimum value indicated by the RANGE keyword of the definition file 292, and MAXIMUM definition object 10508is used to store a maximum value indicated by the RANGE keyword of the definition file 292.
[0080] The CHOICES definition object 10509is used to store the choices list of the definition file 292 that is set equal to the CHOICES keyword. The RETURNS definition object 105010is used to store the returns list of the definition file 292 that is set equal to the RETURNS keyword.
[0081] The VALUES definition object 10501, is used to store a numeric value for the parameter if the VARIABLE_TYPE definition object 10503indicates a numeric type. Similarly, the PATTERN definition object 105012is used to store a hexadecimal pattern for the parameter if the VARIABLE_TYPE definition object 10503indicates a pattern type.
[0082] FIG. 9 illustrates a definition file processing procedure 900 which is executed by the scripting tool 200 each time the scripting tool 200 is initialized in order to obtain the commands object 1010. In particular, the scripting tool 200 at step 902 determines whether the scripting tool 200 has an up to date preprocessed version of the definition file 292. Specifically, the scripting tool 200 determines whether the file system of the computer system 100 includes a binary definition file (i.e. a preprocessed definition file). If the file system does not include the binary definition file, then the scripting tool 200 proceeds to step 904 since the scripting tool 200 does not have access to a preprocessed up to date version of the definition file 292.
[0083] However, if the file system does include the binary definition file, then the scripting tool 200 compares a first file system time stamp associated with the definition file 292 to a second file system time stamp associated with the binary definition file. If the first file system time stamp indicates a later time than the second file system time stamp, then the scripting tool 200 determines that the binary definition file may be out dated. Accordingly, the scripting tool 200 proceeds to step 904 in order to process the definition file 292 and re-generate a preprocessed up to date version of the definition file 292.
[0084] In step 904, the scripting tool 200 opens the definition file 292. Then in step 906, the scripting tool 200 parses the command list section of the definition file 292 in order to obtain a list of commands defined in the definition file 292. Moreover, in response to obtaining the list of commands defined in the definition file 292, the scripting tool 200 creates a commands object 1000 (See. FIG. 10.) which is essentially a data structure for encapsulating both functions and data relating to script commands.
[0085] The script tool 200 in step 908 creates a command object 1020xfor each script command listed in the command list section of the definition file 292. In step 910, the script tool 200 parses the parameter definition sections for each script command and creates a field object 1040xfor each parameter defined by the definition file 292. In particular, the scripting tool 200 creates each field object 1040xsuch that the field object 1040xrepresents the parameter as defined in the definition file 292.
[0086] In step 912, the scripting tool 200 stores the created field objects 1040xinto their respective command objects 1020x, and in step 914 stores the created command objects 1020xinto the commands object 1010. As a result of the above processing of the definition file 292, the scripting tool 200 has obtained a commands object 1010 that includes a command object 1020xfor each of the script commands listed in the definition file 292. The commands object 1010 essentially is a structured binary representation of the parameter definition information of the definition file 292. Accordingly, the scripting tool 200 may efficiently obtain from the commands object 1020, parameter information concerning any script command of the scripting tool 200. In order to eliminate reprocessing of the definition file 292 every time the scripting tool 200 is initialized, the scripting tool 200 in step 916 saves a binary representation of the commands object 1010 in a binary definition file. In particular, the scripting tool 200 creates the binary definition file such that the scripting tool 200 may index the binary definition file in order to quickly obtain specific definition information from the binary definition file.
[0087] If the scripting tool in step 902 determines that the file system of the computer 100 does include a binary definition file representing a preprocessed up to date version of the definition file 292, then the scripting tool 200 proceeds to step 918. In step 918, the scripting tool 200 opens the binary definition file in order to obtain parameter definition information for the scripting commands of the scripting tool 200. Then in step 920, the scripting tool 292 instantiates a commands object 1010 into which the scripting tool 292 may store command objects 1020x. In step 922, the scripting tool 292 determines from the binary definition file the number of defined script commands and instantiates a command object 1020xfor each defined script command. Similarly, in step 924, the scripting tool 292 determines from the binary definition file the number of defined parameters and instantiates a field object 1040xfor each defined parameter of the binary definition file.
[0088] The scripting tool 200 in step 926 instantiates a definition object 1050xfor each keyword definition of the binary definition file, and stores the keyword definition information into the instantiated definition objects 1050x. The scripting tool 200 then stores the definition objects 1050xinto appropriate field objects 1020x.
[0089] In step 928, the scripting tool 200 stores the created field objects 1040xinto the appropriate command object 1020x. For example, the scripting tool 200 stores the timer field object 10401in the DISK_RAND_WR_VER command object 102065. Then, in step 930, the scripting tool 200 stores the created command objects 1020xinto the commands object 1010.
[0090] It should be appreciated that the scripting tool 200 builds the same commands object 1010 whether the scripting tool 200 builds the commands object 1010 from the definition file 292 or builds the commands object 1010 from the binary definition file. However, if the scripting tool 200 builds the commands object 1010 from the definition file 292, then the scripting tool 200 must parse the definition file 292 in order to obtain the parameter definition information contained in the definition file 292. On the other hand, if the scripting tool 200 builds the commands object 1010 from the binary definition file, then the scripting tool 200 may directly index definition information contained within the binary definition file. Indexing data on a whole is much quicker than parsing a text file to obtain the same data. Accordingly, the scripting tool 200 in the preferred embodiment utilizes the binary definition file to build the commands object 1010 if the binary definition file is up to date with the parameter information contained in the definition file 292.
[0091] Generic Host Adapter Interface
[0092] Several scripting commands of the scripting tool 200 require that data be written to and received from the SCSI devices 106 coupled to the host adapter 112. In a preferred embodiment of the present invention, the scripting tool 200 utilizes a generic host adapter interface which is illustrated in FIG. 11. As a result of utilizing the generic host adapter interface of FIG. 11, the scripting tool 200 is operable to test multiple types of host adapters and SCSI devices.
[0093] As illustrated in FIG. 11, the scripting tool 200 utilizes a device driver 1120 in order to communicate with the host adapter 112 and the SCSI device chain 106. In particular, the device driver 1120 is coded specifically for providing a communication interface to the host adapter 112. In other words, the device driver 1120 is operable to provide a communication interface to host adapters that are of the same make and model as the host adapter 112, but the device driver 1120 may be inoperable to provide a communication interface to any host adapter that is not completely compatible with the host adapter 112.
[0094] In order to extend the functionality of the scripting tool 200, the scripting tool 200 utilizes a generic device driver interface 1110. The generic device driver interface 1110 provides the processor 102 of the scripting tool 200 with a consistent interface for communicating with device drivers of many types. In a preferred embodiment of the present invention, the generic device driver interface 1110 is provided by the DeviceloControl function of the Microsoft Win32 API. (See Appendix B & C for further details.) The DeviceloControl function provides the processor 102 with a mechanism for controlling the host adapter 112 via a SCSI miniport interface 1122 of the device driver 1120.
[0095] Utilizing the generic device driver interface 1110 extends the scope of host adapters and devices that the scripting tool 200 may test. In other words, if a host adapter has a device driver that provides an interface accessible by the generic device driver interface 1110, then the scripting tool 200 should be operable to test the host adapter and devices coupled thereto. Since most SCSI device drivers for Windows NT include a SCSI miniport interface, a preferred embodiment of the scripting tool 200 which utilizes the DeviceloControl function should be able to test most host adapters and SCSI device that are compatible with the Windows NT operating system.
[0096] General Operation of Scripting Tool
[0097] A basic operational procedure 1200 is illustrated in FIG. 12 in order to provide a basic understanding of how a user may generate and execute a test script via the scripting tool 200. It should be appreciated by those skilled in the art that the following description only describes a portion of the operation of the scripting tool 200. Due to the interactive interface provided by the scripting tool 200, a detailed description of every possible user input and resulting scripting tool response would likely be more confusing than helpful. Furthermore, one skilled in the art may glean much of the detailed operation of the scripting tool 200 from the above description of the GUI 202 and general knowledge of Windows applications.
[0098] In step 1202, the scripting tool 200 generates the commands object 1010 based upon the definition file 292. (See FIG. 9 and accompanying description.) As described above, the scripting tool 1202 in a preferred embodiment builds the commands object 1010 each time the scripting tool application is executed on the computer system 100. Moreover, the scripting tool 200 generates a test object in which may be stored command objects 1020. As will be discussed in more detail below, the test object defines the current test script for the scripting tool 200. Accordingly, upon execution of the scripting tool application, the scripting 200 generates an empty test object for storing a later defined test script.
[0099] Once the application is running and the commands object 1010 is built, a user is presented with the main application window 204 shown in FIG. 3. The user may then cause the scripting tool 200 to perform various actions via user input to the test script window 210 or the command center 270. In particular, if the user selects the insert button 285 of the toolbar 282, presses the <Insert> key, or selects the insert command from the operation menu 276, then the scripting tool 200 in step 1204 presents the user with the select command window 220 shown in FIG. 4. More specifically, the scripting tool 200 generates the select command window 220 based upon the NAME fields 10221of each command object 1020xstored in the commands object 1010, and displays the generated select command window 220 upon the display device 108.
[0100] The user may then select a script command from the select command window 220. In response to the user selecting a script command from the script command window 220, the scripting tool 200 determines which script command the user selected, and instantiates a new copy of the command object 1020xstored in the commands object 1010 which represents the selected command. Moreover, the scripting tool 200 stores the newly instantiated copy of the command object 1020 in the an appropriate location of the test object, and inserts the string stored in the NAME field 10221in the test script window 210.
[0101] After the scripting tool 200 inserts the new command object 1020 into the test object and places the NAME string in the appropriate location of the test script window 210, the scripting tool 200 removes the select command window 220 from the display device 108, thus returning the user to the main application window 204. Then the scripting tool 200 in step 1208 determines whether the user desires to enter another script command into the test script displayed in the test script window 210. In particular, the scripting tool 200 determines whether the user has selected the insert button 285 of the toolbar 282, pressed the <Insert> key, or selected the insert command from the operation menu 276. If the user has performed any of these actions, then the scripting tool 200 returns to step 1204 in order to allow the user to insert another script command into the test script at the location highlighted by the highlight bar 214. In this manner, the user is able to build a list of script commands that define a test script. Moreover, the scripting tool 200 is able to track the order and content of the script commands of the test script via command objects 1020 stored in the test object. .
[0102] In step 1210, the scripting tool 200 determines whether the user desires to edit a script command of the test script. In particular, the scripting tool 200 determines whether the user has selected (i) the edit button 286 of the toolbar 282, or (ii) the edit command from the operation menu 276. If the user has performed one of these actions, then the scripting tool 200 in step 1222 displays an edit window 250 for the script command highlighted in the test script window 210. To this end, the scripting tool 200 determines from an index value that is based upon the location of the highlight bar 214 which command object 1020 of the test object corresponds to the script command that the user desires to edit. Then the scripting tool 200 generates the edit window 250 based upon the field objects 1040 of the command object 1020. FIG. 5 illustrates an appropriate edit window 250 for the DISK_RAND_WR_VER script command.
[0103] The scripting tool 200 in step 1224 receives user input via the user input controls 252xof the edit window 250. In response to the user input, the scripting tool updates the corresponding definition objects 1050xof the field objects 1040x. In this manner, the scripting tool 200 is able to maintain and the user is able to edit the parameter values for the script commands comprising the test script.
[0104] In step 1212, the scripting tool 200 executes the test script displayed in the test script window 210. In particular, the scripting tool 200 executes appropriate software routines based upon the command objects 1020 stored in the test object. More specifically, if the user indicates that the scripting tool should execute the complete test script, then scripting tool 200 reads each command object 1020 stored in the test object, determines functions to execute in order to perform the operations of the script command associated with command object 1020, and passes parameter values of the command object 1020 to the appropriate functions.
[0105] As a result of executing the test script, the scripting tool 200 generates test information such as comment information, SCSI CDB information, SCSI sense data, and error messages. The scripting tool 200 stores the test information in the log file 290 so that the user may later inspect the test information. Furthermore, the scripting tool 200 displays the test information in is the status window 240 so that the user may see the test information during execution of the test script. In a preferred embodiment, the scripting tool 200 automatically displays the status window 240 during execution of the test script, and updates the highlight bar 214 such that the highlight bar 214 highlights the script command currently being executed by the scripting tool 200.
[0106] After execution of the test script the user may desire to add addition script commands to the test script or edit existing script commands of the test script. (steps 1214 and 1216). Moreover, the user may desire to save the test script to a file so that the test script may be executed at later time. In particular, the scripting tool 200 in step 1218 generates a binary file that represents the information stored in the test object. More specifically, the scripting tool 200 generates the binary file such that the scripting tool 200 may later read the binary file and regenerate the test object from the contents of the binary file.
[0107] While the invention has been illustrated and described in detail in the drawings and foregoing description, such illustration and description is to be considered as exemplary and not restrictive in character, it being understood that only the preferred embodiment has been shown and described and that all changes and modifications that come within the spirit of the invention are desired to be protected. For example, while reference as been made the to Windows NT operating system, the scripting tool 200 may be implemented under other operating systems. Moreover, while the scripting 200 has been described in conjunction with testing SCSI devices, features of the present invention may be utilized in other scripting tools and in other testing environments
Appendix A
[0108] The following is a description of each command supported by a prototype of the present invention. Certain parameters of the following commands are listed as “Currently not implemented.” While these parameters have yet to be implemented in the prototype of the present invention, implementation of these parameters are not necessary in order to effectively practice features of the present invention. Moreover, one skilled in the art in light of the following descriptions would be able to implement these parameters without undue experimentation.
[0109] Following each command is a list showing the parameter names, range of values, and description. If a field is set to ‘*’ as a value then the default will be used. For the ENVIRONMENT command the default values are set in the configuration. Most commands include a comment field which will allow up to 30 ASCII characters.
A.1 Comment Commands
[0110] This command is used to document test files and does not print into the test log.
[0111] Comment
[0112] The first field allows up to seven ASCII characters which will print after the command name in the test file window. Ten additional lines of up to 70 ASCII characters each follow.
A.2 System Commands
[0113] Environment
[0114] Initialize/change SCSI environment (all fields default to those set in the system configuration)
[0115] Reset
[0116] Reset the system's SCSI bus. Note: This command will only work on a Windows NT™ host with the Symbios Logic 8751 host adapter and the special device driver developed specifically for use with the STARCOM application.
A.3 Error Handling
[0117] Recovery
[0118] Specifies the action to be taken when an unexpected error occurs.
A.4 SCSI Commands
[0119] The following commands are used to create and execute various SCSI Command Descriptor Blocks (CDB).
[0120] FORMAT_UNIT
[0121] The FORMAT UNIT command (op-code=0×04) formats the medium into initiator addressable logical blocks per the initiator defined options. In addition, the medium may be certified and control structures may be created for the management of the medium and defects.
[0122] INQUIRY
[0123] The INQUIRY command (op-code=0×12) requests that information regarding parameters of the target and its attached peripheral devices be sent to the initiator.
[0124] MODE_SELECT
[0125] The MODE SELECT command (op-code=0×15) provides a means for the initiator to specify medium, logical unit, or peripheral device parameters to the target.
[0126] MODE_SELECT_EXT
[0127] The MODE_SELECT_EXT command (op-code=0×55) provides a means for the initiator to specify medium, logical unit, or peripheral device parameters to the target.
[0128] MODE_SENSE
[0129] The MODE SENSE command (op-code=0×1A) provides a means for a target to report parameters to the initiator.
[0130] MODE_SENSE_EXT
[0131] The MODE_SENSE_EXT command (op-code=0×5A) provides a means for a target to report parameters to the initiator.
[0132] PASS_THROUGH
[0133] This command issues the Set Pass Through Mode (op-code=0×14). It will cause the next SCSI command to be passed directly to a disk attached to an array controller. The channel and device will default to the command line values unless they are set. If the target is a drive instead of an array then this command will be skipped instead of issued.
[0134] READ
[0135] The READ command (op-code=0×08) requests that the target transfer data to the initiator. The most recent data value written in the addressed logical block shall be returned.
[0136] READ_CAPACITY
[0137] The READ CAPACITY command (op-code=0×25) provides a means for the initiator to request information regarding the capacity of the logical unit.
[0138] READ_EXT
[0139] The READ_EXT command (op-code=0×28) requests that the target transfer data to the initiator. The most recent data value written in the addressed logical block shall be returned. Larger logical block addresses and transfer lengths are allowed than the READ command.
[0140] READ_LONG
[0141] The READ_LONG command (op-code=0×3E) requests that the target transfer data to the initiator. The data passed during the READ_LONG command is implementation specific, but shall include data bytes and the ECC bytes recorded on the medium. The most recent data written in the addressed logical block shall be returned. This command and the WRITE_LONG are provided to check the ECC capability of the device. Currently, this command is not supported by the Series 3 firmware on our disk array controllers. If you would like to issue this command to a SCSI-2 drive then use it in conjunction with the PASS_THROUGH command.
[0142] REQUEST_SENSE
[0143] The REQUEST SENSE command (op-code=0×03) requests that the target transfer sense data to the initiator.
[0144] SEND_CDB
[0145] General purpose command to create and execute any SCSI CDB.
[0146] TEST_UNIT_READY
[0147] The TEST UNIT READY command (op-code=0×00) provides a means to check if the logical unit is ready.
[0148] VERIFY
[0149] The VERIFY command (op-code=0×2F) requests that the target verify the data written on the medium.
[0150] WRITE
[0151] The WRITE command (op-code=0×0A) requests that the target write the data transferred by the initiator to the medium.
[0152] WRITE_EXT
[0153] The WRITE_EXT command (op-code=0×2A) requests that the target write the data transferred by the initiator to the medium. Larger logical block addresses and transfer lengths are allowed than the WRITE command (6-byte).
[0154] WRITE_LONG
[0155] The WRITE_LONG command (opcode=0×3F) requests that the target write the data transferred by the initiator to the medium. The data passed during the WRITE_LONG command is implementation specific, but shall include the data bytes and the ECC bytes. Currently, this command is not supported by the Series 3 firmware on our disk array controllers. If you would like to issue this command to a SCSI-2 drive then use it in conjunction with the PASS_THROUGH command.
[0156] WRITE_VERIFY
[0157] The WRITE AND VERIFY command (op-code=0×2E)requests that the target write the data transferred from the initiator to the medium and then verify that the data is correctly written. The data is only transferred once from the initiator to the target.
A.5 Fill I/O Data Buffer
[0158] The following commands will fill the I/O data buffer with the specified data. All commands use the same I/O data buffer.
[0159] FILL_PATTERN
[0160] Fill buffer with a specified pattern.
[0161] FILL_RANDOM
[0162] Fill data buffer with a random pattern.
[0163] FILL_SEQUENTIAL
[0164] Fill buffer with a sequential pattern.
4.2.6 File I/O
[0165] Read or write a file. The file size is determined from the operating system for READ_FILE, however, it will be truncated if it is larger than the I/O data buffer.
[0166] FILE_READ
[0167] Read a file into the I/O data buffer.
[0168] FILE_WRITE
[0169] Write data from the I/O data buffer to a file.
A.7 Sdac Micro-Code and Drive Firmware Download
[0170] Micro-code may be downloaded to a disk array using this command. It is implemented internally using the WRITE BUFFER command.
[0171] DRIVE_FIRMWARE
[0172] This command can be used to download drive firmware.
[0173] MICRO_DOWNLOAD
[0174] This command can be used to download application code, bootware, and NVSRAM files over the SCSI bus to the disk array by using the Write Buffer command (op-code=0×3B). Note: Using the SCSI bus to download these files is much quicker than using the serial communications bus.
A.8 Time Delay
[0175] DELAY
[0176] Delay executes a wait period during which STARCOM is dormant. This command may be aborted while it is executing by pressing the <Esc> key. Currently, the <Esc> key will only work when the test is running in automated mode (am). If the DELAY command was executed using the Execute and Step method (<S> key) or the single Execute method (<X> key) then you cannot use the <Esc> key to abort the command.
A.9 ECHO
[0177] ECHO
[0178] ECHO will display/log a user defined message.
A.10 TEST CONTROL
[0179] BRANCH
[0180] Test execution of commands will jump to a specified LABEL command if this tests true. Comparison test is executed on bytes in the I/O data buffer. This command is very similar to the JUMP_BUF command.
[0181] CALL
[0182] Open another instance of the STARCOM application and run the commands specified in the indicated test file. The calling instance will not execute the next command in its test file until the called instance has completed execution and the STARCOM application has exited. Also, see the SPAWN command.
[0183] HALT
[0184] Stop execution of commands.
[0185] JUMP
[0186] Test execution of commands will jump to the specified LABEL command.
[0187] JUMP_BUF
[0188] Test execution of commands will jump to a specified LABEL command if this tests true. Comparison test is executed on bytes in the I/O data buffer.
[0189] JUMP_NUM
[0190] Test execution of commands will jump to a specified LABEL for a specified number of iterations.
[0191] JUMP_STS
[0192] Test execution of commands will jump to a specified LABEL based on the last SCSI status.
[0193] JUMP_VAR
[0194] Test execution of commands will jump to a specified LABEL command if this tests true. Comparison test is executed on one of the 16 variables ($0-$1) available.
[0195] LABEL
[0196] Used as destination for BRANCH command and all of the JUMP commands.
[0197] MESSAGE_BOX
[0198] Halt the execution of the test file and display a pop-up message box on the screen. The message box will display the message specified and will have a single OK button. The execution of the test file will restart after the OK button has been clicked. This command is useful for running manual tests and prompting the test operator to perform a task.
[0199] SPAWN
[0200] Open another instance of the STARCOM application and run the commands specified in the indicated test file. This command is similar to the CALL command. The difference is that the calling instance of STARCOM will not wait for the spawned instance of STARCOM to complete before the calling instance continues executing the next command in its test file. Also, see the CALL command.
[0201] System
[0202] Perform DOS prompt commands. Currently, the only DOS commands supported are copy, del, and rename.
[0203] TESTING_OFF
[0204] Skip the commands following this command until the TESTING_ON is encountered in the test file.
[0205] TESTING_ON
[0206] Resume command execution if a previous TESTING_OFF command was encountered, otherwise, do nothing.
A.11 LOG CONTROL COMMANDS
[0207] CONFIG_LOG_IT
[0208] This command will insert the current system configuration parameters into the log. The values that will be put into the log are: Port ID, Host ID, Target ID, LUN, Width, Period, Offset, Transfer Mode, Messages, Disconnect, Block Size, and Time-out.
[0209] LOG_DEFAULTS
[0210] This command will set the following fields to default values. In subsequent LOG_SET commands any field where a ‘*’ character appears the default value will be used for logging test PASS and FAIL lines.
[0211] LOG_SET
[0212] This command will set the following fields to be used in logging any subsequent test PASS and FAIL lines.
[0213] TIME_STAMP
[0214] Log/display the current date and time. The log entry will look like the following:
[0215] DATE: Oct. 2, 1997 (MM/DD/YYYY) TIME: 13:06:16 (hr:min:sec)
A.12 Operation
[0216] OP_BINARY
[0217] This command will allow various operations to be performed between variables, buffers, and constants.
A.13 Automated I/O Commands
[0218] DISK_RAND_WR_VER
[0219] This command will perform WRITE_EXT and READ_EXT commands and the verification is performed by comparing the data read with the data that was written. These I/Os will occur at random logical block addresses and the seed for the random number generator is based off of the internal clock. In other words, one cycle of this command will write data to a random logical block address, read the same amount of data from the same logical block address, and then compare the two sets of data.
[0220] DISK_WRITE_VERIFY
[0221] This command is exactly the same as the DISK_RAND_WR_VER command except for the fact that it will perform the I/Os sequentially rather than randomly. Also, it has an additional field called increment_per_io as well as different criteria for the io_cnt field. For more details on the description of this automated test then refer to the description for the DISK_RAND_WR_VER command.
[0222] RAND_WRITE_VERIFY
[0223] This command will perform WRITE_VERIFY commands (op-code=0×2E). These I/Os will occur at random logical block addresses and the seed for the random number generator is based off of the internal clock.
[0224] SDAC_SEQ_VERIFY
[0225] This command will perform VERIFY commands (op-code=0×2F). These verifications will be issued to the specified logical block addresses in sequential order. Also, the ParChk bit in offset byte 1 of the CDB is set to 1 and the BytChk bit is set to 0.
[0226] SEQ_WRITE_VERIFY
[0227] This command will perform WRITE_VERIFY commands (op-code=0×2E). These I/Os will be issued to the specified logical block addresses in sequential order.
Appendix B
[0228] The Microsoft Win32 API provides a DeviceloControl function for sending control codes directly to a specified device driver thereby causing the corresponding device to perform the specified operation. The following provides a brief description of the DeviceloControl function and associated parameters.
[0229] BOOL DeviceIoControl(
[0230] HANDLE hDevice, //handle to device of interest
[0231] DWORD dwIoControlCode, //control code of operation to perform
[0232] LPVOID lpInBuffer, //pointer to buffer to supply input data
[0233] DWORD nInBufferSize, //size of input buffer
[0234] LPVOID lpOutBuffer, //pointer to buffer to receive output data
[0235] DWORD nOutBufferSize, //size of output buffer
[0236] LPDWORD lpBytesReturned, // pointer to variable to receive output byte count
[0237] LPOVERLAPPED lpOverlapped //pointer to overlapped structure for asynchronous
[0238] Parameters
[0239] hDevice
[0240] Handle to the device that is to perform the operation.
[0241] Call the CreateFile function to obtain a device handle.
[0242] dwloControlCode
[0243] Specifies the control code for the operation.
[0244] This value identifies the specific operation to be performed and the type of device on which the operation is to be performed. The following values are defined:
[0245] IpInBuffer
[0246] Pointer to a buffer that contains the data required to perform the operation.
[0247] This parameter can be NULL if the dwloControlCode parameter specifies an operation that does not require input data.
[0248] nInBufferSize
[0249] Specifies the size, in bytes, of the buffer pointed to by LpInBuffer.
[0250] IpOutBuffer
[0251] Pointer to a buffer that receives the operation's output data.
[0252] This parameter can be NULL if the dwloControlCode parameter specifies an operation that does not produce output data.
[0253] nOutBufferSize
[0254] Specifies the size, in bytes, of the buffer pointed to by IpOutBuffer.
[0255] IpBytesReturned
[0256] Pointer to a variable that receives the size, in bytes, of the data stored into the buffer pointed to by IpOutBuffer.
[0257] If IpOverlapped is NULL, IpBytesReturned cannot be NULL. Even when an operation produces no output data, and IpOutBuffer can be NULL, the DeviceloControl function makes use of the variable pointed to by IpBytesReturned. After such an operation, the value of the variable is without meaning.
[0258] IpOverlapped is not NULL, IpBytesReturned can be NULL. If this is an overlapped operation, you can get the number of bytes returned by calling GetOverlappedResult. If hDevice is associated with an I/O completion port, you can get the number of bytes returned by calling GetQueuedCompletionStatus.
[0259] IpOverlapped
[0260] Pointer to an OVERLAPPED structure.
[0261] If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, this parameter must point to a valid OVERLAPPED structure. In this case, DeviceloControl is performed as an overlapped (asynchronous) operation. If the device was opened with FILE_FLAG_OVERLAPPED and IpOverlapped is NULL, the function fails in unpredictable ways.
[0262] If hDevice was opened without specifying the FILE_FLAG_OVERLAPPED flag, this parameter is ignored and the DeviceloControl function does not return until the operation has been completed, or an error occurs.
[0263] Return Values
[0264] If the function succeeds, the return value is nonzero.
[0265] If the function fails, the return value is zero. To get extended error information, call GetLastError.
[0266] Remarks If hDevice was opened with FILE_FLAG_OVERLAPPED and the IpOverlapped parameter points to an OVERLAPPED structure, DeviceloControl is performed as an overlapped (asynchronous) operation. In this case, the OVERLAPPED structure must contain a handle to a manual-reset event object created by a call to the CreateEvent function. For more information on manual-reset event objects, see Synchronization.
[0267] If the overlapped operation cannot be completed immediately, the function returns FALSE, and GetLastError returns ERROR_IO_PENDING, indicating that the operation is executing in the background. When this happens, the operating system sets the event object in the OVERLAPPED structure to the nonsignaled state before DeviceloControl returns. The system then sets the event object to the signaled state when the operation has been completed. The calling thread can use any of the wait functions to wait for the event object to be signaled, and then use the GetOverlappedResult function to determine the results of the operation. The GetOverlappedResult function reports the success or failure of the operation and the number of bytes returned in the IpOutBuffer buffer.
Claims
What is claimed is:
1. A method of utilizing a definition file to define characteristics of at least one parameter of a script command comprising:
displaying for a parameter within a script command, a user input control defined by a definition file, said user input control displaying an identifier for said parameter and a value for said parameter;
receiving user input via said user input control;
generating a parameter value based upon said received user input; and
setting said value of said parameter of said script command equal to said generated parameter value.
2. The method of claim 1, further comprising:
generating said user input control based upon a control type defined by said definition file,
wherein said definition file defines said control type from a group of control types comprising a radio-button control type, a check-box control type, an edit box control type, a list box control type, and a combo box control type.
3. The method of claim 1, further comprising:
determining whether said generated parameter value is valid for said parameter based upon an allowable range defined by said definition file,
wherein said setting of said generated parameter value comprises setting said value of said parameter equal to said generated parameter value only if said generated parameter value is determined valid.
4. The method of claim 1, wherein:
said displaying of a user input control comprises displaying user input controls corresponding to a plurality of parameter values defined for said script command by said definition file,
said user input reception comprises receiving said user input indicating a selection from said plurality of parameter values, and
said parameter generation comprises setting said parameter value equal to said selection indicated by said user input.
5. The method of claim 1, further comprising:
determining whether said definition file has changed since said displaying step;
re-generating said control based upon said changed definition file in response to determining that said definition file has changed; and
re-displaying said control after said re-generating of said control.
6. The method of claim 1, wherein said parameter value generation comprises:
setting said parameter value equal to a default value defined by said definition file in response to said user input not indicating a value for said parameter value.
7. The method of claim 1, further comprising:
parsing said definition file to obtain a first preprocessed definition file; and
generating said user input control based upon said first preprocessed definition file.
8. The method of claim 7, further comprising:
determining whether said definition file has changed since said parsing step;
re-parsing said definition file to obtain a second preprocessed definition file in response to said determination that said definition file has changed;
re-generating said user input control based upon said second preprocessed definition file; and
re-displaying said user input control after said regeneration of said user input control.
9. A scripting tool for executing a script command having at least one parameter, comprising a display device, a processor, and a memory having stored therein a plurality of instructions which when executed by said processor causes said processor to:
generate a user input control for a parameter within a script command based upon a definition file, said user input control including an identifier and a value for said parameter;
display said user input control upon said display device;
receive user input via said user input control;
generate a parameter value based upon said user input;
set said parameter of said script command equal to said generated parameter value; and
execute said script command having said parameter set to said generated parameter value.
10. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
generate said user input control based upon a control type defined by said definition file,
wherein said definition file defines said control type from a group of control types comprising a radio-button control type, a check-box control type, an edit box control type, a list box control type, and a combo box control type.
11. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
determine whether said parameter value is valid for said parameter based upon an allowable range defined by said definition file; and
set said parameter equal to said parameter value only if said parameter value is valid.
12. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
generate a plurality of valid parameter values for said user input control based upon said definition file;
display upon said display device, said user input control including said plurality of valid parameter values;
receive said user input indicating a selection from said plurality of valid parameter values; and
set said parameter value equal to said selection indicated by said user input.
13. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
determine whether said definition file has changed since displaying said user input control upon said display device;
re-generate said user input control based upon said changed definition file in response to determining that said definition file has changed; and
re-displaying said user input control after regenerating said user input control.
14. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
set said parameter value equal to a default value defined by said definition file in response to said user input not indicating a value for said parameter value.
15. The scripting tool of claim 9, wherein said plurality of instructions when executed by said processor further causes said processor to:
parse said definition file to obtain a first preprocessed definition file; and
generate said user input control based upon said first preprocessed definition file.
16. The scripting tool of claim 15, wherein said plurality of instructions when executed by said processor further cause said processor to:
determine whether said definition file has changed since said first preprocessed definition file was obtained;
re-parse said definition file to obtain a second preprocessed definition file in response to determining that said definition file has changed since said first preprocessed definition file was obtained;
re-generate said user input control based upon said second preprocessed definition file; and
re-display said user input control upon said display device after said re-generating said control.
17. A method executing a script command having at least one parameter, comprising:
generating a user input control for a parameter of a script command based upon a definition file, said user input control having an identifier and a value for said parameter;
receiving user input for said parameter via said user input control;
generating a parameter value based upon said received user input;
setting said parameter equal to said generated parameter value; and
executing said script command having said parameter set to generated parameter value.
18. The method of claim 17, further comprising:
determining whether said parameter value is invalid based upon said definition file; and
setting said parameter to a default value defined by said definition file if said parameter value is determined invalid.
19. The method of claim 17, further comprising:
determining whether said definition file has changed since said user input control generation; and
in response to said determination that said definition file has changed since said user input control generation,
(a) re-generating said user input control based upon said changed definition file;
(b) determining whether said parameter value is invalid based upon said changed definition file; and
(c) setting said parameter to a default value defined by said changed definition file.
20. The method of claim 17, further comprising parsing said definition file to obtain a preprocessed definition file, wherein:
said user input control generation comprises generating said user input control based upon said preprocessed definition file.
Patent Citations (23)
| Patent | Date | Inventor | Cited By |
|---|---|---|---|
| US5179703 | 1993-01-01 | Evans | Applicant |
| US5220675 | 1993-06-01 | Padawer et al. | Applicant |
| US5335320 | 1994-08-01 | Iwata et al. | Applicant |
| US5345550 | 1994-09-01 | Bloomfield | Applicant |
| US5367633 | 1994-11-01 | Matheny et al. | Examiner |
| US5398312 | 1995-03-01 | Hoffmann | Applicant |
| US5475843 | 1995-12-01 | Halviatti et al. | Applicant |
| US5490249 | 1996-02-01 | Miller | Applicant |
| US5546522 | 1996-08-01 | Nishida et al. | Applicant |
| US5546581 | 1996-08-01 | McKinnis et al. | Applicant |
| US5581685 | 1996-12-01 | Sakurai | Applicant |
| US5617527 | 1997-04-01 | Kressin et al. | Applicant |
| US5664185 | 1997-09-01 | Landfield et al. | Applicant |
| US5669000 | 1997-09-01 | Jessen et al. | Applicant |
| US5689665 | 1997-11-01 | Mitsui et al. | Applicant |
| US5712993 | 1998-01-01 | Ichikawa | Applicant |
| US5905896 | 1999-05-01 | Delannoy | Applicant |
| US5954829 | 1999-09-01 | McLain, Jr. et al. | Examiner |
| US6002868 | 1999-12-01 | Jenkins et al. | Applicant |
| US6002871 | 1999-12-01 | Duggan et al. | Applicant |
| US6094684 | 2000-07-01 | Pallmann | Examiner |
| US6147773 | 2000-11-01 | Taylor et al. | Examiner |
| US6216120 | 2001-04-01 | Ueno et al. | Examiner |