Commit Graph

29 Commits

Author SHA1 Message Date
Daniel Willmann 5169d6e167 library: Ensure setverdict(fail is followed by mtc.stop
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
2018-07-24 09:50:02 +02:00
Harald Welte e32ad992af *_Emulation.ttcn: Specify destination when replying on procedure ports
procedure ports (like message ports) require us to specify the
destination of a message ("reply") in case it is connected 1:N and not
just 1:1.  This didn't show up as a problem so far, as we typically only
had one component talking to those procedure ports at any given point
in time.

Change-Id: I696ec67080815348bb95e43ecbbf262e533e39a3
2018-06-01 12:00:56 +02:00
Harald Welte 930d0a70e3 bsc: Fix tons of TTCN3 compiler warnings
Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
2018-03-23 12:32:00 +00:00
Harald Welte 96505f0fa0 BSSMAP_Emulation: handle zero-length L3 Info in f_bssap_l3_is_rr()
Change-Id: I5666911d67388347d04724635cf6f56e164a82f8
2018-03-18 22:37:34 +01:00
Daniel Willmann 92f662789d BSSMAP_Emulation: Parameter to skip seq no patching
This is needed to check that duplicated messages will actually be thrown
away by the MSC.

Change-Id: I0a6914067ec8daa8903f0ef0c877f178cfd61659
2018-02-15 10:29:01 +01:00
Harald Welte 7f5825807d BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come active
We don't have a good way to make the BSSMAP code wait for the lower
SIGTRAN layers to be up and running.  To avoid the RESET being
sent before the lower layers are up, introduce a sleep of 1s.

This is ugly, but appears to work for now.  A more proper solution
is more than welcome.

Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
2018-02-14 20:21:26 +01:00
Harald Welte a4ca446034 WIP: Prepare MSC_Tests for ability to emulate two BSCs
Change-Id: Ibe3ae6ed4181c6ba7501f5443b4f22e3c8abeb3e
2018-02-13 08:15:33 +01:00
Harald Welte 49518bf842 BSSMAP: Fix L3 sequence number for ComplL3(Paging Response)
The existing code generating L3 sequence numbers in MO direction
made the assumption that the L3 message inside ComplL3 would always
be MM/CM, and increment the sequence number.

However, in case of a paging response, it is actually RR, which
does *not* have L3 sequence counters.  So we must make the sequence
counter increment dependant on the L3 protocol discriminator.

Change-Id: I25a5dd0c180c9acfa870984c6b122ac0c46383b3
2018-02-11 11:49:47 +01:00
Harald Welte 9dadc522d7 BSSMAP_Emulation: Send proper L3 N(SD) seuence numbers in MO
We have to make sure all mobile originated L3 messages carry
proper sequence numbers

Change-Id: Id8638673ad1a133f46893b2140970ec072022b3a
2018-02-06 13:43:36 +00:00
Harald Welte 473676b879 BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessing fields
This seems not to be required on TITAN 6.3.0 on my laptop, but the
older 6.1.0 on Debian 9 seems to need it.

Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f
2018-01-27 20:38:54 +01:00
Harald Welte 17d2115ab8 BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging
If we're emulating BSC/BTS/MS, then we must be able to dispatch
incoming paging requests based on their IMSI or TMSI to the right
ConnHdlr component.  This introduces a new table to facilitate that
dispatch.

Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b
2018-01-27 12:45:39 +01:00
Harald Welte 71b693365d BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND
If the ConnHdlr initiates an outbound connection, it needs to know
once that connection is established if it wants to send further
data. Transform the N-CONNECT.confirm into a MSC_CONN_PRIM_CONF_IND
and send it to the ConnHdlr.

Make use of it from the MSC_Tests when issuing a Complete L3 Info.

Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef
2018-01-22 03:01:27 +01:00
Harald Welte 0b476066b9 BSSMAP_Emulation: Decode DTAP
It's quite cumbersome if the user of the BSSMAP_Emulation (the ConnHdlr)
will have to manually decode the DTAP in every BSSAP/DTAP message he
receives (and encode on the transmit side).  Let's introduce a new
optional mode in which the DTAP messages are already decoded for
more convenient matching inside the ConnHdlr.

Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81
2018-01-21 19:31:09 +01:00
Harald Welte ca519981aa BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr
Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc
2018-01-21 19:28:26 +01:00
Daniel Willmann d47106b337 BSSMAP_Emulation: Initialize ExpectTable before use
The assignment_fr_* tests now go through to the point where the BSC
sends a CRCX to the mgw.

Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba
2018-01-17 13:12:19 +01:00
Harald Welte 35bb716610 Add comments with short module description on top of each file
Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3
2018-01-03 21:09:29 +01:00
Harald Welte 624f963393 BSC_Tests: Prepare for tests based on {RSL,BSSMAP}_Emulation
The existing tests were implemented directly on top of the BSSMAP
and RSL CodecPorts.  If we loop in the RSL_Emulation and
BSSMAP_Emulation components, we can properly multiplex/demultiplex
multiple MS (radio channels) on both the RSL and the MSC (SCCP
connection) side.

In order to have a single component that handles both the RSL and the
BSSAP side of a given channel/subscriber/call, we introduce the concept
of BSSMAP "Expects", where the test csse can register the L3 INFO that
it sends in the RLL ESTablish INDication on the RSL side, so the BSSMAP
handler cna route the BSC-originated SCCP connection with that L3 INFO
back to the same component.  This is a bit inspired "in spirit" of the
"expect" mechanism of netfilter connection tracking.

Change-Id: I71f777cd4f290422fa68897952b6505875e35f0e
2017-12-17 13:24:35 +01:00
Harald Welte 004f5fbca3 BSSMAP_Emulation: use BSSAP_CodecPort
So far, BSSMAP_Emulation used the SCCPasp_SP_PORT directly, explicitly
calling BSSAP encode/decode functions while processing the primitives.

Let's clean this up and use the BSSAP_CodecPort which has meanwhile
been developed as a dual-faced port that can be stacked between SCCPasp
and the user to avoid any manual encode/decode function calls.

Change-Id: Icded789d18f3469f74e16f552df2c7ac44ac4294
2017-12-17 11:04:32 +01:00
Harald Welte e98bb2e153 BSSMAP: Ignore RSPI for unknown endpoint/CIC 2017-11-29 12:09:48 +01:00
Harald Welte 9ca9eb1648 BSSMAP_Emulation: Set verdict to 'fail' in various lookup error paths 2017-11-25 00:50:43 +01:00
Harald Welte 0a4317a805 ipa: Close SCCP Connection from MSC side; set verdict on BSC side 2017-11-25 00:50:31 +01:00
Harald Welte be620f6da6 ipa: Give all components proper names to aid log interpretation 2017-11-25 00:23:54 +01:00
Harald Welte 66fecd46a8 MSC_ConnectionHandler: Fix E1 timeslots to be monotonically incrementing 2017-11-24 23:54:44 +01:00
Harald Welte 525a9c118d BSSMAP_Emulation: Fix regex for extraction of MGW endpoint number
Don't use perl regex syntax ".*' but simply "*"
2017-11-24 23:40:41 +01:00
Harald Welte 1b2748eb7b BSSMAP_Emulation: CIC extraction must happen on BSC side, not MSC side 2017-11-24 23:40:16 +01:00
Harald Welte c82eef458d ipa: Further progress on the bsc-nat test suite 2017-11-24 20:52:06 +01:00
Harald Welte 5cc4aa2f06 BSSMAP_Emulation: Fix handling of userData
We cannot pass an unbound octetstring record member into a template
argument of a function :/
2017-11-23 18:51:28 +01:00
Harald Welte b3414b2172 ipa: First version that emulates both MSC and BSC up to ASSIGNMENT REQ 2017-11-23 18:23:38 +01:00
Harald Welte 365f4edbd8 IPA/MSC/BSC Emulation: Framework for handling multiple SCCP connections 2017-11-23 00:00:43 +01:00