Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Mobile AAA Server A.01.00 Administrator's Guide: HP-UX 11.00 and 11i version 1 > Chapter 4 Server Administration Commands

Writing diamTestClient Scripts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

A diamTestClient script can be created, edited, and saved in a text editor. diamTestClient processes a script file one line at a time. Blank lines are ignored, and lines with a pound (#) or asterisk (*) character in column one are treated as comment lines. Comment lines preceded with a pound character are echoed in the log file; comment lines preceded with an asterisk character are completely ignored. Other lines contain script file commands.

The command follows the syntax:

message Message-name

or

message Command-code Vendor-ID Command-flags

message

begins the process of creating a Diameter message. The message command is followed by a number of avp commands that specify the A-V pairs to be included in the message. The send command is then used to send the message with the specified A-V pairs to the Mobile AAA Server. The Diameter messages and A-V pairs mentioned in this section are described in draft-ietf-aaa-diameter-08.txt and draft-ietf-aaa-diameter-mobileip-08.txt.

The following Message-name values are recognized:

Table 4-4 Title not available (Writing diamTestClient Scripts )

Message Value

Description

ping

ping message

amr

AA-Mobile-Node-Request

ama

AA-Mobile-Node-Answer

har

Home-Agent-MIP-Request

haa

Home-Agent-MIP-Answer

acr

Accounting Request

aca

Accounting Answer

asr

Abort-Session-Request

asa

Abort-Session-Answer

rar

Re-Auth-Request

raa

Re-Auth-Answer

str

Session-Termination-Request

sta

Session-Termination-Answer

cer

Capabilities-Exchange-Request

dpr

Disconnect-Peer-Request

 

Command-code, Vendor-ID, and Command-flags are fields contained in the Diameter message header.

avp

specifies an A-V pair to be included in a Diameter message that is currently being constructed.

The command follows the syntax:

avp avp-name avp-value

or

avp raw code=w,flags=x,type=y,vendorId=z,value=nnnn

You can specify a grouped A-V pair with the following syntax:

avp avp-name {
avp command for first A-V pair in group
avp command for second A-V pair in group
...
avp command for last A-V pair in group
}

avp-name is an attribute name that must be found in the DTC dictionary. If avp-value is a string that contains spaces it must be surrounded by double quotes (i.e. “sample string”).

w is the A-V pair Code for the A-V pair header

x is the value for the A-V pair header flags

y is the A-V pair type. Supported types for this syntax are “integer” and “string”

z is the vendor ID for the A-V pair

nnnn is the A-V pair value. If the value is a string it should not be surrounded by double quotes.

An example of the script commands that define a grouped A-V pair: avp MIP-HA-to-FA-Key {
avp   MIP-Algorithm-Type  MD5-Prefix-plus-Suffix-Mode
avp   MIP-Session-Key      "?..j..am.8......"
}

end-to-end identifier


specifies the value of the End-to-End Identifier to be sent in the message. If nonzero, this overrides the value internally assigned by the API. This is useful for testing the handling of duplicate messages.

The command follows the syntax:

end-to-end-identifier Value

Value is the 32-bit end-to-end Identifier.

expected-result

is used when the script sends a message to the server that will be answered to. With this command you specify what result you expect to receive in the answer. The result code that you specify will be compared to the result in the answer message. When the script ends, the test client will display a statistics message that indicates how many times a message's expected result did and did not match the actual result. The message will also indicate how many messages were not checked for an expected result.

The command follows the syntax:

expected-result Result-code

Result-code is the code you wish to compare.

send

sends a message to the Mobile AAA server. The message must have been previously constructed using the message and avp commands.

The command follows the syntax:

send

pause

pauses execution of script file commands for a number of seconds.

The command follows the syntax:

pause Seconds

Seconds is the number of seconds to pause before executing the next command in the script.

echo

writes text out to the command line console.

While a script is executing, it can be useful to echo messages to the command line that indicate what test is being run. The echo command is used for that purpose.

The command follows the syntax:

echo Text

Text is a message that is to be displayed on the command line console.

repeat

The repeat command causes the test client to go back to the beginning of the script file and to execute the script file again. No commands after the repeat command can ever execute.

The command follows the syntax:

repeat N-times

N-times is the number of times to repeat the script.

password

The password command specifies the password used to calculate the authenticator for AMR messages.

The command follows the syntax:

password User-password

user-password is a string. Spaces are not allowed.

Example Script

This sample script file, /home/aaa/pingscript.txt,will cause the diamTestClient to send a Diameter ping message to a Diameter server once every five seconds.

# Sample Script File
message ping
avp Session-ID "ping to server"
avp Origin-Realm test1.com
avp Origin-Host "aaa://dtc.test1.com:1812;transport=tcp"
avp Destination-Realm test2.com
avp Destination-Host "aaa://aaaserver.test2.com:1812;transport=tcp"
send

Execute the following command:
$ diamTestClient -d /etc/opt/aaa/diameter/ -dl /var/opt/aaa/diameter/logs -mfqdn dtc.test1.com -mport -sfqdn aaaserver.test.com -f /home/aaa/pingscript.txt

The above script constructs a ping message consisting of five A-V pairs and then sends the message to the Mobile AAA Server. After pausing for five seconds, the script repeats.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2001-2004 Hewlett-Packard Development Company, L.P.