Testing with Tdrv

Introduction

Newly installed hardware and software should be tested to insure that everything is functioning properly. The LayGO Toolkit's Tdrv test program is designed for just that purpose: testing the LayGO device driver and communication board with the protocol stack software.

Using Tdrv, the user opens and directly controls a device in the LayGO protocol stack's X.21 bis physical layer. The user can connect and disconnect the device and send and receive data. Tdrv displays the state of the physical signals as well as details of frames sent and received. The user can also retrieve status and statistics information directly from the device. The state of the underlying LayGO device controls the state of Tdrv's interface based on the LayGO API state machine. User controls are enabled and disabled based on the actions allowed by the state of the device.

Tdrv is not a general LayGO test program. It is not designed to connect to a network or other equipment which requires higher layer protocols. However, it can be used to test the physical connection to such a network or device. It can display any frames received on the connection, and using the Test Data feature discussed below, the user can send previously prepared frames to emulate higher layer protocols.

Tdrv comes in a number of different versions all of which have exactly the same user interface. The Win32 version of Tdrv is shown below:

WinTdrv Program
The Win32 version of Tdrv - WinTdrv.

The following versions of Tdrv are currently supported:

Program Platform
WinTdrv Win32 MFC program for Windows written with the C Language API.
CppTdrv Win32 MFC program for Windows written with the LayGO C++ Wrapper.
VbTdrv Visual Basic 5 program for Windows.
Dtdrv Delphi 4 program for Windows.
Xtdrv X Windows (Motif) program for Solaris (requires the Xpm library).
Jtdrv Java program for Windows, Solaris and Linux using the Java Abstract Windowing Toolkit (AWT).
Stdrv Java program for Windows, Solaris and Linux implemented using the Java Foundation Classes (JFC) known as Swing.
PlTdrv Perl5 program for Windows, Solaris and Linux (requires the Perl/Tk extension).
TclTdrv Tcl/Tk 8.1 program for Windows, Solaris and Linux.
PyTdrv Python 1.5 program for Windows, Solaris and Linux (requires the Tkinter and Pmw extensions).

All versions of Tdrv have virtually identical features and displays. In the following sections, references to Tdrv apply to all versions unless specifically stated otherwise.

Starting Tdrv

To run Jtdrv, you must install either the Java Development Kit (JDK) or the Java Runtime Environment (JRE). The command-line syntax for starting Jtdrv in both environments is discussed in the LayGO for Java manual.

The command-line syntax for the other versions of Tdrv is:

<tdrv> [ cfg file list ]

where <tdrv> is the name of the Tdrv program and [ cfg file list ] is an ordered list of .cfg files Tdrv will use to configure the stack at startup. For instance, to test in hardware loopback mode using WinTdrv, enter:

wintdrv stackx.cfg x21loop.cfg

where the x in stackx.cfg is the LayGO Board Identifier for the installed device driver, such as 6 for the LayGO Hardware Emulator Driver.

Running Tdrv

10 buttons on the main display control the operation of Tdrv. Most button names are shortened versions of the LayGO API functions they invoke. (The exception is Full Duplex which toggles full speed data transfer in both directions.) The operations available at any time depend on the state of the connection. Buttons for operations which are not available are grayed out but become active as Tdrv changes state.

To start, select a line number, then press Open followed by either Connect or Listen. When the connection is established, buttons allowing data transfer will be enabled. To terminate the connection, press the Disconnect button. When you are done testing, press the Close button.

Menu Options

Logging
The Logging menu allows the user to set the level of detail displayed in the log window and to clear the log display.
Statistics
The Statistics menu gives the user access to statistics and status report data from an open X.21 bis device. It also allows the user to clear the device statistics and the send and receive counters in the display.
Data
The Data menu allows the user to load test data frames from a file and, once in data transfer state, to select individual frames to send.

Verified Transmission

When Tdrv exchanges data with another system, the user can choose to enable the verified transmission protocol. Using this protocol, each system repeatedly sends a predetermined sequence of frames. Since the content of every frame is known in advance, the receiver can verify that the frames are received correctly and in order and report any discrepancies. Verified transmission provides an automated test of the physical integrity of the communication equipment, but requires 2 systems each running Tdrv.

Test Data

Test data frames are prerecorded byte sequences which can be read into the program as binary data from an ordinary text file. The default extension for test data files is .dat.

Each frame in the file begins with a title enclosed in square brackets followed by any number of lines of hex-coded bytes. Blank lines and lines starting with a # (pound sign) are ignored. The following is a sample file containing 12 HDLC LAPB supervisory frames:

#
#   lapb.dat
#
#   HDLC LAPB supervisory frames (modulo 8)
#
[DTE SABM P=0]
01 2F

[DTE SABM P=1]
01 3F

[DCE SABM P=0]
03 2F

[DCE SABM P=1]
03 3F

[DTE DISC P=0]
01 43

[DTE DISC P=1]
01 53

[DCE DISC P=0]
03 43

[DCE DISC P=1]
03 53

[DTE UA P=0]
03 63

[DTE UA P=1]
03 73

[DCE UA P=0]
01 63

[DCE UA P=1]
01 73

Although Tdrv does not use the LAPB protocol layer, these frames could be sent to test whether a LAPB link can be established over a particular physical connection.