Commit Graph

242 Commits

Author SHA1 Message Date
Oliver Smith aac9b9ceca BSSGP_Emulation: add BssgpDecodeDepth
Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the
existing PCU tests, that expect messages only decoded to the BSSGP
level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the
L3 decoding, so f_dec_bssgp goes through the layers in the reverse order
of f_send_bssgp_dec.

I have verified, that all testsuites using the BSSGP Emulation (SGSN,
PCU, PCU-SNS) are still working with this patch.

Related: OS#4180
Fixes: 955aa94504 ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")
Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605
2019-09-02 09:15:33 +02:00
Oliver Smith aa6278dd8f pcu: add configs for running without docker
Base on docker-playground.git's ttcn3-pcu-test/*.cfg files, change IPs
to 127.0.0.1, log to stderr, adjust pcu-socket path.

Change-Id: Iff3e5e6cf0c608680c8c5f9f83e8bc1032274ea9
2019-08-30 13:21:54 +02:00
Oliver Smith 00d7bc4a93 pcu/GPRS_TBF.ttcn: less verbose logging
Reduce the formatted log size of TC_ul_tbf from ~140 MB to ~8 MB.

Related: OS#3925
Change-Id: Ibccfc399a6e8b50e4f01b5f167c47fbbde4533ed
2019-08-30 12:05:39 +02:00
Harald Welte 955aa94504 BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure
It originally seemed like a great idea to define a custom record
which aggregates the decoded BSSGP, LLC, L3 and/or SNDCP and passes
it to the individual ConnHdlr.  However, particularly with testcase
interoperability for IuPS in mind, this seems bogus.  Also, we
never really took advantage of this.

Let's now decode as far as we can decode any PDU, and then send the
decoded version of that PDU via the ports between the BSSGP_Emulation
and the ConnHdlr component.

Change-Id: I8c1082880902dd9a04935945f0293895f4d0c53a
2019-08-18 17:12:46 +00: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
Harald Welte 7fd25cfbfd pcu: Add TC_pcuif_suspend() to test PCU->BSSGP SUSPEND processing
The PCU is supposed to forward any RR SUSPEND received by the BTS
on dedicated channels and pass it to the SGSN via BSSGP.  This provides
knowledge to the SGSN that the MS is not reachable via PS/TBF anymore
until it completes its CC dedicated mode transaction and RESUMEs.

Change-Id: Iaf35e0c1087413db1dc7d169fa716df14c78f5db
2019-03-27 11:17:49 +00:00
Harald Welte 3d1fd5feef PCU: make f_bssgp_establish() run on BSSGP_Client_CT
This means it can be used in different/other scenarios, e.g.
with tests that use PCUIF directly.

Change-Id: I1aa5dc090aac78a85a85ac190343befb0199a093
2019-03-27 11:17:49 +00:00
Harald Welte 797ab3a91c pcu: Fix MCC/MNC handling: use 'F' between MCC and MNC in 2-digit case
Change-Id: Ifdb64c501095839e86894716769adb53e3c17382
2019-03-27 11:17:49 +00:00
Harald Welte 0466d16d42 pcu: move f_pcuif_tx() to PCU_Tests_RAW as it runs on RAW_PCU_CT
Change-Id: Ic60a7fc657df17ff2d3a889501f0576b98f1f4ad
2019-03-27 11:17:49 +00:00
Harald Welte f12b5a412d pcu: Ensure we're always using the same defaults for the CGI
Not all parts of the code explicitly specify each and every parameter
of the Cell Gobal Identifier (particularly we don't do that for the PCU
INFO IND), and hence multiple parts only interoperate if the same
defaults are used in all locations.

Change-Id: Iac9be9a8d4ccb4d01cc343d763d2e35873e3844f
2019-03-27 11:17:49 +00:00
Harald Welte a419df22a6 PCU_Tests.ttcn: Use "normal" Osmocom TTCN-3 coding style
Change-Id: I6eaca0ec7fb9c2dc5d59e385bc3a3a8bb85fe23a
2019-03-27 11:17:49 +00:00
Harald Welte 5e514fa3db NS_Emulation: Add minimal support for SGSN-side SNS handling
Change-Id: I1edf739d6fd39478f662a28a7d9334ca51c270a3
2019-03-27 11:17:49 +00:00
Harald Welte 64d0731c5b pcu: Add SNS tests for SGSN-originated BVC-RESET handling
Change-Id: Ib6b80acf98711f4749da4faf549b02ff2b82425f
2019-03-20 10:57:38 +00:00
Harald Welte 7e6a35cc65 pcu: Verify IPv4 address communicated in PCU-originated SNS-CONFIG PDU
Prior to this patch, the test accepted anything as list of IPv4
endpoints in the PCU-originated SNS-CONFIG PDU.  Using this patch,
the corect IPv4 address and UDP port number is verified.

Change-Id: Ia57100c7833bebc8d77118968c19ab12a3834036
Related: OS#3845
2019-03-16 18:37:54 +01:00
Harald Welte ecd159ecc7 pcu: Test SNS where initial IP/port is not part of configured NS-VCs
As per section 6.2.1 of 3GPP TS 48.016, the initial IP/port where the
SNS SIZE/CONFIG procedures are being performed is not automatically part
of the later NS-VCs.  This means we shall not perform the NS-ALIVE
procedure or any other procedure beyond SNS with that specific endpoint.

This adds a new TC_sns_1c1u_separate() to test for this behavior.

Change-Id: Ie2a017250ca1d5386e2cf42d1945e61d170ac92d
Related: OS#3844
2019-03-16 14:46:12 +01:00
Harald Welte 3b3358323c pcu: Fix PCU_Tests_RAW_SNS.TC_pcuif_rach
Change-Id: Ifb19e68a4b2b3250cdc6079dcd7f42656c57cee0
2019-03-15 22:41:33 +01:00
Harald Welte 33ad57b6fe pcu: Fix TC_sns_so_config_success expectations
If there's only one IP/PORT/NSVC, we cannot expect something happening
on another NSVC.  In this test case, only index 0  / NSVC0 is used.

Change-Id: Ia83d726c4223d61544f80d266ea832fcaa235518
2019-03-15 17:03:14 +00:00
Harald Welte 16e92f4169 PCU: Add simple test for PCUIF RACH Indication
Change-Id: I8fa6de711391837ed16888c48b22cd29892f222f
2019-03-02 00:04:52 +01:00
Harald Welte ea3c7e945e PCU: Split RAW_PCU_CT from RAW_NS_CT
Let's split the PCUIF-side component from the NS-side component
and create a new RAW_Test_CT which derives from both.

Change-Id: I15021c5dea16e39a530d8d9080e37a7f2a6c4fa7
2019-03-02 00:04:52 +01:00
Harald Welte 72099557a5 PCU: Add test for SNS Change Weight procedure
Change-Id: Ia63865139f63969ccde010b01ddb8fb073209f3a
2019-02-26 11:28:28 +01:00
Harald Welte 630d0e6523 PCU: Add tests for SNS with separate signalling/data NS-VC, ADD, DEL
Change-Id: Ie1d14a901b354daa4e3796fe66e7390d87c7e778
Related: OS#3617
2019-02-26 11:28:28 +01:00
Harald Welte b63c3a1e4f PCU: Add a bit more logging/tracing to ease debugging of SNS tests
Change-Id: Ic558f02f3c3ddbde0f16a7656b84486a8462b0a4
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte bf76824482 PCU: Prepare for having multiple Gb connections on tester side
Change-Id: I6de4832bda18b36873f57986a34ba8082af2c853
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte c4d7beb3ff PCU: Move SNS specific functions to PCU_Tests_RAW_SNS.ttcn
Change-Id: Ie41a21b6f2b95f4aaea84d8b717e96efefb704e3
RelateD: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte f7b74076c2 PCU: Add tests for our new IP Sub-Network-Service (SNS) Gb interface
The SNS-enabled Gb interface has no RESET/BLOCK/UNBLOCK procedures,
but introduces a bunch of new SNS procedures.  Most importantly the
SNS-SIZE and SNS-CONFIG procedures.

Change-Id: I0fe3d4579960bab0494c294ec7ab8032feed4fb2
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte 88963dc365 PCU: Change PCU-side port to 22000
This way the tester and PCU can run on the same ip address without
conflicts.

Change-Id: I0e98877db8f0300a98f7694744a063c1143b89f3
2019-02-26 10:20:29 +00:00
Harald Welte b1b853a8ec PCU_Tests.default: Remove content of [EXECUTE] section
If we have tests stated in the .default file and we have them stated
again in the .cfg file, they will be executed twice.  Let's align
the PCU tests suite with those of other network elements.

Change-Id: Ieeaf70153f4dc61978569d06e20947fa939cabdd
2019-02-21 15:54:46 +00:00
Harald Welte 9fbcf4b01e PCU: Tests for the BSS/PCU side NS/BSSGP implementations
The existing (unused) PCU_Tests are operating on top of a NS + BSSGP
emulation, i.e. they're aimed at testing higher protocol layers.  Also,
they required BTS+BSC to run next to the PCU.

The new PCU_Tests_RAW introduced in this patch are the exact opposite:
* they test the PCU alone (attach to PCUIF and Gb interface)
* they don't require BTS or BSC to run
* they don't use NS + BSSGP emulation but raw NS/BSSGP frames to
  test the very NS/BSSGP implementation inside of OsmoPCU.

Change-Id: I7ad76b96974cf0a686ad0f00ccd09d1a9df8b4d5
Related: OS#2890
2019-02-21 11:53:42 +01:00
Harald Welte f4bf131eca Osocom_Gb_Types: Add send/receive templates for SNS-SIZE and SNS-CONFIG procedure
Change-Id: Iaa12c468a9e665d2050945cfc0a60dab4024071c
2019-02-18 20:25:00 +01:00
Stefan Sperling 4c32b952dd start implementing the TC_paging() PCU test
Implement a basic paging test for the PCU, which is passing for paging
via TMSI (but only if osmo-pcu is started after the test is started).

Previously, this test code amounted to a debugging loop which
never terminated.

Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18
Related: OS#2404
2018-11-19 11:10:22 +00:00
Max cdce375449 PCU: cleanup test config
* remove unused parameters
* add expected results
* use control for default test execution
* only tests which could (in theory) pass are left in control

Previously generic control had some tests which never called
"setverdict(pass)" which means they would always fail. Such tests might
be useful during development but should not be part of test set executed
by default.

Change-Id: I91910e18f108f8ee9a3b76ced16c420fdbdb665a
Related: OS#2890
2018-11-06 22:13:30 +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
Alexander Couzens 0e510e693d BSSGP_Emulation.ttcn: extend BSSGP_Client_CT to hold 3 instances of BSSGP
Change-Id: Ibd7abba826a08b582361e9c255e9c44185e14067
2018-08-14 13:26:47 +00:00
Alexander Couzens 2c12b24a47 NS_Emulation: support multiple instances at the same time
The NS_Emulation has configuration values hardcoded or bound
to module parameters which prevents multiple instances.
Replace the module parameter based configuration with configuration
given when starting the NS_Emaulation.

Change-Id: I9128f9ad5c372779c38799269393137ba52576cd
2018-08-13 16:23:50 +00:00
Daniel Willmann afce86630c Stop tests after failures
Call mtc.stop after setverdict(fail), add reasons to most failures and
fail with verdict error for internal errors.

Change-Id: I9b618235939fa41160b9be6677b121963d3ec857
2018-07-24 14:19:42 +02:00
Stefan Sperling f82bbb6829 make PCU tests send PS paging requests on BVCI zero
osmo-pcu discards PAGING-PS messages unless received on the
signalling BVCI 0. The BVCI value must be set to zero both
in the NS header and the BSSGP header. Create new ports between
the PCU_Test components which the TC_paging test case can use
to ensure that both layers send frames with BVCI value of zero.

This does not make PCU_Tests.tc_paging work yet, however the PS
paging request is now processed by osmo-pcu rather than discarded.

Change-Id: I0437123b04b7320a4f690f0646578c57abf6bc87
Related: OS#2404
2018-05-25 14:26:19 +02: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 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 cc5c1152cc WIP: Work towards a more real DL TBF receiver implementation
Change-Id: I300312734d99f2b8a406f39e04b4f738940f7579
2018-03-12 16:04:15 +01:00
Harald Welte b669ee029e pcu: First DL TBF hack
Change-Id: Ib3f09e125a7a4492d9072f8e9f5896eaac7ed03b
2018-03-12 15:50:03 +01:00
Harald Welte a35a9ca4d4 pcu: Adapt TC_paging to new code structure
OsmoPCU still doesn't support PAGING-PS, so this test is moot.

Change-Id: I94258c386073b1c11792949df56d643b92eeaefd
2018-03-12 14:23:57 +00:00
Harald Welte a0895f96a9 pcu: Rename 'gprs_gb/Test' tp 'pcu/PCU_Tests' to align with other suites
Change-Id: Ia3350e7e1a9d6715ab81f4a5f413b7e4d728ff60
2018-03-12 14:23:57 +00:00