ttplugin ttmex - spirent...example project structure ttcn3 the source code of ttcn-3 definition...

14
TTplugin TTmex First Steps User’s Guide spirent.com General Information This user’s guide helps you to download and install TTworkbench, and guides you through configuring and running the built-in example in TTmex plugin. For a successful proceeding please follow the instructions step by step! If you need any assistance, please contact Spirent’s customer care department: Mr. Dirk Borowski Manager Support Services Phone: +49 30 726 19 19 0 Email: [email protected]

Upload: others

Post on 23-Jan-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

TTplugin TTmex First Steps User’s Guide

spirent.com

General Information This user’s guide helps you to download and install TTworkbench, and guides you through configuring and running the built-in example in TTmex plugin. For a successful proceeding please follow the instructions step by step! If you need any assistance, please contact Spirent’s customer care department: Mr. Dirk Borowski Manager Support Services Phone: +49 30 726 19 19 0 Email: [email protected]

Page 2: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | i

Table of Content 1. Requirements……………………………………………………………………………………. 3 2. Download………………………………………………………………………………………… 3 3. Installation……………………………………………………………………………………….. 4

3.1. TTworkbench………………………………………………………………………………… 4 3.2. TTplugin TTmex……………………………………………………………………………... 4 3.3. Import Built-in Example……………………………………………………………………... 5

4. Configuration……………………………………………………………………………............. 6 4.1. Test Session Deployment in .mex File……………………………………………………. 6 4.2. Daemon Preparation………………………………………………………………………... 9 4.3. Synchronization Between Master and Slave(s)…………………………………............. 9

5. Running Test Cases…………………………………………………………………………….. 9 5.1. Starting Master Daemon……………………………………………………………………. 9 5.2. Starting Slave Daemon…………………………………………………………….……….11 5.3. Start Test Case in TTworkbench on the Master Computer…………………………….11 5.4. Analysis………………………………………………………………………………………12

6. Details……………………………………………………………………………………………13 6.1. Core Language Editor (CL Editor)……………………………………………….............13 6.2. TTthree (TTCN-3 Compiler)……………………………………………………………….13 6.3. TTman (Test Execution Management)…………………………………………..........…13

7. Appendix………………………………………………………………………………………...14

Page 3: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 3/14

1. Requirements Operating Systems: Microsoft Windows 7/8/10 Linux (GTK2, x86-32, x86-64)

Java 2 Platform: Version 8 JDK or JRE Download at www.oracle.com/technetwork/java/javase/downloads/index.html. We strongly recommend using the above Java JDK. With the OpenJDK / IcedTea for Linux the TTworkbench license will not work correctly!

Memory: 2 GB (4 GB recommended)

Reference ID and License File Before you download TTworkbench and TTmex plugin, make sure you received a valid license file. Otherwise please contact our sales team at [email protected].

2. Download Please use Spirent’s Customer Service Center at https://support.spirent.com. Step 1 In case you are not registered yet, go to https://support.spirent.com/CSC/register and fill in the registration form. The support team will check your data and notify you about your approval. Step 2 Login at Spirent’s CSC and click on the download app tab on the left side. Step 3 Select the product line TTworkbench and filter for categories and operating system. Download the purchased TTworkbench version. Step 4 Click on folder TTplugins for TTworkbench and download TTmex.

Page 4: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 4/14

3. Installation

3.1. TTworkbench Step 1 Windows Platform: Double click on TTworkbench-xxx-installer.exe (to be found on desktop or selected directory). Linux Platform: Use command line java-jar TTworkbench-xxx-installer.jar Step 2 Follow the pop up installation wizard… Browse for the valid license file license.dat already saved in your favored directory. (TTsuite-xxx and TTworkbench require a valid license file for execution.) Step 3 Start TTworkbench from created desktop icon or menu entry. Step 4 Start a new workspace by accepting the default workspace location on request or choose an existing one.

3.2. TTplugin TTmex Step 5 In the TTworkbench menu, click on menu item Help → Install New Software… Step 6 Click Add… → Archive. Choose the downloaded installation file TTplugin-TTmex_x.x.x_archived-site.zip, check the TTworkbench features box, click Next → Next. Accept the terms of license agreements. Finish and confirm the restart of TTworkbench.

Page 5: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 5/14

3.3. Import Built-in Example Step 7 After restart you can import the built-in example project. Close the welcome tab. In the project view, just click on the right mouse button, go to menu: File → Import → TTCN-3 → TTCN-3 Example Projects → DistDino Example → Finish.

3.3.1. Example Project Structure

ttcn3 The source code of TTCN-3 definition

Build The Java .class files

Javasrc The Java source code, here the codec example implementation

Lib Additional Jar libraries

build.xml antbuild file for jar packaging

*.ccf, *.tcdl Part of TTmex configuration, belong to .mex

*.clf Test campaign loader file for stand-alone test execution

*.tlz Test logging file

README The configuration and usage instruction

*.mex Configuration and execution script file

taconfig.xml The test adaptation configuration

.mex ist the key configuration and execution file to distributed testing.

Page 6: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 6/14

4. Configuration

4.1. Test Session Deployment in .mex File Step 8 Double click on *.mex file. You will see several tabs opened in the language editor.

4.1.1. script.mex

In the first tab script.mex after load -s $ses_id -c alpha1 -clf DinoListTest.clf

add the following line load -s $ses_id -c alpha2 -clf DinoListTest.clf

Then save the setting with Ctrl + S. alpha1 and alpha2 are the container names. You can name them as you like. The master and the single slaves will be defined in separate containers in the next step.

4.1.2. Container Configuration File (CCF) Editor

Switch to the next tab “CFF Editor” for container configuration.

Click the “…” button at top right hand side to configure your master (own) computer by entering your Hostname, IP address and give a container name as in the previous script.mex, here alpha1. Choose the available hostname and IP address in the dropdown menu or input some proper ones.

Page 7: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 7/14

Press either Apply button to verify. The fields will turn green when successfully verified. Now, the OK button is active, press it to confirm.

Press the Duplicate button to duplicate the existing container, change the Host name (the slave computer name), Host address (the IP address of the slave computer) and the container name – e.g. now to alpha2. The container names must be the same as in the script.mex setting, here alpha2.

Alternatively, you can use the Add button to add new a container. However, you will have to repeat the rest of the setting. All containers (here alpha1 and alpha2) must contain the Deploy files, which are runnable and configuration files needed for test execution, including:

• the jar files compiled from ttcn3 source, • all the (not built-in) plugin jar files, • configuration files like TT3plugins.xml and taconfig.xml files.

These will be transferred to the slave daemon(s) when starting the test session. In this example the Deploy files – ttcn3 executable, TA and other adapters are already included. To add any of your own Deploy files, please press the Add button to choose the proper files from the project in this workspace, then save the setting with Ctrl + S. This setting is then saved in DinoListTest.ccf file in XML format.

Page 8: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 8/14

4.1.3. Test Component Distribution Language (TCDL) Editor

Switch to the tab “TCDL Editor” (Test Component Distribution Language). mtcType uses the main container, here alpha1. ptcType uses both containers, alpha1 and alpha2.

Press the Add button in the “Component containers” section to add the second container (here alpha2) to pctType, then save the setting with Ctrl + S. Generally, the distribution algorithm of Round-Robin is used, i.e. the PTC instances are distributed on the master and the slaves in row and then in circle.

For example in case of 4 PTCs, PTC[0] and PTC[2] on the master apla1, PTC[1] and PTC[3] on the slave alpha2. This setting is saved in DinoListTest.tcdl file in XML format.

Page 9: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 9/14

4.2. Daemon Preparation 4.2.1. Master Daemon

Copy and unzip the TTmexDist.zip from <TTworkbench installation directory>\plugins\com.testingtech.ttworkbench.ttmex.rt_x.x.x.x to your preferred local folder (on your master computer). Add the license file in the TTmex_x.x.x directory. Make sure you have enough features for TTworkbench, TTmex daemon and all the plugins in your license. Each (master and slave) daemon needs a set of features in the license. The unzipped TTmex_x.x.x directory is now your TTmex root path.

4.2.2. Slave Daemon(s)

• Copy the TTmex_x.x.x directory to anywhere on your slave computer(s). • If you have installed some plugin in your TTworkbench, copy that from your TTworkbench

installation directory under plugins folder to the tt3plugins folder in the TTmex_x.x.x directory (no need for this example).

• Add the license file in the the TTmex_x.x.x directory. Make sure you have enough features for TTworkbench, TTmex daemon and all the plugins in your license. Each (master and slave) daemon needs a set of features in the license.

4.3. Synchronization Between Master and Slave(s) The synchronization is a very critical point for a successful distributed test.

Make sure you are using some NTP (Network Time Protocol) service in your local network to synchronize the master and slave computers precisely.

5. Running Test Cases

5.1. Starting Master Daemon Before running the test case, the master daemon must be started from the TTmex root path. Go to <TTmex root path>\bin open the startDaemon.bat (under Windows) or startDaemon.sh (under Linux) and modify it (input your own real local IP address) in the following line. if not defined %NS_HOST (set NS_HOST=<your Local IP address>) Then open a command line console, go to the <TTmex root path>\bin path and start the master daemon with the .bat/.sh file. Just double click under Windows. <TTmex root path>\bin>startMasterDaemon.bat

Page 10: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 10/14

Press any key at request. Two more consoles will be started – Session manager and daemon. If you see the following, they are started successfully. [session manager started successfully] [daemon started successfully (IP=<You master IP address>)]

Attention: Do not close them during the whole test execution!

Page 11: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 11/14

5.2. Starting Slave Daemon On the slave computer, open <TTmex root path>\bin\startDaemon.bat with any text editor and modify the following line: if not defined %NS_HOST (set NS_HOST=<Master IP address>) Open a command line console, go to the TTmex\bin path and start the daemon with the .bat/.sh file. Under Windows you can start it by double clicking. <TTmex root path>\bin\startDaemon.bat Attention: Not start the master but the (slave) daemon. You will see the following in the console if it is started successfully. [daemon started successfully (IP=<You slave IP address>)]

5.3. Start Test Case in TTworkbench on the Master Computer In TTworkbench, open TTmex console over Window → Show View → Other → TTmex → TTmex Console. You will see a new tab “TTmex Console” under the core language editor. Click the Connect to name server button and confirm the selected connection.

You are asked to start the (master and slave) daemons if not done. You will see the following on the slave daemon: [daemon started successfully (IP=<You slave IP address>)]

Press the execution button to run the test case.

Page 12: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 12/14

Choose the TTmex script.

After execution, a pop up window indicates the script execution is terminated. The log file exec.tlz is saved in the project root directory (as set in the script.mex file).

5.4. Analysis

• Double click on the exec.tlz file and switch to the execution perspective. • Click on the TTCN-3 Graphical Logging tab. It shows the results of the execution as a

graphical presentation. • A single click on a send message arrow provides further details of the TTCN-3 template

representation in the Test Data View. • A single click on a receive arrow shows you the received message compared to the expected

TTCN-3 template. Mismatched values are marked red. • In the Dump tab you can check the message in hexstring format.

For more details, please refer to the built-in manual in TTworkbench clicking on Help → Help Contents → Spirent TTworkbench User's Guide → Using TTworkbench TTman → Using TTman.

Result Analyzer

Graphical Online Logging

Management View

Test Parametrization

Page 13: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com | 13/14

6. Details

6.1. Core Language Editor (CL Editor) Each TTCN-3 file can be opened by double clicking in the project view and then be edited in the CL Editor. After opening the files, the source code will be syntactically checked and highlighted. In addition, an outline will be generated automatically and the go-to-declaration feature will be enabled.

6.2. TTthree (TTCN-3 Compiler) For recompiling all TTCN-3 files open DinoListTest.ttcn3 in the CL Editor and press the Rebuild button . Please note! Compilation is only necessary if changing test cases or creating new ones. Otherwise, the generated *.jar files from TTCN-3 source are already available for execution.

6.3. TTman (Test Execution Management) In order to execute the standalone test cases and configure parameters, the CLF has to be loaded into the Test Execution Management. For more details, please refer to the built-in manual in TTworkbench clicking on Help → Help Contents → Spirent TTworkbench Users Guide → Using TTworkbench TTman → Using TTman. Additionally, you find further documentations of TTmex usage here: Built-in manual in TTworkbench: Help → Help Contents → Spirent TTmex Users Guide. DistDino example project: README TTmex-xxx root directory: README

TTCN-3 Compiler/ Validate Buttons

Project View TTCN-3 CL Editor

Outline

Page 14: TTplugin TTmex - Spirent...Example Project Structure ttcn3 The source code of TTCN-3 definition Build The Java .class files Javasrc The Java source code, here the codec example implementation

Spirent TTplugin TTmex First Steps User’s Guide

spirent.com/ttworkbench

AMERICAS 1-800-SPIRENT +1-818-676-2683 | [email protected]

US Government & Defense [email protected] | spirentfederal.com

EUROPE AND THE MIDDLE EAST +44 (0) 1293 767979 | [email protected]

ASIA AND THE PACIFIC +86-10-8518-2539 | [email protected]

© Spirent Communications, Inc. All of the company names and/or brand names and/or product names and/or logos referred to in this document, in particular the name “Spirent” and its logo device, are either registered trademarks or trademarks pending registration in accordance with relevant national laws. All rights reserved. Specifications subject to change without notice.

Rev # 2017/04/06 14/14

7. Appendix Acronyms

CCF CD CL Editor CH CLF IUT MTC PTC TCDL File

Container Configuration File Coding/Decoding Core Language Editor Component Handler Campaign Loader File Implementation Under Test Main Test Component Parallel Test Component Test Component Distribution Language File

Notes This document is subject to change without notice. Spirent Communications Michaelkirchstraße 17/18 10179 Berlin, Germany Phone +49 30 726 19 19 0 Fax: +49 30 726 19 19 20 Email: [email protected] Internet: www.spirent.com/ttworkbench