STAF is an open source automation framework that allows reusable components called services to be developed. It runs as a daemon process on each system part of the STAF environment. STAF works in a peer-to-peer manner without a client-server hierarchy. It can act as middleware between a testing framework and the system under test, making application development and test environment management easier. STAF supports various programming languages and tools and is used widely at IBM and other companies for automation purposes.
2. Basics of STAF
STAF is an Open Source automation framework
designed around the idea of reusable components,
called services
STAF runs as a daemon process, called STAFProc, on
each system
The collection of machines on which you have
installed STAF is referred to as the STAF Environment
STAF is configured through a text file called the
STAF Configuration File - STAF.cfg.
3. STAF works in a peer-to-peer environment; in other
words, there is no client-server hierarchy among
machines running STAF agents
4. STAF as Middleware
STAF can act as a middleware for a testing framework with the
framework on one side and the system under test on the other.
By leveraging the flexibility of STAF, developers are able to develop
applications much more quickly and easily, and these applications
integrate together more cohesively
STAF provides an infrastructure that makes it easier to manage tests
and test environments
FRAMEWORK STAF
SYSTEM
UNDER TEST
5. STAF as “glue”
As STAF provides common services across multiple languages, It is very
simple to coordinate multiple different tools from a single point of
control
STAF supports the following languages
Java, C/C++
Perl, Python, Tcl, Rexx, Shell-script
Ant
Command line
10. STAF Security
Security in STAF can be defined at the machine level
and/or user level
Each service in STAF defines a trust level which is required
in order to use the various functions the service provides
trust level 0 indicates no access and trust level 5 indicates
full access.
Syntax:
TRUST LEVEL <Level> MACHINE <Machine>
TRUST LEVEL <Level> USER <User>
TRUST LEVEL <Level> DEFAULT
11. STAF is an executable that is used to submit requests to STAF from the command
line
STAF [-verbose] <Endpoint> <Service> <Request>
Output on success :
Response
--------
[Result string]
On an unsuccessful STAF request (i.e., a request with a non-zero return code), the
output from the STAF command will be as follows
Error submitting request, RC: <Return code>
[Additional info: <Result string>]
Interacting with STAF (Command line)
12. You can leverage STAF in your Code by making calls into STAF services
For all of the supported STAF languages, you can do the following
Register with STAF
Submit any number of calls into STAF services
Unregister with STAF
Running a STAF enabled Code
13. List of STAF services
HELP
Provides Help on STAF error codes (internal)
PING
Provides a simple is-alive message (internal)
SERVICE
Allows you to list services available on a machine and to examine the requests that have
been submitted on a machine (internal)
SHUTDOWN
Provides a means to shutdown STAF and register for shutdown notifications (internal)
ECHO
Echos back a supplied message (internal)
MISC
Handles miscellaneous commands and tracing (internal)
DELAY
Provides a means to sleep a specified amount of time (internal)
DIAG
Allows you to record and list diagnostics data (internal)
14. FS (File System)
Allows you to get and copy files (text and binary) across the network, list directories, copy
directories/subdirectories, and delete files (internal)
FSEXT (File System Extensions)
Provides some tools to perform extended file system requests (external)
ZIP
Provides a means to zip/unzip PKZip/WinZip compatible archives (external)
HTTP
Provides the ability to quickly and easily make HTTP requests (external)
LOG
Provides a full-featured logging facility (external)
MONITOR
Allows a testcase to publish its current running execution status for others to read (external)
LIFECYCLE
Allows STAF service requests to be run when STAFProc starts up or shuts down (internal)
SXE
Allows the user to sequentially execute any number of STAF commands (external)
List of STAF services (cont’d)
15. FTP
Provides client side FTP (File Transfer Protocol) functions like downloading or uploading a
file in binary mode from a remote FTP server (external)
HANDLE
Provides information about existing STAF handles (internal)
QUEUE
Provides a network-enabled IPC mechanism for STAF programs (internal)
PROCESS
Allows you to start, stop, and query processes (internal)
SEM (Semaphore)
Provides network-enabled named event and mutex semaphores (internal)
VAR (Variable)
Provides a method for maintaining configuration and runtime data/variables (internal)
List of STAF services (cont’d)
16. TRUST
Interfaces with STAF's security (internal)
STAX
Provides an XML-based execution engine. STAX also provides a powerful GUI monitoring
application which allows you to interact with and monitor the progress of your jobs
(external)
EVENT
Provides a publish/subscribe notification system (external)
EVENTMANAGER
Allows you to run a STAF command when a specified Event occurs (external)
CRON
Allows you to run a STAF command at a specified time interval (minute, hour, day, month,
weekday) (external)
TIMER
Allows a process on one machine to periodically receive a notification message from the
same or another machine (external)
List of STAF services (cont’d)
17. NAMESPACE
Provides a namespace hierarchy for storing and retrieving a persistent repository of
variables (external)
RESPOOL (Resource Pool)
Allows you to manage exclusive access to pools of elements, e.g. VM UserIDs or Software
Licenses (external)
EMAIL
Allows information, such as test results, to be emailed to a list of addresses (external)
List of STAF services (cont’d)
Editor's Notes
This slide has been taken directly from the STAF site as is.
This slide has been taken directly from the STAF site as is.
[-verbose] force the use of the verbose mode for the output.<Endpoint> “LOCAL”, for a request of the local machine, or the name of the remote machine<Service> name of the service to which you are submitting a request<Request> actual request string that you wish to submit to the service<Result string> information returned from the STAF service request<Return code> actual return code from the request, and <Result string> information returned from the request
STAF supports the following languages:Java, C/C++Perl, Python, Tcl, Rexx, Shell-scriptAntCommand line