intx82 / GL-ESK-TEST-SUIT

TTCN-3 tests to verify a udp server implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to install TTCN-3 test environment to validate the UDP server implementation

Note: If you have installed STM32Cube IDE, which is based on Eclipse IDE, you can skip steps 1 - 2.

  1. Download the Eclipse IDE installation package usign the next link

https://www.eclipse.org/downloads/

  1. Install Eclipse C/C++ Development Tool IDE

a) Launch eclipse-inst

plot

b) Follow the instructions to install Eclipse C/C++ Development Tool IDE

plot

  1. Download and install Eclipse Titan TTCN-3 compiler

Note: if you are using a platform other than Ubuntu Linux, you should read the relevant titan.core/README.platform to install titan on your platform.

Here is a short description how to install Eclipse Titan on Ubuntu Linux:

a) Clone Titan git repository:

$ cd ~
$ git clone https://gitlab.eclipse.org/eclipse/titan/titan.core.git

b) Install additional required packages:

sudo apt-get update -y
sudo apt-get install g++ expect libssl-dev libxml2-dev libncurses5-dev flex bison libedit2 libedit-dev

c) Build and install Eclipse Titan compiler:

$ cd ~/titan.core
$ make JNI=no install

d) Add required paths into ~/.bashrc :

export TTCN3_DIR=/home/<userid>/titan.core/Install
export PATH=/home/<userid>/titan.core/Install/bin:${PATH}
export LD_LIBRARY_PATH=/home/<userid>/titan.core/Install/lib:${LD_LIBRARY_PATH} 

e) Reboot or logout/login:

$ sudo reboot
  1. Download and install the Titan Designer Plug-in

a) Use the folloving link to download the Titan Designer Plug-in:

https://www.eclipse.org/downloads/download.php?file=/titan/TITAN_Designer_and_Executor_plugin-8.3.0.zip

b) Open Eclipse C/C++ IDE or STM32Cube IDE and install the downloaded plug-in:

Click 'Help->Install New Software..', then click 'Add..' button, after that click "Archive.." button and select the TITAN_Designer_and_Executor_plugin-8.3.0.zip file location

plot

plot

plot

plot

plot

  1. Setup path to the Eclipse Titan compiler

Click 'Windows->Preferences->TITAN Preferences', then click 'Browse...' button to select Titan installation path

plot

  1. Import udp_server_ttcn_test_suit project into Eclipse IDE

Click 'File->Import...', you will see an import window, select 'Existing project into Workspace' and click 'Next'.

plot

plot

  1. Compile udp_server_ttcn_test_suit

Select imported project in the Project Explorer at the left side of the IDE, then click 'Project->Clean...'

plot

You will see the compilation process in the Console window at the bottom of the IDE:

makedepend: warning:  ../src/udp_client.c (reading /usr/include/unistd.h, line 1218): cannot find include file "bits/unistd_ext.h"
	not in ./bits/unistd_ext.h
	not in /home/petro/titan.core/Install/include/bits/unistd_ext.h
	not in ./bits/unistd_ext.h
	not in ../src/bits/unistd_ext.h
	not in /usr/include/bits/unistd_ext.h
Operation finished successfully.
sh -c make all  -j 8  
g++ -c -DLINUX -I. -I/home/petro/titan.core/Install/include -I. -I../src -Wall -O2  -o udp_server_test_suit.o udp_server_test_suit.cc
g++ -c -DLINUX -I. -I/home/petro/titan.core/Install/include -I. -I../src -Wall -O2  -o PCOType.o ../src/PCOType.cc
g++ -c -DLINUX -I. -I/home/petro/titan.core/Install/include -I. -I../src -Wall -O2  -o udp_client.o ../src/udp_client.c
g++  -o udp_server_ttcn_test_suit udp_server_test_suit.o PCOType.o udp_client.o \
-L/home/petro/titan.core/Install/lib -L/home/petro/titan.core/Install/lib -L/home/petro/titan.core/Install/lib \
-lttcn3-parallel -lcrypto \
-lxml2 -lpthread  -lrt \
|| if [ -f /home/petro/titan.core/Install/bin/titanver ]; then /home/petro/titan.core/Install/bin/titanver udp_server_test_suit.o PCOType.o udp_client.o; else : ; fi
Operation finished successfully.
  1. Run udp_server_ttcn_test_suit

8.1. Run udp_server_ttcn_test_suit with the test udp server

a) Run ./start_server.sh in Ubuntu terminal:

user@host:~/GL-ESK-TEST-SUIT$ ./start_server.sh 
Compilation...
********************
* Compilation done *
********************
Launching UDP server...
Press 'exit' to exit
[udp_server.c : udp_server_init: 56]: UDP Server is bound to port 5678

b) Run udp_server_ttcn_test_suit

Switch perpective by clicking 'Windows->Perspective->Open Perspective->Other...', select 'TITAN Executing'

plot

Select the project in the Project Explorer, right click on the project and select 'Run As->TITAN Parallel launcher' in the context menu.

plot

plot

If successful, the Console window should display the following message:

MC@DellVostro: Test execution finished.
MC@DellVostro: Terminating MTC.
MTC@DellVostro: Verdict statistics: 0 none (0.00 %), 30 pass (100.00 %), 0 inconc (0.00 %), 0 fail (0.00 %), 0 error (0.00 %).
MTC@DellVostro: Test execution summary: 30 test cases were executed. Overall verdict: pass
MC@DellVostro: MTC terminated.
MC@DellVostro: Shutting down session.
MC@DellVostro: Shutdown complete.

If it fails, you need to investigate the cause of the TC failure by reading the generated logs.

Switch perpective by clicking 'Windows->Perspective->Open Perspective->Other...', select 'TITAN Editing'.

Open 'udp_server_ttcn_test_suit->bin->logs' to see all generated logs.

If the Project Explorer doesn't contain 'bin' subdirectory, setup the filter by clicking 'Filter and Customizations' in the right top corner of the Project Explorer window:

plot

Make sure the following checkboxes are not selected:

  • TITAN excluded resources
  • TITAN working directory

Open udp_server_ttcn_test_suit.< hostname >-hc_merged.log to investigate the cause of the TC failure:

MTC@DellVostro: Verdict statistics: 0 none (0.00 %), 30 pass (100.00 %), 0 inconc (0.00 %), 0 fail (0.00 %), 0 error (0.00 %).

There are several verdicts:

  • none - number of test cases that hasn't been run
  • pass - number of passed TCs
  • inconc - number of inconclusive TCs
  • fail - number of failed TCs
  • error - number of TCs that contain errors

8.2. Run udp_server_ttcn_test_suit with the udp server launched on GL Embeded Starter Kit

a) Connect your board to Ethernet network.

Make sure the Ethernet link is up and the board IP is in the same network with the test executor.

b) Change the following line 'udp_server_ttcn_test_suit->src->PCOType.cc:109' with your board's IP address:

	std::string ip = "127.0.0.1";

Compile the test suit as described in 7, then follow the instructions in 8.1.b.

About

TTCN-3 tests to verify a udp server implementation


Languages

Language:C 63.3%Language:C++ 33.3%Language:Makefile 2.2%Language:Shell 1.1%