OpenTTCN/Knowledge base/TTCN-3 adapter checklist

From OpenTTCN

Jump to: navigation, search

  OpenTTCN DocZone

  Home | Developer's corner | Knowledge base | Working documents | Documentation | OpenTTCN IDE | Tutorials | Training | How do I | Frequently asked questions | Technical support


TTCN-3 adapter checklist



  1. implement each TSI port with separate SUT adapter executable
  2. set local TCP port number (select TCP port X) of the adapter if you need to know this for making a holes in the firewall
  3. locate openttcn server with otInitAdapter(openttcn_server) where openttcn_server is, for example, ”127.0.0.1:5500”
  4. register adapter with openttcn server with otRegisterAdapter(session, adapter_role) where session is the name of the testing session, and adapter_role is one of: TRI, TRI:tsiport, TRI_PA, TRI_PA:extfunction, TCI_CD, TRI_PA_TIMER, etc The TRI:tsiport is the recommended one for SUT adapter ports
  5. set the debug output events on for development phase, maybe off for deployment
  6. keep the decoding value verification on for the development phase, maybe of for deployement (only if the performance matters, keep on for deployment, if no performance resons to disable it)
  7. register encoder and decoder with otSetEncoder and otSetDecoder
  8. implement TRI operations necessary, return TRI_OK only for success, and return TRI_ERROR otherwise. Return TRI_ERROR all the adapter operations not implemented by this adapter such as procedure based communication, timer operations, SUT actions, etc.
  9. If you have error situation in adapter, call otReportError(error_reason) where the error reason is the error description to be recorded to the testing log
  10. insert any extra information to the testing log from the adapter by calling otInsertLogItem(log_event) function where the log_event is the string to be recorded to the testing log
  11. if you need to process responses you normally need to start a new listener thread
  12. output all the important information from the adapter: session name, tsi port, openttcn server IP address and port, adapter IP address and port, openttcn SDK version used, adapter version number (maybe related to subversion version information)
  13. use otSetProperty(name, value) to record values of important properties to the testing log as well, where name is the name of the property and value is the value of the property, properties that can be used are, for example: adapter name, adapter type, adapter version, TSI port this adapter is implementing, openttcn SDK version, etc
  14. wait while the adapter finishes using while (1) Sleep(10000) or otSARun(), etc.
  15. stop the adapter using one of the following sequences:
    1. call otStopAdapter(sessionname, tsiport) from another adapter for each adapter needed to be stopped where session name is the name of the testing session and the tsiport is, for example, ”TRI:tsiport” style name of the adapter
    2. issue from command line: session stop session_name TRI:tsiport
    3. kill adapter manually and issue from command line: session unregister session_name TRI:tsiport

Running distributed setup

  1. configure real IP address to the host setting in etc/OpenTTCN.cfg configuration file in the PC running the openttcn server
  2. set hole in the firewall for TCP port 5500 in the PC running the openttcn server
  3. set hole in the firewall for TCP port X in the PC running the openttcn adapter
  4. in PC running openttcn server: start openttcn server, create testing session, load TTCN-3 modules
  5. in the PC running the adapter: start the adapter
Views
Personal tools