Vantage Knowledge Base

VantageManager Telnet script commands

Script version 1.1, 2019-04-20

Script consist of a number of lines which will be executed in seqeuence.
Any empty line or line that starts with a semicolon ";" will be ignored

 may be
- A constant string enclosed in single ' or double ". Special characters may be inserted, such as \n \t etc. Example "show ver"
- A variable identifier of a variable previously assigned (see the set command below)
- Two  seperated by the + operator. Example "abcd" + "def"
- The result of a command/function as defined below. Example "The result is:" + recuntil " >"
- A variable identifier of a variable previously assigned (see the set command below)

 may be
- A constant integer number. Example 1, 5.
- A variable identifier of a variable previously assigned (see the set command below)
- Two  seperated by the + operator. Example 3+7
- booelan expression with the operators "not", "and", "or". Examples with result in []: not 2 [0], 3 and 4 [1]
- parenthesis may be used. Example: (3 and 0) or 11  [1]
- the result of comparing two ints or strings with the == or != operator. Examples "aa"==recuntil " >",  2!=5
- The result of a command/function as defined below. Example match "def", "abcdef" [1]


Commands/functions:  

send 
Send a string to the DUT via telnet
Returns the same string as sent.

sendln 
Send a string followed by CRLF to the DUT via telnet
Returns the same string as sent.

recuntil 
Receive data from the DUT until it contains the string specified
Return the received data up to but not including the string.

recln
Receive data from the DUT until next CRLF
Return the received data up to but not including the CRLF.

wait 
Wait the specified number of seconds
Returns 1

failif 
Will abort script execution (and also test execution) with an error message if  is not 0.
Returns 0 if the script is not aborted. Does not return if it is aborted.

log 
Prints the specified expression to the test log on the UI (which is also included in the test report)
Returns the same string.

match  , 
Matches two expessions. Returns 1 if  is contained in  and 0 otherwise.
 may be a regular expression with usual wildcards, regex syntax etc.

set  = 
Assign the value to the variable specified which may be used in other expressions.
Returns the value of the expression.


Examples of scripts:


; script that will login to DUT
log "Login to DUT..."
log recuntil "login: "
sendln "admin"
recuntil "Password: "
sendln "12345"
recuntil " >"
log "Login successfull..."

; check if version of DUT is 5.2 as obtained by the system resource print command
sendln "system resource print"
log recuntil " >"
log recuntil " >"
set reply= recuntil " >"
log reply
failif not match "version: 5.2", reply
log "Version of DUT is correct ..."

Discover Xena : Global Customer Event on April 22

00
Months
00
Days
00
Hours
00
Minutes
00
Seconds