Commit Graph

35 Commits

Author SHA1 Message Date
Pau Espin 1158cc629c Move SDP templates to its own SDP_Templates.ttcn file
SDP is used in other protocols than MGCP, eg. SIP.

Change-Id: I0610b4cf5533e46a3401c65e60c7cce975c85412
2024-03-22 11:28:51 +01:00
Alexander Couzens 89b4eff243 BSC_Tests: add OML tests for bts_setup_ramp
The current BSC_Tests are using osmo-bts-omldummy to keep OML out of the test context.
Add a new test file and component for OML tests.

Change-Id: I0934ea26db359b0a6649c613f01de134a3a372ee
2023-02-10 11:46:51 +00:00
Harald Welte 47cd0e3350 bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.

In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.

Change-Id: Id41246f0dd812f7ddee9d920bfd07a4e3aac3504
2020-10-13 08:43:10 +00:00
Harald Welte 8cb5825ffc Revert "bsc: Add Lb interface support"
This reverts commit c47fdb2e52 - as
osmo-bsc currently doesn't yet have a Lb interface, we shouldn't try
to test it yet.

Change-Id: I7898dd336cbef27553d97857ac22f1a539da1380
2020-08-31 16:50:43 +02:00
Harald Welte c47fdb2e52 bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.

In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.

Change-Id: I854618cc08de1a716784f52542a4df3c7f7ad900
2020-08-30 16:07:00 +00:00
Daniel Willmann ebdecc0309 bsc: Add statsd checker and use it in TC_assignment_sign
Related: SYS#4877
Change-Id: I8526b645dc4af59adcc1855699421a026f505c1d
2020-08-13 15:02:15 +00:00
Neels Hofmeyr 5e686dce2d bsc: add first test to verify System Information on RSL startup
Change-Id: I6a8ef404087efee491390dc1d2452ac323f145f0
2020-07-09 00:25:47 +02:00
Pau Espin e8d7d16f13 Split templates in RLCMAC_{CSN1_}Types into their own _Templates file
RLCMAC blocks have a lot of fields and we will potentially require lots
of different templates, as well as functions to handle related structs.

Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545
2020-04-29 19:07:38 +02:00
Harald Welte 09538f8bfd bsc: Test suite for CBSP (Cell Broadcast Service Protocol)
In this testsuite, we simulate BTS and CBC by attaching to RSL and CBSP
protocol interfaces of the BSC.  We then issue a variety of CBSP
commands to the BSC and check for corresponding action on both the BTS-
facing RSL as well as responses on the CBSP side.

Change-Id: Ia6ffac181f50586d06d2f29bca1c57285179e861
2019-09-05 13:13:35 +02:00
Pau Espin fe0c6083bd Depend on our own fork of titan.ProtocolModules.BSSMAP
Since we use some BSSMAP extensions to signal Osmux, we need to maintain
our own fork of BSSMAP_Types in order to supports those IEs in BSSMAP
RESET and BSSMAP Assin Req/Compl. Hence, switch all build componenets to
fetch and use our fork.

Depends: titan.ProtocolModules.BSSMAP Iaf1e137269c0da20b2c96fd104b57edf336693af
Change-Id: Ic8debe5f3ffe8e1d4258fa6b4632a3871b99af40
2019-05-21 10:28:53 +00:00
Harald Welte 2fce7887f4 RAN_Emulation: Modularize protocol support
The RAN_Emulation currently unconditionally provides BSSAP and MGCP support.
Let's re-structure the code so that support for those protocols is now
possible to enable/disable at compile time.

This patch is in preparation of introducing RANAP support in RAN_Emulation.

Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd
Related: OS#2856
2019-04-25 20:07:11 +00:00
Harald Welte 6811d10af7 Rename BSSMAP_Emulation -> RAN_Emulation
So far, BSSMAP_Emulation supported only a transport over BSSMAP.
However, we soon intend to merge support for RANAP in order to
simulate RANAP/Iu connections as well as BSSMAP.  Let's start
by renaming some of the existing types/functions/ports/modules
without introducing any functional changes just yet.

Related: OS#2857, OS#2856
Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d
2019-04-21 17:44:59 +02:00
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +02:00
Stefan Sperling 0796a82c86 Add a TTCN3 module for IPA protocol testing
This new module allows us to test IPA code in libosmocore
and libosmo-netif. Currently only one test is implemented,
which sends a chopped IPA ping message and expects to receive
an IPA pong.

The system under test is any IPA speaker on any TCP port.
Any test suite may call parametrized functions to create
an IPA testing component and run a particular test.
So far, one such test has been added to the BSC_Tests suite.

Change-Id: I246a405414e36a44dc1e308692faab8bf04da0e6
Related: OS#2010
2018-10-08 17:56:36 +02:00
Stefan Sperling c307e689b4 introduce a TTCN3 test suite for SCCP
This test suite acts as an SCCP server on top of M3UA.

SCCP tests are run against the sccp_demo_user program which
can be found in libosmo-sccp/examples. This program must be
started in client mode: sccp_demo_user -c
The SCCP test suite should then work out of the box with
the provided SCCP_Tests.cfg file and this additional change
to sccp_demo_user default point codes:
https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/

There is currently only one test, for the libosmo-sccp crash
reported as issue OS#2666. The implementation of this test
is currently using an ugly workaround due to shortcomings of
the M3UA Emulation layer (see source code comments). Whether
a better solution is feasible is still to be determined.

The test requires a patch to the SCCP Protocol Emulation which
has been submitted upstream: https://git.eclipse.org/r/#/c/124552/

Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8
Related: OS#2666
2018-07-24 19:05:10 +00:00
Harald Welte c87abfcb60 Remove M3UA/MTP3/SCCP code from this repo, use upstream repos
Originally, this code was not yet in an official upstream git repo.
However, it has been for many months, so let's remove our local copy
and use upstream git repositories like for all the other modules.

Change-Id: I2c616fb865df32cfec323d42e5d0d06de40c497b
2018-03-18 12:52:20 +01:00
Neels Hofmeyr cd11223c0f ignore results of .ttcnpp files
Add another macro ignore_pp_results to gen_links.sh.inc and call from all
gen_links.sh files, to add results of *.ttcnpp files, i.e. generated *.ttcn
files, to .gitignore.

Change-Id: Ic7fb176226771212d7700dafaf27ac71f12a4a61
2018-03-16 18:25:58 +01:00
Neels Hofmeyr 53fb0cf22b gen_links.sh: auto-generate .gitignore files to ignore symlinks
In each subdir that is a target for symlinks, automatically ignore the results
of gen_links():

- At the top of gen_links.sh.inc, clear the .gitignore.
- In the loop, add each link name to the local .gitignore.
- In selected gen_links.sh, there is also a "manual" link creationg. So that
  this also ends up in the local .gitignore, have the link creation as separate
  gen_link() macro which at the same time adds to ./.gitignore.
- in the root .gitignore, ignore all the subdirs' generated */.gitignore files.

Change-Id: I73c11fe8362358bf7e1bdf0e1be53399b5d3351b
2018-03-16 00:08:08 +01:00
Neels Hofmeyr 1a4c4601d7 fix gen_links.sh: don't include source dir as link target
First of all, use one common place to define the gen_links() macro, in
gen_links.sh.inc.

In this new file, add a 'shift' to exclude the $DIR arg from also appearing in
$FILES.

This prevents the following wrong symlinks in the source dirs:

  M3UA_CNL113537/src/src
  MTP3asp_CNL113337/src/src
  SCCP_CNL113341/src/src

Change-Id: Ia8493e77df1ba8723f2c5d2a49816247b0fb55f7
2018-03-16 00:08:02 +01:00
Harald Welte df277258f1 IPA_Emulation: Make dependencies to RSL/MGCP/SCCP/GSUP conditional
Let's use the preprocessor to avoid IPA_Emulation pulling *all*
dependencies into each and any of our projects.  The code readability
suffers a bit from the many #ifdefs, but compilation speed increases
if we don't have to pull in all those (recursive) dependencies.

After all, a BTS test case will never need SCCP, GSUP or MGCP.

Change-Id: Ic0231adbd2171214de133d26b3fbf36130ee8aa0
2018-02-20 16:17:17 +01:00
Harald Welte bc03c7693f bsc: Add VTY module to BSC_Tests
Change-Id: Ia78f1231f56fc5f3b003bccc850ea109ed4ed2d8
2018-02-13 08:15:33 +01:00
Max 6367d7b807 Don't symlink non-existent file
Change-Id: I10309f07fb207c027703f0b43a478c152a029b6d
2018-02-05 16:58:27 +01:00
Harald Welte 211219ee1a bsc: Implement Assignment handling
This adds code for the rather intricated and nested transactions
happening on RSL, BSSAP, MGCP and RSL-IPA.  We use explicit
invocation of altsteps to simplify the main function f_establish_fully.

Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b
2018-01-29 22:35:41 +01:00
Daniel Willmann 3826a1bd1d BSC_Tests: Add MGCP_Emulation to gen_links
Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01
2018-01-29 21:35:12 +00:00
Harald Welte 0cf76ad9f7 Move BSSAP_Adapter.ttcn to library so it can be reused
Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42
2018-01-21 19:31:09 +01:00
Harald Welte ffe55fcc83 bsc test: Abstract out CTRL handling so it can be re-used from MSC test
We create a new Osmocom_CTRL_Adapter module which can be used by
test suites using the 'extends' functionality.

Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb
2018-01-21 19:31:09 +01:00
Harald Welte df32723446 GSUP Support and first test against OsmoHLR
Change-Id: Idd7a6aca1ab193da39294f49a3adc4c1cd7cecff
2017-12-28 23:17:24 +01:00
Harald Welte 8098164721 RTP_Emulation: Integrate IuUP support
Change-Id: I46de7fb9c324654275a27aa5f8c1be70340e3229
2017-12-25 00:03:07 +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 6807982106 Makefile: clone dependencies into 'deps' folder
We used to rely on out-of-tree git clones to be prepared by the user.

This commit changes the system to make sure we clone all git repos
we depend upon into the 'deps' folder, and then setup the symlinks
to that folder.  As a result, we should be able to support
self-contained builds using the makefiles in this repo.
2017-12-12 16:30:53 +01:00
Harald Welte 96c94410c1 BSC_Tests: Add CTRL interface connection 2017-12-09 03:13:36 +01:00
Harald Welte a76c4bb7b9 Extend IPA_Emulation with support for CTRL 2017-12-09 02:06:07 +01:00
Harald Welte ae02669508 BSC_Tests: Start with much simpler tests at BSSAP / SCCP level
Rather than using the more complex RSL Emulation and BSSAP emulation
components, we attach to the RSL and BSSAP Codec Ports and send some
messages back and forth for low-level testing such as timeouts, response
to RACH requests, failure of MSC to react to CR requests, etc.
2017-12-09 01:03:01 +01:00
Harald Welte 696ddb6de3 bsc-tests: Add BTS_Simulation, RSL_Tests and .cfg file 2017-12-08 14:01:43 +01:00
Harald Welte 28d943ef35 ts_BSSMAP_HandoReq: Hand in raw list as argument, not IE type
Also, add new ts_BSSMAP_Paging() template.
2017-11-25 15:01:16 +01:00