4-Oct-06
Rev 1.6.1
Connection Test Overview ConnTest is a general Verix/Verix V modem test that can be used to check dialing and connecting to visa and sdlc hosts. Typically, this program is used for SQA OS testing with inhouse NACs. But it can also be used to for modem/concentrator testing, testing connection rates to test hosts and to compare performance of different modem initialization strings. In general, ConnTest dials one or more hosts, does a "transaction" and hangs up. This sequence is repeated until a key is pressed on the test input device. The test can be configured for up to 10 hosts (any combination of sdlc, async, baud rate, etc.). On completion, ConnTest provides summary information for the test run for each host. ConnTest is highly configurable. See the Running Connection Test section for more details.
Directory Structure ..\conntest Main directory for the test source code. Includes vc++ project and connection test specific source code. The vc++ project is set up as a makefile project. To build for M68K verix, use the conntest.smk NMAKE file. To build for Verix V, use the conntest.amk NMAKE file. ..\sdsoutput Executable files and download bat files for M68K Verix. ..\armoutput Executable files and download bat files for Verix V terminals. ..\testsupport Top level directory for the test support library used by ConnTest. Sub-directories include a source directory, include directory (header files for the library), and library (actual library file for linking). Under the library directory, there are 2 output directories – SDS contains the library built for M68K Verix and ARM contains the library for Verix V. In the source directory, the most interesting file for ConnTest is vmodem.c which does the actual modem i/o. To build the library for M68K, use the testsupport.smk NMAKE file. For Verix V, use the testsupport.amk NMAKE file.
Running Connection Test To run ConnTest, go to the appropriate directory for the target platform: connectiontest\sdsoutput for M68K Verix or connectiontest\armoutput for Verix V. Sample bat and dld files are available for downloading (but you should check each file to make sure it does exactly what you want). Note that minimally, the phone numbers provided in the sample files must be changed.
Configuration Variables The Connection Test is highly configurable based on various config.sys variables:
1
Rev 1.5.4
10/1/2004
*ARG="inp outp log stat" *ARG describes the test environment as follows: inp - input device. The input device specifies the keyboard to use to read keypresses. Typically, a single key press is only used to end the test. If using the pause config.sys variable, a keypress is required after each transaction. Valid values for inp are /dev/com1, /dev/com2 and /dev/console. If using /dev/com1 or /dev/com2, connect a pc running hyperterminal (or similar program) to the specified Verix port. On the pc, hyperterminal should be configured as follows: 19.2 baud, a8n1, do not send outgoing lines with line feeds. outp - output device. This is where the test details are logged. Value values are /dev/com1, /dev/com2, /dev/console, /dev/console/page, and /dev/com4. /dev/com4 is the terminal printer. If using /dev/com1 or /dev/com2, connect a pc running Hyperterminal (or similar program) to the specified port. On pc, Hyperterminal should be configured as follows: 19.2 baud, a8n1, append linefeeds to incoming lines. For the console, /dev/console will automatically scroll output. Alternatively, /dev/console/page will require a keypress each time the display is full (after key is pressed, display is cleared). log - log detail level. A value of 1 just logs status and error messages. Log level 3 will provide details about interactions during a transaction (modem commands/responses, received/sent status messages). Log level 5 provides all level 3 details and also logs the host response packets. For any log level greater than 1, a comm port is the best output device. stat - provide performance information flag. If stat is set to 1 or greater, information will be logged on the connection and transaction times. pause=val If the config.sys variable pause is set to any value, ConnTest will pause after each transaction and wait for a key press on the test input device. Default behavior is to not pause. waitTime=secs If pause is not defined, the config.sys variable waitTime can be used to specify the number of seconds to wait between transactions. If waitTime and pause are not defined, the wait time between transactions is 5 seconds. maxDial=val If maxDial is set to a non-zero number, ConnTest will dial each host the specified number of times and then end (show summary message and exit). In this case, a key press will still stop the test after the current call. If maxDial is not defined, 0, or a noninteger value, ConnTest will run until a key is pressed. #hosts=”hostname1 ... hostnameN" #hosts lists the host names for testing. Up to 10 host names can be listed. A host name should not be more than 19 characters long. Based on each host name, ConnTest looks for additional host information in config.sys as follows: hostnamephone - phone number (dial string) for the host hostnameinit - modem init string for the host. This should not be longer than the maximum length command for the modem type. Also, it must be consistent with the baud, bell, and sync configuration. This initialization string is sent before any initialization strings defined in hostnameinitn variables. hostnameinitn - additional modem initialization commands for a host. These will be sent to the modem in sequential order, starting with hostnameinit1 to hostnameinit9,
2
Rev 1.5.4
10/1/2004
until a variable is not defined for the current n. For example, the initialization for host TEST can be stored in variables TESTinit, TESTinit1, and TESTinit2. As there is no TestInit3 variable, TESTinit2 is assumed to complete the modem initialization. hostnamebell - bell cmd for the host (ex. B1). If no bell command is required, omit the variable. hostnamebaud - baud rate for the host. Use SVC.H Rts_ baud integer values (ex. 1200=2). If using a baud rate other than the expected connection rate, assure handshaking is turned on between the modem and the terminal. hostnamesdlc - sdlc flag for host. Valid values are: 0=async 1=sdlc secondary. Wait for dial to complete before switching Verix to SDLC. The connection result (ie. Connect 1200, No Carrier, etc), as reported by modem, will be provided. 2=sdlc secondary. After issuing dial, do not wait for dial to complete before switching Verix to SDLC. Any connection failures will be considered no carriers. hostnametran - transaction type. Current values are VISA, VISA2, SDLC. VISA and VISA2 are identical except for the packet transmitted. Future versions may go credit/debit, etc. hostnamePkt – optional. If specified, this is the name of a file containing the request packet to be used with the host. Complete binary packet must be provided. ConnTest will write the contents of the file, without modification, to the modem port. See the 2 Appendix sections for details on creating and editing packet files. As an example, if #hosts="AMEX Vital", the program will look for the following config.sys variables: AMEXPhone, AMEXInit, AMEXBell, AMEXBaud, AMEXSDLC, AMEXTran, AMEXPkt, VitalPhone, VitalInit, VitalBell, VitalBaud, VitalSDLC, VitalTran, VitalPkt.
Interpreting messages displayed by Connection test When ConnTest starts, it displays a prompt on the terminal display. Press any key on the terminal to start the test. (this prompt will be on the terminal regardless of test input device). Next, ConnTest displays a summary of the configuration for each host. For example: Host name VISA VISA Config Phone 3236 Init E0V0&D2&Q0F4&H0X4S25=5&Z0= Bell Cmd none Baud 2 ASync Using packet from file VisaCrd.pkt
host name VISA in host list config variable VISAPhone contents config variable VISAInit contents No config variable VISABell (no bell cmd) config variable VISABaud config variable VISASDLC Config variable VISAPkt specifies VisaCrd.pkt as the file with the request packet.
As each transaction is attempted, details are logged. Specific messages are dependent upon the test log detail level, test statistics flag, host type and test results. The following is an example and other possible messages are listed in the next sections.
3
Rev 1.5.4
10/1/2004
Transaction 4 - host VISA Mdm Open/SetOpnBlk OK
4th transaction is to the VISA host modem is opened and Verix set_opn_blk() ok. modem issued this command
Modem Do Cmd: ATE0V0&D2&Q0F4&H0X4S25=5&Z0= Modem Command Echo’d: ATE0V0&D2&Q0F4&H0X4S25=5&Z0= Mdm Resp: 0 Mdm Dialed: ATDT3236 Mdm Dial Connected Connect time 7804 ms Host connect 5 Visa - Rcvd ENQ Visa sent pkt : 46 Visa rcvd response Visa Pkt Rcvd: <02> APPROVED 85731<03><01>
Visa trans time - Wait ENQ 3702 TxRx 812 Total(with EOT) 4603 ms
Mdm hung up
Previous command was echo’d by the modem. modem response (hayes result code) to previous cmd. (0 is OK, 4 is Error) modem dialed with this dial command modem connected Connect time is the time from when the ATDT command was written until modem sent a connect response. modem connected hayes result code. VISA protocol received ENQ VISA protocol sent packet with length 46 VISA protocol received a response packet if the test log level is 5, the response packet is displayed. Printable ASCII characters are displayed directly (no formating). Non-printable characters are displayed as hex values in <> brackets. if test statistics flag is set, timing information is displayed. Wait ENQ is how long the test waited for an ENQ after knowing it was connected. The TxRx time starts when the ENQ was received and ends when the host response is received and ack'd. The total time is the Wait ENQ time plus the TxRx time plus any time waiting for an EOT (if wait for EOT times out, this is also part of the Total time). modem hung up
At the completion of the test, the host configuration summary is repeated with the test results for each host. For example: Host name VISA VISA Config Phone 3236 Init E0V0&D2&Q0F4&H0X4S25=5&Z0= Bell Cmd none Baud 2 ASync Initialize Modem Failures 1
host name VISA in host list config variable VISAPhone contents config variable VISAInit contents No config variable VISABell (no bell cmd) config variable VISABaud config variable VISASDLC 1 modem initialization failure (due to modem error or no modem response).
4
Rev 1.5.4 Modem Counts: Dial Attempts 8 Successful Dial 4 Avg Time for good dial: 9012 ms No Carrier 1 Busy, etc. 1 Dial Timeout 1 No Response To Cmd 1 (cmd delay 400)
HangUp Failure 1 Visa Counts: Total Attempts 4 Successful Trans 1 Avg time waiting for ENQ 3675 Avg time for Visa tx/rx 778 Avg total time (wait ENQ until EOT) 4542 No ENQ rcv 1 Pkts NAKd 1 Pkts no acknak 1 Resp stx/etx err 1 Pkts no resp 1 No EOT rcv 1
10/1/2004
VISA host attempted to dial 8 times 4 VISA dial attempts were successful Average time for a successful connect. 1 dial attempt resulted in a modem response code of 3 (no carrier). 1 VISA dial attempt failed due to busy, no line, no answer, or no dialtone. for 1 dial command, the modem did not provide any response in the timeout period (default 35 secs), and carrier was not detected. for one non-dial AT command, the modem did not provide any response. The cmd delay is the amount of time the app waits before issuing a modem command (to ensure consecutive modem commands are not issued too quickly). Note that this error count may duplicate information from the previous Initialize Modem Failures 1 Failure hanging up after a connection. This most likely affected the transaction following the failure. 4 VISA transactions were attempted 1 successful VISA transaction if test statistics flag is set, average times for visa2 protocol steps will be listed here (in ms) for 1 connection, host never sent ENQ 1 packet sent from test was nak'd by host. ConnTest will resend (3 tries) and this may end up a successful transaction. for 1 packet sent from test, host did not ack or nak. ConnTest will resend (3 tries) and this may result in a successful transaction 1 response received from the host did not contain an stx or etx or lrc. host did not send a response packet to 1 test pkt host did not send EOT to end transaction. Note that a missing EOT does not invalidate a transaction.
For SDLC transactions, the error counts include the number of times carrier was lost while waiting for a response, and the number of times the packet could not be transmitted SDLC (ie. Verix driver never received SDLC SNRM or polls from the host). SDLC performance information includes the time for the modem to connect and the time to send a packet and receive a response. The specific messages displayed vary depending upon the test setup and events during the test. Here are some of the messages that may be displayed and their meanings: General Modem Messages: Mdm Open Error nn Mdm SetOpnBlk Error nn Modem Do Cmd: cmd Mdm Write Cmd Err nn
Error opening device. nn is the OS errno value Error calling set_opn_blk(). nn is the OS errno value cmd was written to the modem port. cmd is an AT command string. Error writing command to modem port. nn is the OS
5
Rev 1.5.4
Mdm Get Response, Insuff Buffer(xx) Mdm Resp: resp
Mdm Error for cmd Mdm DTR Off err nn Mdm DTR On err nn
10/1/2004 errno value The size of a modem command response exceeded the application buffer size. xx is the buffer size. This error may occur often when echo is on resp is a modem response read from the port. Typically, this will just be a numeric Hayes result code. But if verbose is on, it will be a string such as OK or ERROR cmd resulted in an error modem response (Hayes result code 4) error setting dtr (usually during hangup). nn is OS errno value. error setting dtr. nn is OS errno value
Dialing & Connecting Messages: (Note that dial code assumes modem is in non-verbose mode): Modem dial cmd failed nn Error writing dial command. nn is OS errno value Mdm Dial Connected A Hayes connect result code was received Mdm Dial no carrier 3 A Hayes no carrier response code (3) was received Mdm Dial didn't connect xx Modem did not connect and xx is the result code. This is generally an error like no line, busy, etc. Mdm Dial resp? xx An unknown connect response code, xx, was read from the modem Mdm have DCD While waiting for a connect response code, carrier was detected Mdm Dial Timeout Timeout waiting for a modem connect response code or carrier. The timeout period is 65 seconds. Mdm Dial set sdlc error nn Error switching OS to sdlc. nn is OS errno value. Error Host connect rc response Depending upon test log level, this message may resp duplicate previous information. It summarizes the connect results. rc is a return code: -1 : Verix OS error or unknown modem resp. -3 : no carrier response code received. -4 : no connection due to busy, no line, etc. -43 : timeout waiting for modem response resp is the numeric modem response code. For Verix errors and timeouts, this may just be -1. Host connect xx host connected. xx is the hayes result code. For DCD detected connections (no actual modem response read), xx will be 1. Host init error rc errno nn error on modem initialization command. nn is the OS errno value. rc is the return code: -1 : Verix OS error -42 : Device not open -43 : timeout waiting for cmd response (timeout period is 2 secs) Other values are the Hayes result code. VISA/SDLC Messages: Visa sent pkt : nn Visa No AckNak error Visa unknown acknak nn
Visa packet written to modem. nn is the write return code (should be the packet size). no ack or nak was received. Packet is resent (3 tries). unknown code nn received when expecting ack or nak. Packet is resent (3 tries).
6
Rev 1.5.4 SDLC write pkt nn SDLC - lost carrier (ticks nn) SDLC Timeout
10/1/2004 SDLC packet written to modem. nn is the write return code (packet size) while waiting for a response packet, carrier was lost. nn is number of ticks waited before losing carrier. no response packet received from host. Timeout period is 15 seconds.
Source Code highlights File ConnTest.c, in conntest directory, contains the program main() and the class implementations unique to ConnTest. ConnTest.c relies on functionality in the TestSupport library for handling test input and output and general modem functions. Note: Microsoft VC++ projects are provided for both ConnectionTest and TestSupport. In both cases, the same project is used for both Verix and Verix V platforms but the build/make command is changed (see Project Settings). For Verix V platforms, the “.amk” file is the makefile. For Verix platforms, the “.smk” file is the makefile. In ConnTest.c main(), the test initialization consists • checking for the conntest configuration pause & waittime variables • initializing the test environment by calling the TestSupport library TEnvironFactory(), TinitializeInput() and TinitializeOutput(). • Logging terminal information such as the OS version and modem firmware version. • Initializing each host listed in #hostnames by calling FHostFactory() and then reporting each host configuration. Once initialized, main() starts its host test loop and continues until a key is pressed. In the host test loop, ConnTest cycles through each host trying to connect and do a transaction. When a key is pressed to stop the host test loop, main() reports the configuration and test results for each host. Several Connection Test specific classes are implemented in ConnTest.c. These include FHost and FTran. The general transaction class, Ftran, includes FvisaTran and FsdlcTran subclasses. An Fhost object represents a test host and includes methods to connect, disconnect and do a transaction. The Fhost attributes include a modem object (TestSupport library vmodem) and an Ftran object.
Summary ConnTest is a simple highly configurable program to allow different Verix terminals (and modems) to be tested against various hosts. Up to this point, the emphasis has been on verifying modem initialization and dialing. Once connected, Conntest performs a simple transaction with the host. Any problems and requests for this test program can be forwarded to I_DevNet.
7
Rev 1.5.4
10/1/2004
Appendix – Editing/Creating Packet File If a packet file is specified, ConnTest will write the entire contents of this file as the request packet for the host. For example, on a Visa or Visa2 transaction, the file contents will be written after an ENQ is received. As the Visa packet includes an LRC, the LRC must be in the file. Creating and modifying a packet file can be tricky. Packets generally include binary data (bytes that are not printable ASCII). Also, PC editors often append an end of file carriage return line feed to the end of text file. Various editors support binary editing of files. VIM (vi like editor for Windows) is an open source editor available at http://vim.sourceforge.net/. The following information provides some tips on using gvim (vim with Windows GUI) to edit packet files. • •
•
•
To avoid the end of file carriage return line feed characters, use the –b option (ex. gvim –b or vim –b). To easily edit files in hex, I modified the desktop shortcut properties (right click icon and select properties). On the shortcut tab in the properties dialog, I set the “start in” directory to the VIM installation directory so that all the VIM scripts would be available. On the Target field, I added the –b option. In gvim, to see file as hex use the convert to hex option on the tools menu. In this mode, you can change the hex side of the display. Any changes to the ascii side of the display will not update the file. Watch out for deleting characters in this mode (in my experience, it didn’t work as expected. I’m not sure if this was operator error or a bug) From the gvim hex display, use the convert back option on the tools menu to return to normal editing mode.
A sample binary packet file, Amex.pkt, is provided in the ConnectionTest\SDSOutput directory.
Appendix – Creating a custom ISO 8583 Packet File a) Capture the request packet and the response packet with an MLT and save it as text. The request packet is the only thing that’s needed, the response packet is just to know that the request packet was Ok and it has been accepted by the host. b) Edit the captured file: Remove unnecessary information from the front of the packet, like [ATB], [CDFE], 3093f77f, 3073F9E3, until “3010” (inclusive) c) Locate the start of the following SDLC frame, like 3011ede3 or 3031ef67 and eliminate them and all that follow. Remove the last four characters of the packet (SDLC checksum for the “3010” frame). What is left should look something like this: 600101000002003020058020C4000300000000002222220000002200220101003 24259430980001019D09091010111111134343434343431353539373030313630 303133332020200048004630313133202020205245414131335F313230372D363 3362D303434202020203030303030303030303030302020200058005631343030 30303030303030303030303330303030303030303030303030303030303030303 03030303030303030303030303030303030303013D6AF8500000000 d) Format the above group of hex numbers like this: 0000000: 0000010: 0000020: 0000030: 0000040:
6001 0000 3242 1134 3030
0100 0000 5943 3434 3133
0002 2222 0980 3434 3320
0030 2200 0010 3431 2020
2005 0000 19D0 3535 0048
8020 2200 9091 3937 0046
C400 2201 0101 3030 3031
0300 0100 1111 3136 3133
8
Rev 1.5.4 0000050: 0000060: 0000070: 0000080: 0000090: 00000a0: 00000b0:
10/1/2004 2020 3633 3030 3030 3030 3030 3030
2020 362D 3030 3030 3030 3030 3030
5245 3034 3030 3030 3030 3030 3030
4141 3420 3020 3030 3030 3030 13D6
3133 2020 2020 3030 3030 3030 AF85
5F31 2030 0058 3030 3030 3030 0000
3230 3030 0056 3033 3030 3030 0000
372D 3030 3134 3030 3030 3030
e) Start GVIM editor with the option “-b” and paste the formatted text f)
At the end of the text, in the hex section add “0d0a”
g) Go to [Tools] [Convert back] h) Go to [Tools] [Convert to HEX] i)
Go to [File] [Save as] and save it as PacketName.bin
9