Tik-76.115 Individual Project: Guinea Pig
$Id: server_protocol.html,v 1.5 1996/03/04 13:11:40 kepa Exp $

Testee UI - GUI server protocol

This document describes one of the communication protocols used inside Testee UI module. Here's the communication framework. (Things described in this document are drawn in black):

[Image]

General overview

The Testee UI has parts in three different processes. This document describes the communication between two of those processes: the GUI server process and the Test Logic process.

Communication method used

The GUI server process communicates with the Test Logic process with a communications socket called GUINEAPIG_TESTEE_SOCKET. The GUI server process is first started up in a (potentially) remote machine. After this the Test Logic connects to the socket of the GUI server process. This socket is used to give commands to GUI server process. The main task of the GUI server process is to start the GUI process Test Logic needs on the (potentially) remote machine.

The protocol used between Test Logic process and GUI server process is a simple text based protocol. The protocol is line based and protocol messages are separeted from each other by the newline ('\n') character. The basic protocol message consist of a command with some number of parameters. Whitespace characters are used between command and arguments. Here is an example:

INIT AB\n
Here the protocol command is INIT, there is a space between the first parameter and the command, and the first parameter is AB. The GUI server process can also send responses to the Test Logic process using the same protocol. Here's an example:
CLOSE-ACK

This simple text based protocol was chosen because it is easy to debug interactively using text-based tools. It is also pretty simple to implement.

Protocol messages sent to GUI server process

Here is the list of protocol messages sent to GUI server process. The type of the parameter is in parenthesis. The command and parameters are separated by whitespace and each command line ends with a newline character ('\n').
INIT guiname(string)
QUIT

INIT command tells GUI server process to start a new GUI process. The guiname parameter is the name of the GUI to initalize, given in uppercase letters. The GUI server starts a new python interpreter with the (lowercase) guiname.py module as the Python program to be run.

The GUI names are not hardcoded, so you can add a new gui without changing anything in GUI server. All you have to do is to make sure your module is in a directory listed in the Python module load PATH (PYTHONPATH environment variable specifies it). Your module should be able to specify the socket port it uses with the -s portnumber argument. Here's an example how GUI server starts a new process:

python ab.py -s 20050

QUIT command tells GUI server process to exit, closing communication socket to Test Logic.

Protocol messages sent by GUI process

Here is the list of protocol messages sent by GUI process. The type of the parameter is in parenthesis. The command and parameters are separated by whitespace and each command line ends with a newline character ('\n').
CLOSE-ACK

CLOSE-ACK message means that the GUI process has terminated and Test Logic can now initialize a new GUI process by sending GUI server an INIT command.


· Testee UI Architecture · Testee UI Index · Document index · Guinea Pig ·