Commit Graph

1512 Commits

Author SHA1 Message Date
Oliver Smith 1ec1d3bc5b WIP: mgw: conn timeout tests
Change-Id: I020b682b347045818fd28de240daa0aa33fe43b4
2019-06-26 10:45:55 +02:00
Oliver Smith 350eb681e2 mgw: add osmo-mgw.cfg
Change-Id: I3dd498902db4ea0233f43099ec5b6b4292714908
2019-06-25 13:45:25 +02:00
Pau Espin fd02ad474e bsc: Test MGCP-over-IPA forwarding in SCCPlite tests
* MGCP-over-IPA handling in MSC_ConnectionHandler means we need to use
the new MGCP_CLIENT_MULTI port since we'll be managing MGCP messages
from 2 different UDP connections, and we need to be able to route
answers correctly. As a result, parameter multi_conn_mode is enabled for
SCCPlite and all code adapted to use that port in that type of scenario.
* iDuring calls when on SCCPlite, send a full (all-required-params-in)
CRCX through the MGCP-over-IPA connection towards the BSC in order to
emulate the MSC, and expect the correct answer back. This way we test
BSC funcionality to forward MGCP messages coming from MSC works as
expected.

Related: OS#2536
Depends: osmo-bsc.git I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab
Change-Id: I31fed700772dd0b063f913b1e1639fd428c46e7d
2019-06-24 13:53:25 +00:00
Pau Espin 1a026a52d3 lib/mgcp: Add new port with support to handle multiple MGCP sockets
* Some scenarios like MGW BSC-attached in SCCPlite require handling of
2 MGCP-over-UDP sockets in MGCP Emulation: 1 for regular
libosmomgcp-client from osmo-bsc and another one from the forward socket
from osmo-bsc (of MGCP-over-IPA messages communicated with MSC).

* Old port is kept for backward compatibility with other tests and
enabled by default. It's also interesting to keep it because it makes
tests without special needs (2 sockets) to use the old port/API which
produces simpler code to read and mantain.

* Users of the new port have to enable multi_conn_mode parameter and
expect to interact with port MGCP_CLIENT_MULTI instead of MGCP_CLIENT,
which will offer messages containing information about the UDP
connection being used by that message.

Change-Id: Ic0ba8c5cde068c07671512a83095d83e28b86746
2019-06-24 13:53:25 +00:00
Pau Espin 513b831cda bsc: Refactor altstep as_Media_mgw()
Move logic handling CRCX and MDCX to function, so they can be reused for
other ports in forthcoming commits.

Change-Id: I07344657c5d1465a8e0c278adb76150ca7f449ba
2019-06-24 13:53:25 +00:00
Harald Welte aba42164fb BSSMAP_Templates: Provide complete set of CellID related rx/tx templates
Change-Id: I07c5fb9b621b09e11fec025b56f971fb61060839
2019-06-21 09:34:14 +00:00
Harald Welte 0cdf071e8a Put build / run scripts under Apache 2.0 license
The license of the build or execution scripts doesn't affect the license
of the actual program, and we want to explicitly state that these scripts may
be used in any kind of context.

Change-Id: I553925cd88b05903aab52ae1afb093aa9ab9d035
2019-06-21 09:34:09 +00:00
Vadim Yanitskiy ba0b0aae45 MSC_Tests_Iu.ttcn: fix TC_iu_lu_and_mo_ussd_mo_release(): use proper BSC number
Change-Id: I58149f0e9cbae9684a8a899bfee81b0de609ccac
2019-06-20 22:26:33 +07:00
Vadim Yanitskiy f2c3fa9144 library/RAN_Emulation.ttcnpp: fix: properly handle SAPI / DLCI for RANAP
Some of our SMS related test cases are failing. The problem is
that SMS related RAN messages shall be sent on SAPI 3, as per
GSM TS 04.11, section 2.3, while they actually being sent on
SAPI 0.

For the messages coming from the TCs towards OsmoMSC over RANAP,
we need to convert from DLCI to SAPI in f_xmit_raw_l3(). OsmoMSC
also needs to be patched, because it seems to ignore SAPI IE.

Change-Id: I6199fd5f26774fb1ec419bc1ef9e1caeca3a0d35
2019-06-20 22:25:50 +07:00
Vadim Yanitskiy e06f228be1 library/ranap: enrich both t(s|r)_RANAP_DirectTransfer templates
Instead of having two similar variants of RANAP_DirectTransfer:

  - t(s|r)_RANAP_DirectTransfer, and
  - t(s|r)_RANAP_DirectTransferSAPI,

let's make the first one more flexible, and drop the last one.
This is achieved by introducing two supplementary functions:

  - f_gen_ts_dt_ies(), and
  - f_gen_tr_dt_ies,

which dynamically compose DirectTransfer.protocolIEs.

Change-Id: I7333d08c4d5a72159bfbd50fe8e7b1084cd61b9e
2019-06-20 22:13:25 +07:00
Pau Espin 43021cbbf7 lib/bssmap: Introduce function f_bssmap_ie_cic_2_int()
Function will be re-used in forthcoming commits.

Change-Id: Ifc7444ecca1571959ed83b43d3c7461c637686ae
2019-06-19 10:52:11 +00:00
Pau Espin 392963fa28 bsc: Move hardcoded ip addr to variable
This way it's more clear what are those IP addresses for.

Change-Id: I3600fd0d0486205e5bdc487fa75e9038d3bfb52c
2019-06-19 10:52:11 +00:00
Pau Espin 1fc30b9483 bsc-sccplite: Fix expected DLCX in HO tests
* TTCN3 code was not ACKing the DLCXs, and as a result retransmitted
DLCX BSC->MGW were being counted as 2nd DLCX.

* In SCCPLite, only 1 DLCX is expected BSC->MGW, because the BSC only
takes care of the BTS-side conn in the endpoint, while MSC takes care of
the MSC-side conn (which is not sent in this case because doesn't really
involved the BSC other than forwarding the message, which will already
be tested in other places in forthcoming commits).

* Getting rid of retransmissions by ACKing the DLCX, it unconvers a bug
in TC_ho_out_fail_no_ho_detect when on AoIP, where BSC only deletes one
of the 2 previously created connections.

* Code is refactored into the function because its logic is made more
complex, and may be even more complex in forthcoming commits when we add
MGCP-over-IPA forwarding verification support.

Change-Id: Ia1d0db9af073760105cc8509e228e317dbea2268
2019-06-19 10:52:11 +00:00
Eric Wild ae8f262651 BTS: BS power tests
osmo-bts does currently not use the signaled lchan BS power level, nor
does it update the BS power IE returned in the measurement results.

Change-Id: If91fb57b4070c60bb277d0b55d69ee3dde47ee48
2019-06-18 17:08:09 +02:00
Oliver Smith bc690ffcd3 sgsn: add osmo-sgsn.cfg, SGSN_Tests.cfg
Base on the docker-playground.git's config, but with 127.0.0.*.
All tests passing in jenkins are passing locally with this config.

Change-Id: I6da479e35fbe9f861a8bd8e578badcd1563e740f
2019-06-18 13:09:26 +00:00
Oliver Smith 1b257806a1 hlr: add create-subscriber-on-demand tests
Test all possible code paths where a subscriber on demand can be
created:
* Check IMEI early
* Location Update
* Send Auth Info

Related: OS#2542
Change-Id: Id544fa906ad442c2bbbccff437c18d04ddccde2e
2019-06-18 12:50:37 +00:00
Vadim Yanitskiy 78329c7761 msc/expected-results.xml: update SS and SMS related expectations
Change-Id: I7c67fa71e2157063c13605267ec34779c5603ed9
2019-06-17 23:20:00 +07:00
Vadim Yanitskiy c3c07d4c6e MSC_Tests.ttcn: introduce TC_mo_ussd_for_unknown_trans
The new test case is aimed to verify that OsmoMSC properly does
reject (call independent) SS/USSD messages for non-existing
transactions.

Change-Id: I231142c88b0d3308039c797aa2bccadd79dce18b
Related: OS#2931
2019-06-17 23:02:44 +07:00
Eric Wild 095024b599 BTS: test that RSL MS POWER does not activate MS power control without PP IE
Change-Id: I8776ed4af83dc9f9f32ac14f5d4c9e35f4a286d6
2019-06-17 15:08:57 +02:00
Eric Wild 280ccb83a0 BTS: add another failing power control test
Change-Id: I8b3bdf374c96fa3368f90ae524859f30ceefa5f5
2019-06-17 11:12:21 +02:00
Vadim Yanitskiy 29ba8d6295 MSC_Tests.ttcn: introduce TC_proc_ss_abort
This test case is aimed to verify HLR-/EUSE-initiated abort of an
active SS/USSD session according to the following scenario:

  1. (HLR/EUSE -> MSC) GSUP_PROC_SS_REQ with random facility;
  2. Network-originated connection establishment:
  2.a. (MSC -> BSC -> MS) Paging Request;
  2.b. ...
  2.c. (MS -> BSC -> MSC) Paging Response;
  3. (MSC -> MS) GSM 04.80 REGISTER with random facility;
  4. (HLR/EUSE -> MSC) GSUP_PROC_SS_ERR (abort);
  5. (MSC -> MS) GSM 04.80 RELEASE COMPLETE;
  6. Connection release.

As can be seen, HLR/EUSE initiates the session abort right after
the GSM 04.80 REGISTER message is delivered to the MS, and just
before the MS sends anything back in response.

Change-Id: I5586a88136c936441a842f49248824680603672e
Related: OS#2931
2019-06-16 15:30:29 +07:00
Vadim Yanitskiy e5f4ed9da8 MSC_Tests.ttcn: introduce TC_proc_ss_paging_fail
The idea of this test case is to check that OsmoMSC does inform
HLR/EUSE that a subscriber did not respond to Paging Request in
case of network-originated SS/USSD.

Both f_expect_gsup_msg() and f_expect_dtap_msg() were extended
with optional timeout value, as we need to wait longer than
2.0 seconds (default). Let's stick to 10.0 seconds.

Change-Id: I1f53c56d569c8ac4071835685bbe3bc9e0ebd7f0
Related: OS#2931
2019-06-16 02:38:07 +07:00
Vadim Yanitskiy d612d28619 MSC_Tests.ttcn: introduce TC_proc_ss_for_unknown_session
The idea of this test case is to check that OsmoMSC properly
rejects GSUP PROC_SS messages for unknown sessions.

As it turned out, OsmoMSC doesn't send GSUP PROC_SS ERROR
as expected. The fix has been submitted.

Change-Id: Ie267ee174c5061cd3fc102a2824abe03d73f3aac
Related: OS#2931
2019-06-15 14:58:55 +07:00
Vadim Yanitskiy 851798c051 MSC_Tests.ttcn: use f_expect_gsup_msg() in f_tc_mt_ussd_for_unknown_subscr()
Change-Id: Id067cee3b7d06613d8387e0fa9d8a5c1dbcc49cf
2019-06-15 14:46:17 +07:00
Vadim Yanitskiy d1e1ce592d MSC_Tests.ttcn: add timers to SS/USSD test cases
Change-Id: I1883bae34a9fe0435a6138cb7594461dee3bb232
2019-06-14 21:49:57 +00:00
Vadim Yanitskiy 0e6c9f5477 MSC_Tests.ttcn: introduce TC_mt_ussd_for_unknown_subscr
The idea of this test case is to check that OsmoMSC properly
rejects SS/USSD requests for unknown subscribers.

Running this test case against the current OsmoMSC helped
to discover several problems:

  - OsmoMSC doesn't print anything in such cases;
  - IMSI in the response error message is empty;
  - both session state and ID IEs are omited;

which are going to be fixed soon.

Change-Id: Id35cd3ec15d1bab15260312d7bbb41e2d10349fe
Related: OS#2931
2019-06-14 21:49:57 +00:00
Vadim Yanitskiy 6c9fafcead library/GSUP_Types.ttcn: refactor PROC_SS IEs generation
Both ts_GSUP_PROC_SS_ERR() and tr_GSUP_PROC_SS_ERR() templates
used to compose the set of GSUP IEs manually, while similar ones
were using both f_gen_ts_ss_ies() and f_gen_tr_ss_ies().

This led to the following problems:

  - tr_GSUP_PROC_SS_ERR was not tolerant to omitted
    message class IE, which was recently introduced;
  - code duplication.

Let's modify the both functions in order to accept an optional
Cause IE value, which is omitted by default, and use them in
the both templates.

Change-Id: I5cd6d2bc754bcedd1e721b3bd95ada9cdd44bcf0
2019-06-14 21:49:57 +00:00
Eric Wild 74f25ae2c3 bts: clean up old tests and make them work again
Change-Id: Ie9d73cd9777b6fdda5115ed5dc103979d79c8cd9
2019-06-14 16:37:02 +00:00
Eric Wild 211acc3d45 bts: more lapdm tests
Change-Id: I0db71de5f600022935f47573aa919990de4bfec0
2019-06-14 16:36:25 +00:00
Vadim Yanitskiy de8af3d2ac library/L1CTL_PortType.ttcn: clarify and unify timeout messages
It's way more cleaner when you see:

  Timeout waiting for L1CTL_RACH_CONF

instead of:

  Timeout in RACH.

Change-Id: I25e8230c2e4b29b2583bf8954d0dedaa18e5d6ae
2019-06-13 15:33:34 +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 acc5119bac lib/IPA_Emulation: Build IPA_CTRL conditionally based on define
Change-Id: I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
2019-06-13 16:33:49 +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 579cd7a406 lib/CTRL: Improve and add more helper templates and functions
Change-Id: Icc6ac860ebd6a719f9e0cb5c5345fb4d39a864ce
2019-06-13 09:39:14 +00:00
Pau Espin 5a2d743e5d bsc: Introduce test TC_ctrl_location
Related: OS#2012
Change-Id: I3640f6889e3b6adc3b4601082f948543c64a2fe3
2019-06-13 09:38:24 +00:00
Pau Espin 4d0e5e521b lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn
This is the case for SCCPlite between BSC and MSC (or BSC-NAT). MGCP and
CTRL can be multiplexed over the same underlaying IPA conn.

Related: OS#2012
Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
2019-06-13 09:38:05 +00:00
Pau Espin 76ba541efa bsc: Fix trailing whitespace
Change-Id: I97c6cc290d6cc23611ac38e7e370b5b0b88cca1d
2019-06-13 09:38:05 +00:00
Oliver Smith 936dbe64ee hlr: add Check IMEI tests
Create tests for most code paths of rx_check_imei_req() in hlr.c (except
for subscriber create on demand, this will be in an upcoming patch).

Add missing message types to GSUP_Types.ttcn, and adjust the IMEI and
IMEI_Result IEs for consistency with the existing IEs, and to make the
tests compile.

Related: OS#2541
Change-Id: I97c8462f0817149feadd0c4865e3df6c2af92a80
2019-06-13 09:35:17 +00:00
Oliver Smith 141620d343 hlr: add f_vty_subscr_show_nomatch()
Allow to check if a certain pattern does not match the "show subscriber"
output. This will be used by upcoming tests for the check IMEI GSUP
message type, to check if the IMEI was not stored, depending on the
OsmoHLR configuration.

Change-Id: I176d8fd2ee74e1eb7ac797f931cd6005d398740f
2019-06-13 09:35:05 +00:00
Eric Wild 61edb7e974 BTS: add some dynamic power control tests
Change-Id: I57489ba22542d859ced767e856634f9060c060f0
2019-06-12 20:16:44 +00:00
Alexander Couzens 4630e74bb8 SGSN_Tests: f_detach_mo(): fail when receiving any unhandled layer 3 message for normal detach
Merge the case with the fail when doing a power-off detach.

Change-Id: I957994376583959758417dccf419a55c43a0c61b
2019-06-11 14:53:46 +00:00
Oliver Smith 49a8746ca5 hlr: add osmo-hlr.cfg
Copy osmo-hlr.cfg from docker-playground.git, but replace all IPs with
127.0.0.1.

Change-Id: I73f673523dab8765ca87851175fafdec9fc20e1b
2019-06-09 06:52:18 +00:00
Alexander Couzens a063483b8b BTS: pcu_rr_suspend clean up and release the channel
The testcase failed becaues of an unexpected RSL Error Indication from
the LAPDm system which was in the RSL emulation queue when tearing down
the test environment.
By calling f_rsl_chan_deact() the queue gets flushed until the RSL
deactivate channel is received. It's also more clean to release the
channel.

Fixes: OS#4051
Change-Id: I55827626803ca81b68f905fd0df3126367951f39
2019-06-08 10:09:26 +00:00
Pau Espin 6bf6313e15 CTRL_Types: Fix SET value not encoded in message
Change-Id: I9e0132429265d03caa97af2b2f44eed0327f3200
2019-06-07 15:37:36 +02:00