Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Handling of version information in Titan
Handling of version information in Titan [message #1760428] Thu, 27 April 2017 06:21
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 760
Registered: January 2015
Senior Member
Dear all,

some practical information regarding versioning of Titan binaries and TTCN-3 source files etc. follows.

The version of Titan binary can be obtained with:

compiler -v
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Product number: CRL 113 200/6 R1A
Build date: Feb 14 2017 06:18:59
Compiled with: GCC 5.4.0
Using OpenSSL 1.1.0d  26 Jan 2017

Copyright (c) 2000-2017 Ericsson Telecom AB



This also displays the gcc and openssl version which has been used when building Titan;
this is important as the same gcc and openssl versions will have to be used when building with Titan.


Every binary built with Titan can be run with the -v switch;this will display a lot of useful information about the components used.

(For demonstration purposes I have used the code published in a previous post
Example of SNMP over UDP
https://www.eclipse.org/forums/index.php/t/1068184/ )


For instance:

./SNMP -v
TTCN-3 Host Controller (parallel mode)
Product number: CRL 113 200/6 R1A
Build date (Base Library): Feb 14 2017 06:25:05
Base Library was compiled with: GCC 5.4.0

Copyright (c) 2000-2017 Ericsson Telecom AB

Module information:
Module name       Language  Compilation time   MD5 checksum                     Version
---------------------------------------------------------------------------------------
PreGenRecordOf     TTCN-3 Feb 14 2017 06:23:15 02ac6b4a4325302f71d8860c0c9d46cc 
SNMP_Functions     TTCN-3 Apr 24 2017 02:38:47 013b36411d0b2a8be4cc09b36163f215 
SNMP_Test          TTCN-3 Apr 24 2017 02:38:48 1548acfb48f0448db04a88f0cbecead1 
SNMP_Test2         TTCN-3 Apr 24 2017 02:38:47 ebe1629f910a416b75c335dad1e793e0 
SNMP_UDP_Definitions TTCN-3 Apr 24 2017 02:38:48 1dcfbf3ae1bcbd074a999616b4c6302f 
SNMP_oi            C++    Apr 24 2017 02:38:57 
SNMPmsg-Types      ASN.1  Apr 24 2017 02:38:50 
SNMPv3USM          C++    Apr 24 2017 02:38:58 
TitanLoggerApi     TTCN-3 Feb 14 2017 06:20:53 430a99a18c8ce1845d2fd38ca6fc0bf1 
UDPasp_PortType    TTCN-3 Apr 24 2017 02:38:49 5cc38e35ac8a42f6982d1d6f8e945323 
UDPasp_Types       TTCN-3 Apr 24 2017 02:38:49 bc95949889dfd021e0ab2f034d8d930a 
---------------------------------------------------------------------------------------

You can see that all participating modules ( TTCN-3 , ASN.1 or C++ files) are displayed together with a checksum, version information etc.


This version information can be added at the end of each module in an extension as below:

module SNMP_Test
{
:
}


with {
extension "version  BBB 123 200/1 R9A11";
}

If we add the info and recompile, this will appear in the printout:

./SNMP -v
TTCN-3 Host Controller (parallel mode)
Product number: CRL 113 200/6 R1A
Build date (Base Library): Feb 14 2017 06:25:05
Base Library was compiled with: GCC 5.4.0

Copyright (c) 2000-2017 Ericsson Telecom AB

Module information:
Module name       Language  Compilation time   MD5 checksum                     Version
---------------------------------------------------------------------------------------
PreGenRecordOf     TTCN-3 Feb 14 2017 06:23:15 02ac6b4a4325302f71d8860c0c9d46cc 
SNMP_Functions     TTCN-3 Apr 24 2017 02:38:47 013b36411d0b2a8be4cc09b36163f215 
SNMP_Test          TTCN-3 Apr 24 2017 02:41:23 4118ad51e24c89af7895c71eaf6fb7d6 BBB 123 200/1 R9A11  
SNMP_Test2         TTCN-3 Apr 24 2017 02:38:47 ebe1629f910a416b75c335dad1e793e0 
SNMP_UDP_Definitions TTCN-3 Apr 24 2017 02:38:48 1dcfbf3ae1bcbd074a999616b4c6302f 
SNMP_oi            C++    Apr 24 2017 02:38:57 
SNMPmsg-Types      ASN.1  Apr 24 2017 02:38:50 
SNMPv3USM          C++    Apr 24 2017 02:38:58 
TitanLoggerApi     TTCN-3 Feb 14 2017 06:20:53 430a99a18c8ce1845d2fd38ca6fc0bf1 
UDPasp_PortType    TTCN-3 Apr 24 2017 02:38:49 5cc38e35ac8a42f6982d1d6f8e945323 
UDPasp_Types       TTCN-3 Apr 24 2017 02:38:49 bc95949889dfd021e0ab2f034d8d930a 
---------------------------------------------------------------------------------------


A short form revision can also be used:
module SNMP_Test
{
:
}


with {
extension "version  R9A11";
}


./SNMP -v
TTCN-3 Host Controller (parallel mode)
Product number: CRL 113 200/6 R1A
Build date (Base Library): Feb 14 2017 06:25:05
Base Library was compiled with: GCC 5.4.0

Copyright (c) 2000-2017 Ericsson Telecom AB

Module information:
Module name       Language  Compilation time   MD5 checksum                     Version
---------------------------------------------------------------------------------------
PreGenRecordOf     TTCN-3 Feb 14 2017 06:23:15 02ac6b4a4325302f71d8860c0c9d46cc 
SNMP_Functions     TTCN-3 Apr 24 2017 02:38:47 013b36411d0b2a8be4cc09b36163f215 
SNMP_Test          TTCN-3 Apr 24 2017 02:42:38 5706abc4e0a10401726eb777b0a9faf2  R9A11  
SNMP_Test2         TTCN-3 Apr 24 2017 02:38:47 ebe1629f910a416b75c335dad1e793e0 
SNMP_UDP_Definitions TTCN-3 Apr 24 2017 02:38:48 1dcfbf3ae1bcbd074a999616b4c6302f 
SNMP_oi            C++    Apr 24 2017 02:38:57 
SNMPmsg-Types      ASN.1  Apr 24 2017 02:38:50 
SNMPv3USM          C++    Apr 24 2017 02:38:58 
TitanLoggerApi     TTCN-3 Feb 14 2017 06:20:53 430a99a18c8ce1845d2fd38ca6fc0bf1 
UDPasp_PortType    TTCN-3 Apr 24 2017 02:38:49 5cc38e35ac8a42f6982d1d6f8e945323 
UDPasp_Types       TTCN-3 Apr 24 2017 02:38:49 bc95949889dfd021e0ab2f034d8d930a 
---------------------------------------------------------------------------------------





It may happen that a certain module will require a specific Titan version.
This can be identified by the following extension:

module SNMP_Test
{
:
}


with {
extension "version R9A11";
extension "requiresTITAN CRL 113 200/6 R2A";
}


If we attempt to build, this will be rejected as the latest available Titan at this moment is 6 R1A:
make
/home/ntaf/Titan/bin/compiler -L   SNMP_Functions.ttcn SNMP_Test2.ttcn SNMP_Test.ttcn SNMP_UDP_Definitions.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn SNMPmsg_Types.asn - SNMP_Test.ttcn
Notify: Parsing TTCN-3 module `SNMP_Functions.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test2.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_UDP_Definitions.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_PortType.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_Types.ttcn'...
Notify: Parsing ASN.1 module `SNMPmsg_Types.asn'...
SNMPmsg_Types.asn:56: warning: Using of UNIVERSAL tagclass is not recommended.
Notify: Checking modules...
SNMP_Test.ttcn: In TTCN-3 module `SNMP_Test':
 SNMP_Test.ttcn:324.12-42: error: This module needs to be compiled with TITAN version CRL 113 200/6 R2A or higher; version CRL 113 200/6 R1A detected
Notify: Error found in the input modules. Code will not be generated.
make: *** No rule to make target 'compile', needed by 'SNMP_Functions.hh'.  Stop.


Specifying 6 R1A will result in an error-free compilation.

module SNMP_Test
{
:
}


with {
extension "version R9A11";
extension "requiresTITAN CRL 113 200/6 R1A";
}


Also, an imported module may be required to be at a specific version:

module SNMP_Test
{
:
}

with {
extension "version BBB 123 200/1 R9A11";
extension "requiresTITAN CRL 113 200/6 R1A";
extension "requires SNMP_Functions AAA 123 200/1 R9A11";
}


If we don't set any version extension for SNMP_Functions , the following happens:

make
/home/ntaf/Titan/bin/compiler -L   SNMP_Functions.ttcn SNMP_Test2.ttcn SNMP_Test.ttcn SNMP_UDP_Definitions.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn SNMPmsg_Types.asn - SNMP_Test.ttcn SNMP_UDP_Definitions.ttcn
Notify: Parsing TTCN-3 module `SNMP_Functions.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test2.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_UDP_Definitions.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_PortType.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_Types.ttcn'...
Notify: Parsing ASN.1 module `SNMPmsg_Types.asn'...
SNMPmsg_Types.asn:56: warning: Using of UNIVERSAL tagclass is not recommended.
Notify: Checking modules...
SNMP_Test.ttcn: In TTCN-3 module `SNMP_Test':
 SNMP_Test.ttcn:325.12-54: error: Module 'SNMP_Test' requires module 'SNMP_Functions' of product AAA 123 200, but it is not specified
Notify: Error found in the input modules. Code will not be generated.
make: *** No rule to make target 'compile', needed by 'SNMP_Functions.hh'.  Stop.



If we set a version that differs from the required one:


module SNMP_Functions
{
:
}

}
with {
extension "version AAA 123 200/1 R8A8";


}

make
/home/ntaf/Titan/bin/compiler -L   SNMP_Functions.ttcn SNMP_Test2.ttcn SNMP_Test.ttcn SNMP_UDP_Definitions.ttcn UDPasp_PortType.ttcn UDPasp_Types.ttcn SNMPmsg_Types.asn - SNMP_Functions.ttcn SNMP_Test.ttcn SNMP_UDP_Definitions.ttcn
Notify: Parsing TTCN-3 module `SNMP_Functions.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test2.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_Test.ttcn'...
Notify: Parsing TTCN-3 module `SNMP_UDP_Definitions.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_PortType.ttcn'...
Notify: Parsing TTCN-3 module `UDPasp_Types.ttcn'...
Notify: Parsing ASN.1 module `SNMPmsg_Types.asn'...
SNMPmsg_Types.asn:56: warning: Using of UNIVERSAL tagclass is not recommended.
Notify: Checking modules...
SNMP_Test.ttcn: In TTCN-3 module `SNMP_Test':
 SNMP_Test.ttcn:325.12-54: error: Module 'SNMP_Test' requires version R9A11 of module 'SNMP_Functions', but only R8A08 is available
Notify: Error found in the input modules. Code will not be generated.
make: *** No rule to make target 'compile', needed by 'SNMP_Functions.hh'.  Stop.


Finally , if we set the desired version:

module SNMP_Functions
{
:
}

}
with {
extension "version AAA 123 200/1 R9A11";
}


compilation will be executed, and the created binary displays the used versions:
./SNMP -v
TTCN-3 Host Controller (parallel mode)
Product number: CRL 113 200/6 R1A
Build date (Base Library): Feb 14 2017 06:25:05
Base Library was compiled with: GCC 5.4.0

Copyright (c) 2000-2017 Ericsson Telecom AB

Module information:
Module name       Language  Compilation time   MD5 checksum                     Version
---------------------------------------------------------------------------------------
PreGenRecordOf     TTCN-3 Feb 14 2017 06:23:15 02ac6b4a4325302f71d8860c0c9d46cc 
SNMP_Functions     TTCN-3 Apr 24 2017 02:51:51 bccdb2f2a46a5cf93b1eb8bf852f774b AAA 123 200/1 R9A11  
SNMP_Test          TTCN-3 Apr 24 2017 02:51:52 eab425d92fd4bbfebb45887e31000074 BBB 123 200/1 R9A11  
SNMP_Test2         TTCN-3 Apr 24 2017 02:38:47 ebe1629f910a416b75c335dad1e793e0 
SNMP_UDP_Definitions TTCN-3 Apr 24 2017 02:38:48 1dcfbf3ae1bcbd074a999616b4c6302f 
SNMP_oi            C++    Apr 24 2017 02:38:57 
SNMPmsg-Types      ASN.1  Apr 24 2017 02:38:50 
SNMPv3USM          C++    Apr 24 2017 02:38:58 
TitanLoggerApi     TTCN-3 Feb 14 2017 06:20:53 430a99a18c8ce1845d2fd38ca6fc0bf1 
UDPasp_PortType    TTCN-3 Apr 24 2017 02:38:49 5cc38e35ac8a42f6982d1d6f8e945323 
UDPasp_Types       TTCN-3 Apr 24 2017 02:38:49 bc95949889dfd021e0ab2f034d8d930a 
---------------------------------------------------------------------------------------





Note1: TitanLoggerApi.ttcn and PreGenRecordOf.ttcn are internal TTCN-3 modules.


I hope you'll find this useful.

You can find more detailed info in the reference guide:

4.27.1 Version Information in TTCN-3 Files
4.27.1.2 Required TITAN Version
4.27.1.3 Specifying the Version of a TTCN-3 Module
4.27.1.4 Required Version of an Imported Module



Best regards
Elemer
Previous Topic:Eclipse Titan on Windows10/WSL part 2
Next Topic:Wrong syntax/ Problem with syntax Checker
Goto Forum:
  


Current Time: Sat Jun 23 22:09:00 GMT 2018

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

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

Back to the top