Commit Graph

54 Commits

Author SHA1 Message Date
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Vadim Yanitskiy 1491c64114 bsc-nat: add 'Native_FunctionDefs.cc' to regen_makefile.sh
Some modules from library depend on these native functions.
Without them the compilation fails during linkage:

  Native_Functions.so: undefined reference to `Native__Functions::f__str__tolower(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__hntoa(OCTETSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__haddr(CHARSTRING const&)'
  BSSMAP_Templates.so: undefined reference to `Native__Functions::f__inet6__addr(CHARSTRING const&)'
  BSSMAP_Templates.so: undefined reference to `Native__Functions::f__inet__addr(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__str__toupper(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__ntoa(OCTETSTRING const&)'
  collect2: error: ld returned 1 exit status
  make[1]: *** [BSCNAT_Tests] Error 1

Change-Id: I81227db58850375f0ce48e5c6e013381291a5904
2021-02-27 17:21:07 +01:00
Pau Espin 9a5b8ffc5b CTRL: Introduce support to run osmocom CTRL server
Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
2021-01-07 15:06:39 +01:00
Pau Espin 6a846bca2c library: Add template helpers for AoIP Transport Layer Address
This way one can simply pass an IP addr in string format and return the
IE no matter the IP version.

Change-Id: I743dbb7c89e504762498b7f278c12e130352e5f0
2020-09-07 08:05:28 +00:00
Vadim Yanitskiy a2afacc905 library/IPA: use tr_ASP_IPA_EV instead of inline templates
This way we can easily add new parameters to ASP_IPA_Event.

Change-Id: Icc37286fcb4d43836d56a26424ecb9dcba58d1f1
2020-05-18 21:16:35 +07: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
Pau Espin 8f24571e56 pcu: Introduce test TC_mo_ping_pong_with_ul_racap
Test sending MS RA capabilities through Packet Resource Request to
update GPRS multislot class.
EGPRS multislot will come in a later commit.

Change-Id: I5026d8b78a3fb82093956b65989d18fa6f6d5424
2020-04-28 16:01:18 +00:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00:00
Pau Espin f2b477bffa bscnat: Add missing setverdict(pass) at the end
Without this line, tests like TC_ctrl_location end up with verdict
"none".

Change-Id: I139a2ef63685b0f646fd9069031f92cf20eeca1e
2019-06-13 17:16:46 +02:00
Pau Espin 298fa91726 bscnat: Fix race condition in TC_ctrl_location
Change-Id: Ifb5a2a9936fff94511a6bd11bd8e155a3d3e2d82
2019-06-13 17:12:12 +02:00
Pau Espin 5f89adf462 bscnat: Start test global timers
Change-Id: I40672bb72fdd1624efcb8d3ee858b17c0188172b
2019-06-13 16:55:06 +02:00
Pau Espin 8ab9a7936b bscnat: Introduce test TC_ctrl_location
It checks location-state TRAP is forwaded correctly in BSC-NAT from BSC
towards locally connected CTRL client, with variable names updated to
contain BSC/BTS indexes.
It also verifies commands can be applied (SET) in inverse direction.

Change-Id: If28aba011a1903788cacbc10c0b62954925d4b1f
2019-06-13 14:33:23 +00:00
Pau Espin a839604956 bscnat: Add function to run actions on test per BSC component
Will be useful to test stuff on IPA layer BSC<->BSC-NAT.

Change-Id: I97e743c79e5e9e7613ab91a1aa9ce2377a237fd5
2019-06-13 14:33:23 +00:00
Pau Espin d1d4953d31 bscnat: Refactor MSC side code to allow different actions per test
Each test can now plug in different acctions to be done by the emulated
MSC, by passing a BssmapCreateCallback RAN_Emaulation callback to
f_init(). Old hardcoded behaviour (main()) is renamed and used in
laready existing tests.

New infrastructure provides a generic BssmapCreateCallback taking care
of required boilerplate, so new tests/users only need to define a new
callback calling that generic one with a function pointer where all test
logic is implemented.

Change-Id: Ic429420d0d95b6aacb6e5c44031b49c942ed544d
2019-06-13 14:33:23 +00:00
Pau Espin 8d85ba4baa bscnat: Refactor BSC_MS side code to allow different actions per test
Each test can now plug in different actions to be done by the emulated
BSC_MS, by passing a function to f_init(). Old hardcoded behaviour (main())
is renamed and used in already existing tests.

Change-Id: Ic82ca333267535c5859e6439deacbf3b1d1fe391
2019-06-13 14:33:23 +00:00
Pau Espin bdcfe03ed4 bscnat: Move generic code to wait for test into its own function
Change-Id: Ia95ec02d7ca631e037abfbcfc7881b57e37aef5b
2019-06-13 14:33:23 +00:00
Pau Espin c6b78ff2f9 Add and set transport field for RanOps structure
This will allow RAN_Emulation to have better knowledge on the protocol
stack in use, and behave differently based on that information.
For intance, forthcoming commit will append OsmuxSupport IE only if
transport is BSSAP AoIP.

Change-Id: Ife62e328af2d3f2475ff93249f2138820c7ddabb
2019-06-06 17:06:29 +02:00
Pau Espin f3c12228fb bsc-nat: Introduce Osmux test
Depends: openbsc.git Iadc004064a5a237c93009f242cb943ebc4d2d7e6
Change-Id: I35f206aab713ccf0a4e074872e291c349c903b9d
2019-05-27 20:05:25 +02:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Pau Espin c6a53dbb2a bsc: Introduce Osmux infra and one test for osmo-bsc
Test verifies once osmux is enabled in osmo-bsc, BSSMAP RESET (ACK)
contains Osmux Support IE and that it correctly handles BSSMAP ASsign
Req with Osmux CID.

Related: OS#2551
Depends: osmo-bsc 6de754cdde5319af3059d8fc6abf85037ec7eacc
Depends: titan.ProtocolModules.BSSMAP Iaf1e137269c0da20b2c96fd104b57edf336693af
Change-Id: If69c716dc06d61d810c32d1720a237c7535baca8
2019-05-27 09:56:51 +00: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 53cccab4e9 bsc-nat: Add sample bsc-nat config for test
Change-Id: I0ab3a4fb66201cd134238f5efcf6ff80033011e3
2019-03-29 11:12:14 +00:00
Daniel Willmann c07f6f5f24 bsc-nat: Use id when creating components
Change-Id: I2c130d74405cef2b9aa1f9c0a2122fd70aa9cc62
2019-03-29 11:12:14 +00:00
Daniel Willmann d764dd9939 bsc-nat: Add default module parameters
Change-Id: I800ebe0f33cf7c86eea65d2e186c6af12fee6db7
2019-03-29 11:12:14 +00:00
Daniel Willmann 909523e141 bsc-nat: Use BSCx as token for BSC no x
Change-Id: I27cf1a2f5c8a55eb9883ac9430e73c95dded9b7b
2019-03-29 11:12:14 +00:00
Daniel Willmann 991fd78860 bsc_nat: Wait for bsc-nat to connect to MSC before connecting the BSC
Change-Id: Ic02ce9bd46cab7e6d4833b1d838c334e377f7d50
2019-03-29 11:12:14 +00:00
Daniel Willmann aa17059b32 bsc-nat: Fix errors due to bit rot
Change-Id: I79f3b1b74c9f6f8769a5d71fde04847435f3f345
2019-03-29 11:12:14 +00:00
Daniel Willmann 0c6f34cf8f Rename IPA_Test->BSCNAT_Tests and get proper cfg files
Change-Id: I937d2aa1abfcb302dfb529ac8be75dcd269c46e2
2019-03-29 11:12:14 +00: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
Harald Welte 9220f6336e Print more self-explanatory error message on bind/connect failures
When sockets cannot be bound or connected, the existing TTCN-3 code prints
the following rather cryptic error messages:

"IPA-CTRL-IPA(47)@f70ff1fd5cfd: Dynamic test case error: Using the value of an optional field containing omit. (Transport endpoint is not connected)"

The "Transport endpoint is not connected" sort-of gives it away, but
let's make it more explicit by introducing explicit checks for the
res.connId and manual setverdict(fail) statements with proper error
message.

Change-Id: Id22a1b5189d81c4fca03d5e7aff60ffdd1ad56bf
2018-05-23 20:27:02 +02:00
Harald Welte 458fd37fb9 don't use setverdict(inconc) anymore. Use 'fail' at all times
The problem is that Junit-XML doesn't have a mapping for inconclusive
results, and hence they show up as 'passed'.

By introducing this change, we make sure all tests that don't pass
show up as failed.

Change-Id: Iddd13d0055c91f9bd304ce9833fba0485abf4c4e
2018-03-21 11:27:48 +01: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
Max 6367d7b807 Don't symlink non-existent file
Change-Id: I10309f07fb207c027703f0b43a478c152a029b6d
2018-02-05 16:58:27 +01:00
Harald Welte 6ed6bf9773 MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE
Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968
2018-01-24 23:05:32 +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 818b6e4225 Add "SourceInfoFormat := Single;" to all test configs
This will make sure that all log files will contain information about
the .ttcn source file name and line number that has caused the log,
which is extremely useful during debugging.

Change-Id: Id6785757f20279ba84b34747f878baf67d065b20
2018-01-17 11:11:29 +00:00
Harald Welte df32723446 GSUP Support and first test against OsmoHLR
Change-Id: Idd7a6aca1ab193da39294f49a3adc4c1cd7cecff
2017-12-28 23:17:24 +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 cc7e4dc40e BSSMAP_Templates: Enable use for AoIP, not just E1-CIC
Change-Id: I421ade4ae1c0c19c9c2b1172cdcf8d6c4cd55205
2017-12-15 14:19:10 +01:00
Harald Welte 20a58c6d6f generalize shared code from regen_makefile.sh into shared helper script
Change-Id: I86a738420851a7d9e3bdb2671f6862c3d505a4ba
2017-12-13 01:04:42 +01:00
Harald Welte 9fbe93f532 regen_makefile.sh: Fix TITAN 6.1.0 support
When introducing the rewriting for 6.3.0 we broke the 6.1.0 support.
Now the result should build on Debian with both 6.1.0 and 6.3.0

Change-Id: I263a6abd2d9eb15ce5778ef8dbfcdac2a228b77d
2017-12-13 00:50:11 +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 2f157f6cf9 bsc-test: Fix build in laforge/bsc branch 2017-12-12 15:52:28 +01:00