Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Help Needed on Sample Test Project using TITAN
Help Needed on Sample Test Project using TITAN [message #1758020] Wed, 22 March 2017 18:55 Go to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi,

I am planning to have the below Test systems with TITAN installed:

Windows-System1: TItan Installed on Cygwin Acting like DNS Client
Ubuntu-System2: Titan Installed Acting like DNS Server

Test Scenario is attached.

For this I am planning to use the following:

Protocol Module: DNS
Test Port(Transport Layer): TCP

I have created the attached Abstract Test suite DNSClient.ttcn & DNSClient.cfg.

In the same folder I have copied the below files:

TCPasp_PT.hh
TCPasp_PT.cc
DNS_EncDec.cc

Executed the below command to generate Make file:

$ ttcn3_makefilegen -gs DNSClient.ttcn TCPasp_PT.cc DNSClient.cfg
Generating Makefile skeleton...
Makefile skeleton was generated.

When I run command "make dep", I am getting below error:

$ make dep
/home/eirmnp/software/titan/bin/compiler -L DNSClient.ttcn - DNSClient.ttcn
Notify: Parsing TTCN-3 module `DNSClient.ttcn'...
DNSClient.ttcn:17.9-12: error: at or before token `type': syntax error, unexpected TypeDefKeyword, expecting Identifier
DNSClient.ttcn:30.26-29: error: at or before token `runs': syntax error, unexpected RunsKeyword, expecting '('
Notify: Errors found in the input module. Code will not be generated.
Creating dependency file for TCPasp_PT.cc
In file included from TCPasp_PT.cc:34:0:
TCPasp_PT.hh:33:27: fatal error: TCPasp_Types.hh: No such file or directory
compilation terminated.
make: *** No rule to make target 'compile', needed by 'DNSClient.cc'. Stop.

But when I check the link: https://github.com/eclipse/titan.TestPorts.TCPasp/tree/master/src

I am not able to find the TCPasp_Types.hh.

Could you please help me how to get this file? & Is the procedure followed by me to create a test case is correct?

I have attached all files used for this activity.

Thanks in advance.

Regards,
Ramakrishna


[Updated on: Wed, 22 March 2017 18:57]

Report message to a moderator

Re: Help Needed on Sample Test Project using TITAN [message #1758021 is a reply to message #1758020] Wed, 22 March 2017 19:05 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Ramakrishna,

first of all, are you certain you want to use TCP? DNS communicates over TCP rarely, only in case of long messages if I remember correctly; for ordinary queries, UDP should be used.
secondly, I don't see your Makefile in the package you have attached;


please do a 'make archive' ; this should create a package with all files plus Makefile, and attach it to your response.

BR


Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758022 is a reply to message #1758021] Wed, 22 March 2017 19:09 Go to previous messageGo to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Elemer,

Thanks for the quick response. First I thought of using Transport Layer as TCP. If it works I thought of using Test port UDP.

Please find the make archive attached.

Regards,
Ramakrishna
Re: Help Needed on Sample Test Project using TITAN [message #1758023 is a reply to message #1758020] Wed, 22 March 2017 19:11 Go to previous messageGo to next message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 30
Registered: July 2015
Member
Hi Ramakrishna,

Please also note, that your TTCN-3 file is truly erroneous.
In the structure:
"
type record DNSQuery{
QNAME domainName,
QTYPE type,
QCLASS class
}
"
it is not allowed to use "type" as a field name ... as it is a keyword in TTCN-3.

Best Regards
Kristof
Re: Help Needed on Sample Test Project using TITAN [message #1758024 is a reply to message #1758023] Wed, 22 March 2017 19:14 Go to previous messageGo to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Kristof,

Thanks for pointing the mistake. I will change "type" to "messageType".

Regards,
Ramakrishna
Re: Help Needed on Sample Test Project using TITAN [message #1758025 is a reply to message #1758023] Wed, 22 March 2017 19:15 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Ramakrishna,

you are also missing files from the DNS protocol module and TCP test port :

DNS_Types.ttcn

and TCPasp_PortType.ttcn and TCPasp_Types.ttcn.

Please read the attached documentation carefully.

BR

Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758026 is a reply to message #1758025] Wed, 22 March 2017 19:18 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Also , you are trying to send a type on the port; I believe you should start with the language standard first as without understanding the basics it's unlikely you will get very far.
We have also published some training material.

BR

Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758027 is a reply to message #1758026] Wed, 22 March 2017 19:23 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
I believe you should also go through this forum and download some of the sample projects we have published in the beginning and compile/execute them .
This will help you understand how a Titan project works.

Best regards
Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758029 is a reply to message #1758025] Wed, 22 March 2017 19:49 Go to previous messageGo to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Elemer,

My understanding after reading the userguide was to keep *.cc & *.hh files only for the make file generation. It was my mistake. Now I have copied all the
Testport & Protocol modules src folder files to my project folder.

Also I have fixed now some of the issues related to DNSClient.ttcn. Now make dep shows some other errors. I am trying to understand the Example & Demo to give correct type port definitions in the DNSClient.ttcn.

Please find the latest make archive attached.

Regards,
Ramakrishna

Re: Help Needed on Sample Test Project using TITAN [message #1758030 is a reply to message #1758027] Wed, 22 March 2017 19:54 Go to previous messageGo to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Elemer,

I started reading the core Language Standard, Titan documentation & examples to understand how the Titan Project works. After this only I started creating the Test suite files. I will refer different examples & understand how testports & protocols are used.

Thanks for the support.

Regards,
Ramakrishna
Re: Help Needed on Sample Test Project using TITAN [message #1758032 is a reply to message #1758030] Wed, 22 March 2017 20:14 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Ramakrishna,

I suggest you proceed step by step:

-first compile the TCP ( or UDP ) test port separately
-do the same with the DNS protocol module
-if both compilations are successful, then put them together and compile them together
-lastly , add your own file and try to compile; all errors should refer now to your file; try to find the reason of error

The package you have sent me is still missing files.


BR
Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758035 is a reply to message #1758032] Wed, 22 March 2017 20:38 Go to previous messageGo to next message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Elemer,

Now to start with a demo I have done the following:

https://github.com/eclipse/titan.ProtocolModules.DNS/tree/master/demo

From this demo, I have copied all the necessary src files from:

1. DNS Protocol
2. UDP Testport

Now when I run make dep, it is successfull:

$ make dep
/home/eirmnp/software/titan/bin/compiler -L DNS_Demo.ttcn DNS_Mapping.ttcn DNS_Types.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn - DNS_Demo.ttcn DNS_Mapping.ttcn DNS_Types.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn
Notify: Parsing TTCN-3 module `DNS_Demo.ttcn'...
Notify: Parsing TTCN-3 module `DNS_Mapping.ttcn'...
Notify: Parsing TTCN-3 module `DNS_Types.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_PortType.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_Types.ttcn'...
Notify: Checking modules...
Notify: Generating code...
Notify: File `DNS_Demo.hh' was generated.
Notify: File `DNS_Demo.cc' was generated.
Notify: File `DNS_Mapping.hh' was generated.
Notify: File `DNS_Mapping.cc' was generated.
Notify: File `DNS_Types.hh' was generated.
Notify: File `DNS_Types.cc' was generated.
Notify: File `UDPasp_PortType.hh' was generated.
Notify: File `UDPasp_PortType.cc' was generated.
Notify: File `UDPasp_Types.hh' was generated.
Notify: File `UDPasp_Types.cc' was generated.
Notify: 10 files were updated.
touch compile
Creating dependency file for UDPasp_Types.cc
Creating dependency file for UDPasp_PortType.cc
Creating dependency file for DNS_Types.cc
Creating dependency file for DNS_Mapping.cc
Creating dependency file for DNS_Demo.cc
Creating dependency file for UDPasp_PT.cc
Creating dependency file for DNS_EncDec.cc
make: Nothing to be done for 'dep'.

Now I modified the Make file TTCN3_LIB = ttcn3-parallel & ran make:
$ make
/home/eirmnp/software/titan/bin/compiler -L DNS_Demo.ttcn DNS_Mapping.ttcn DNS_Types.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn - DNS_Demo.ttcn DNS_Mapping.ttcn DNS_Types.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn
Notify: Parsing TTCN-3 module `DNS_Demo.ttcn'...
Notify: Parsing TTCN-3 module `DNS_Mapping.ttcn'...
Notify: Parsing TTCN-3 module `DNS_Types.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_PortType.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_Types.ttcn'...
Notify: Checking modules...
Notify: Generating code...
Notify: File `DNS_Demo.hh' was generated.
Notify: File `DNS_Demo.cc' was generated.
Notify: File `DNS_Mapping.hh' was generated.
Notify: File `DNS_Mapping.cc' was generated.
Notify: File `DNS_Types.hh' was generated.
Notify: File `DNS_Types.cc' was generated.
Notify: File `UDPasp_PortType.hh' was generated.
Notify: File `UDPasp_PortType.cc' was generated.
Notify: File `UDPasp_Types.hh' was generated.
Notify: File `UDPasp_Types.cc' was generated.
Notify: 10 files were updated.
touch compile
Creating dependency file for UDPasp_Types.cc
Creating dependency file for UDPasp_PortType.cc
Creating dependency file for DNS_Types.cc
Creating dependency file for DNS_Mapping.cc
Creating dependency file for DNS_Demo.cc
Creating dependency file for UDPasp_PT.cc
Creating dependency file for DNS_EncDec.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o DNS_Demo.o DNS_Demo.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o DNS_Mapping.o DNS_Mapping.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o DNS_Types.o DNS_Types.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o UDPasp_PortType.o UDPasp_PortType.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o UDPasp_Types.o UDPasp_Types.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o DNS_EncDec.o DNS_EncDec.cc
g++ -c -DLINUX -I/home/eirmnp/software/titan/include -Wall -o UDPasp_PT.o UDPasp_PT.cc
if g++ -o DNS_Demo DNS_Demo.o DNS_Mapping.o DNS_Types.o UDPasp_PortType.o UDPasp_Types.o DNS_EncDec.o UDPasp_PT.o \
-L/home/eirmnp/software/titan/lib -lttcn3-parallel \
-L/lib -lcrypto \
-L/home/eirmnp/software/titan/lib -lxml2; \
then : ; else /home/eirmnp/software/titan/bin/titanver DNS_Demo.o DNS_Mapping.o DNS_Types.o UDPasp_PortType.o UDPasp_Types.o DNS_EncDec.o UDPasp_PT.o; exit 1; fi

Now a Executable was created.
But I am not able to understand how to run this:

$ ./DNS_Demo 10.111.47.253 9999
TTCN-3 Host Controller (parallel mode), version CRL 113 200/6 R1A
Connecting to MC failed. MC address: 10.111.47.253:9999 Connection refused

Could you please help. So that once it is run, I will run nslookup from another host. If it is successfull I will start looking into this example along with core language standard to improve my TTCN-3 knowledge.

Thanks in advance.

Regards,
Ramakrishna

[Updated on: Wed, 22 March 2017 20:50]

Report message to a moderator

Re: Help Needed on Sample Test Project using TITAN [message #1758036 is a reply to message #1758035] Wed, 22 March 2017 20:59 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Ramakrishna,

very good;

now you should remove ( comment out )
this line in the cfg file:

#NumHCs := 1


and then execute with

ttcn3_start ./DNS_Demo config.cfg 


BR
Elemer
Re: Help Needed on Sample Test Project using TITAN [message #1758038 is a reply to message #1758036] Wed, 22 March 2017 21:04 Go to previous message
Ramakrishna Kommineni is currently offline Ramakrishna KommineniFriend
Messages: 12
Registered: March 2017
Junior Member
Hi Elemer,

Thank you.
Now I will start working on this project .

Many thanks again for the quick support.

Regards,
Ramakrishna
Previous Topic:Not able to download Titan 6.1.0 binary for 64 bit Ubuntu 16.04
Next Topic: Using Titan as a fuzzing engine part 1
Goto Forum:
  


Current Time: Wed Sep 19 14:25:04 GMT 2018

Powered by FUDForum. Page generated in 0.02672 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top