Project

General

Profile

Titan TTCN3 Notes » History » Version 8

laforge, 09/19/2017 09:44 AM

1 1 laforge
h1. Titan TTCN3 Notes
2
3
Some notes about developing in Titan TTCN3, specifically regarding test cases in the Osmocom universe.
4
5 8 laforge
h1. Building / Using test caes
6
7
h2. Dependencies
8
9
* You'll need recent enough eclipse-titan installed: 6.2.0 is working fine, 5.5.1 is too old.
10
** if you're using Debian packages, you might run into a compile error "The version of GCC does not match the expected version".  If you do, it is suggested you edit @/usr/include/titan/cversion.h@ and comment out the related @#error@ line.
11
* You'll need a checkout/clone of @http://git.osmocom.org/osmo-ttcn3-hacks/@
12
13
h3. Titan Modules required
14
15
The @osmo-ttcn3-hacks@ depend on a variety of other TTCN-3 modules that you have to clone from their respective repositories.  Each test suite contains a @gen_links.sh@ script that will generate symlinks from those cloned repositories to the local directory.  If you look at @gen_links.sh@ you will see which dependencies the respective test suite has (but not their clone URLs, sorry).
16
17
For example, @sysinfo/gen_links.sh@ needs following repositories under @BASEDIR@ directory:
18
<pre>
19
git clone https://github.com/eclipse/titan.TestPorts.IPL4asp.git
20
git clone https://github.com/eclipse/titan.TestPorts.TELNETasp.git
21
git clone https://github.com/eclipse/titan.TestPorts.Common_Components.Socket-API.git
22
git clone https://github.com/eclipse/titan.Libraries.TCCUsefulFunctions.git
23
</pre>
24
25
See http://git.osmocom.org/docker-playground/tree/debian-stretch-titan/Dockerfile for a full list of dependencies
26
27
28
h2. Test run
29
30
For example, to run sysinfo tests do the following:
31
* adjust BASEDIR in sysinfo/gen_links.sh to match your environment
32
* adjust test configuration in sysinfo/Test.cfg if necessary
33
<pre>
34
cd sysinfo
35
./gen_links.sh
36
./regen_makefile.sh
37
make -j1 compile && make -j8
38
cd ..
39
./start-testsuite.sh sysinfo/Test sysinfo/Test.cfg
40
</pre>
41
42
See also See https://git.osmocom.org/docker-playground/tree/ttcn3-nitb-sysinfo/
43
44
h3. Log files
45
46
you will receive log files in the current working directory.  You can use the @ttcn3_logmerge@ tool to merge multiple log files based on their timestamps, and you can use the @ttcn3_logformat@ tool to do some human-friendly formatting of the log files.  Harald often runs his test suite like:
47
<pre>
48
rm *.log && make -j1 compile && make -j8 && ../start-testsuite.sh MGCP_Test MGCP_Test.cfg && ttcn3_logformat *.log
49
</pre>
50
51
h1. Development related bits
52
53 1 laforge
h2. RAW coder
54 3 msuraev
55
A lot of the messages (GSMTAP, LAPDm, L1CTL, ...) are described using the Titan extensions to the TTCN-3 type language and the associated RAW coder.
56
57 5 msuraev
Section 4.23 of the _Programmer's Technical Reference Guide for the TITAN TTCN-3 Toolset_ contains the description of this RAW coder
58
59 3 msuraev
h3. FIELDORDER
60
61
This determines the order of fields within a record or set type.
62
63
In (not only) GSM specs, typically the messages are described from first field at top to the last field at the bottom, so the logical choice here is to set "FIELDORDER(msb)" as we do in the GMS_Types.ttcn and other files.  However, there's one CAVEAT: In GSM 04.08 (and derived specs), Information Elements with 1/2 (4bit) length are ordered un-intitively.
64
65 1 laforge
Example: TS 44.018 SYSTEM INFORMATION TYPE 4:
66 4 laforge
67
 * L1 Pseudl Length (1)
68 6 msuraev
 * protocol descriptor (1/2)
69
 * skip indicator (1/2)
70
 * Message Type (1)
71
72
which then translates to:
73
74
<pre>
75
        type record RrHeader {
76
                L2PseudoLength  l2_plen,
77
                uint4_t         skip_indicator,
78
                uint4_t         rr_protocol_discriminator,
79
                RrMessageType   message_type
80
        } with { variant "FIELDORDER(msb)" };
81
</pre>
82 7 msuraev
83
Note the skip_indicator and rr_protocol_discriminator fields are swapped in their order compared to the spec!
Add picture from clipboard (Maximum size: 48.8 MB)