Next: Conditional Statements, Previous: Function Definitions, Up: radtest [Contents][Index]
Radtest provides two commands for interaction with remote
RADIUS servers.
Command send sends request to the server specified in
raddb/client.conf. Its syntax is:
send [flags] port-type code [expr-or-pair-list]
Optional flags can be used for fine-tuning the internals of
send. You will seldom need to use these, unless you are
developing GNU Radius. See send, for the detailed description of these.
The first obligatory argument, port-type, specifies which RADIUS port to send the request to. Specifying ‘auth’ will send the request to the authentication port (see auth-port); specifying ‘acct’ will send it to the accounting port (see acct-port).
Argument code gives the request code. It is either a number or a symbolic request code name (see Numeric Values).
The last argument, expr-or-pair-list is either a
radtest expression evaluating to avlist or a list
of A/V pairs. These pairs will be included in the request.
Here are several examples:
# Send aStatus-Serverrequest without attributes. send auth Status-Server # Send anAccess-Requestwith two attributes send auth Access-Request User-Name = "foo" User-Password = "bar" # Send an Accounting-Request, taking attributes from the variable # attr send acct Accounting-Request $attr
Command send stores the reply code into the variable
REPLY_CODE and reply pairs into the variable REPLY
(see Built-in Variables).
Another primitive is expect. Expect takes at most two
arguments: a request code (either numeric or symbolic, (see Numeric Values)) and optional
list of A/V pairs (similar to send expr-or-pair-list
argument). Expect check if these match current
REPLY_CODE and REPLY values and if so, prints
the string ‘PASS’. Otherwise, it prints ‘FAIL’. This
command is designed primarily for use in GNU Radius testsuite.
Expect is usually used right after send, as shown
in the example below:
send auth Access-Request User-Name = "foo" User-Password = "bar" expect Access-Accept Reply-Message = "Access allowed"
Next: Conditional Statements, Previous: Function Definitions, Up: radtest [Contents][Index]