1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
Osmocom TTCN-3 Test Suites
==========================
:author: Harald Welte <laforge@gnumonks.org>
:copyright: 2018 by Harald Welte (License: CC-BY-SA)
:backend: slidy
:max-width: 45em
== Osmocom TTCN-3 Test Suites
* developed in 2017+2018
* compiled using Eclipse TITAN
** uses just a command-line compiler + Makefiles
** no IDE needed at all, don't let _Eclipse_ fool you
* containerized in Docker
* executed by Jenkins CI
== Terminology
ATS:: Abstract Test Suite
MTC:: Main Test Component
PTC:: Parallel Test Component
IUT:: Implementation Under Test
== Test Suite Philosophy
* test one network element (our IUT)
* test external behavior (3GPP and non-3GPP)
* emulate entire environment from TTCN-3
* don't reuse Osmocom C-code protocol implementations in the tests
* test against independent TTCN-3 implementations!
== What to test?
* successful cases
* erroneous cases (no answer, NACK, ...)
** many difficult to reproduce with real phones/devices
* load / resource exhaustion
* spec compliance
* focus on functionality actually relevant to IUT
== Why TTCN-3 + TITAN
* TTCN-3 specifically designed for telecom protocol testing
* TITAN team released many telecom protocols in TTCN-3, such as
** BSSAP, L3 (RR/MM/CC), SMS (CP/RP/TP), SS, M3UA, SCCP, GTP, NS, BSSGP, ...
** shortens our test development cycle
** permits us to test against known working industry implementations
== Test suites for Osmocom CNI components
* `osmo-bts`
* `osmo-bsc`
* `osmo-msc`
* `osmo-mgw`
* `osmo-hlr`
* `osmo-sip-connector`
* `osmo-sgsn`
* `osmo-ggsn`
== Test suites in progress
* `osmo-pcu`
* `osmo-bsc_nat`
== BTS_Tests.ttcn
* external interfaces
** A-bis side: RSL (emulates BSC-side server)
** Um side: L1CTL to control MS
** PCU side: pcu_socket
[graphviz]
----
digraph G {
rankdir=LR;
{ rank=same; BTS, BSC};
BTS [label="IUT\nosmo-bts-trx",shape="box"];
ATS [label="ATS\nBTS_Tests.ttcn"];
BSC [label="osmo-bsc\nOML only"];
BTS -> fake_trx [label="bursts"];
fake_trx -> trxcon [label="bursts"];
trxcon -> ATS [label="bursts"];
BTS -> BSC [label="A-bis OML"];
BTS -> ATS [label="A-bis RSL"];
ATS -> BTS [label="pcu_sock"];
ATS -> BSC [label="VTY"];
ATS -> BTS [label="CTRL"];
}
----
== BSC_Tests.ttcn
* external interfaces
** A-bis side: RSL (emulates BTS-side client)
** A-side: BSSAP/SCCP/M3UA (emulates MSC-side)
** MGW side: MGCP (emulates MGW side)
[graphviz]
----
digraph G {
rankdir=LR;
{ rank=same; BTS; STP; };
BSC [label="IUT\nosmo-bsc",shape="box"];
ATS [label="ATS\nBSC_Tests.ttcn"];
BTS [label="osmo-bts-omldummy\nOML only"];
BTS -> BSC [label="A-bis OML"];
ATS -> BSC [label="A-bis RSL"];
ATS -> BSC [label="CTRL"];
ATS -> BSC [label="VTY"];
ATS -> STP [label="A BSSAP\nSCCP/M3UA"];
BSC -> STP [label="A BSSAP\nSCCP/M3UA"];
}
----
== MSC_Tests.ttcn
* external interfaces
** A: BSSAP/SCCP/M3UA (emulates BSC-side)
** MNCC: MNCC/unix-domain (emulates ext. MNCC side)
** MGW: MGCP (emulates MGW side)
** GSUP (impllements HLR side)
[graphviz]
----
digraph G {
rankdir=LR;
MSC [label="IUT\nosmo-msc",shape="box"];
ATS [label="ATS\nMSC_Tests.ttcn"];
ATS -> MSC [label="MNCC"];
ATS -> MSC [label="SMPP",style="dashed"];
ATS -> MSC [label="CTRL"];
ATS -> MSC [label="VTY"];
MSC -> ATS [label="GSUP"];
ATS -> STP [label="A BSSAP\nSCCP/M3UA"];
MSC -> STP [label="A BSSAP\nSCCP/M3UA"];
}
----
== MGCP_Test.ttcn
* external interfaces
** MGCP (emulates call agent)
** RTP (stream source/sink)
[graphviz]
----
digraph G {
rankdir=LR;
MGW [label="IUT\nosmo-mgw",shape="box"];
ATS [label="ATS\nMGCP_Test.ttcn"];
ATS -> MGW [label="RTP"];
ATS -> MGW [label="MGCP"];
MGW -> ATS [label="RTP"];
}
----
== HLR_Tests.ttcn
* external interfaces
** GSUP (emulates VLR/SGSN side)
** VTY
[graphviz]
----
digraph G {
rankdir=LR;
HLR [label="IUT\nosmo-hlr",shape="box"];
ATS [label="ATS\nHLR_Tests.ttcn"];
ATS -> HLR [label="GSUP"];
ATS -> HLR [label="VTY"];
}
----
== SIP_Tests.ttcn
* external interfaces
** MNCC (emulates MSC side)
** SIP (emulates SIP switch)
** VTY
[graphviz]
----
digraph G {
rankdir=LR;
SIP [label="SIP\nosmo-sip-connector",shape="box"];
ATS [label="ATS\nSIP_Tests.ttcn"];
ATS -> SIP [label="MNCC"];
ATS -> SIP [label="SIP"];
ATS -> SIP [label="VTY"];
}
----
== SGSN_Tests.ttcn
* external interfaces
** Gb (emulates PCU side NS/BSSGP + MS)
** GSUP (emulates HLR)
** VTY
[graphviz]
----
digraph G {
rankdir=LR;
SGSN [label="SGSN\nosmo-sgsn",shape="box"];
ATS [label="ATS\nSGSN_Tests.ttcn"];
ATS -> SGSN [label="Gb"];
SGSN-> ATS [label="Gp (GTP)"];
ATS -> SGSN [label="VTY"];
}
----
== GGSN_Tests.ttcn
* external interfaces
** Gp: GTP (emulates SGSN)
** Gi: IP (emulates Internet)
[graphviz]
----
digraph G {
rankdir=LR;
GGSN [label="GGSN\nosmo-ggsn",shape="box"];
ATS [label="ATS\nGGSN_Tests.ttcn"];
ATS -> GGSN [label="Gp (GTP)"];
GGSN -> ATS [label="Gi (IP)"];
ATS -> GGSN [label="VTY"];
}
----
== Dockerized Setup
* one process per container
* packages either
** IUT (e.g. `osmo-bsc`)
** ATS (compiled docker test suite)
** other utility (e.g. `trxcon` or `osmo-bts-omldummy`)
* why?
** no need for local ip/network configuration
** standardized / packaged setup on every machine
** run older/newer versions of ATS against older/newer IUT
== Jenkins CI Execution
. update `docker-playground.git`
.. contains `Dockerfile` for ATS + IUT
. rebuild IUT container[s] (e.g. `osmo-bts-master`)
.. git magic ensures re-build only if `osmo-bts.git` master changed
. rebuild ATS container (e.g. `ttcn3-bts-test`)
.. git magic ensures re-build only if `osmo-ttcn3-hacks.git` master changed
. run `docker-playground/ttcn3-bts-test/jenkins.sh`
.. creates docker network
.. starts IUT + ATS docker containers
.. collects test results
== Jenkins CI Reporting
* junit-xml generation
* store artefacts
** pcap file of every test case
** ATS log file (TTCN-3 testsuite)
** IUT log file[s] (`osmo-*.log`)
** IUT config file[s] (`osmo-*.cfg`)
* see https://jenkins.osmocom.org/jenkins/view/TTCN3/
== Further Reading
* http://git.osmocom.org/osmo-ttcn3-hacks/
* http://git.osmocom.org/docker-playground/
* http://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Notes
== EOF
End of File
|