Commit Graph

1476 Commits

Author SHA1 Message Date
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
Pau Espin 955491872e bsc: Only append Osmux IEs in BSSAP AoIP
Previous to this commit, BSSAP Reset (Ack) messages contained Osmux
Support IE even if transport was SCCPLite, where those IEs are actually
meaningless.

Change-Id: If6cc0f65a0f273297a4523e5d6a7564d966f0aa6
2019-06-06 17:06:29 +02: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 096d73dfc3 bsc: Avoid appending Osmux CID IE in AssignReq/Compl with SCCPLite
That IE is not required when on SCCPlite, only for AoIP.

Change-Id: Iff939e431fa3da9fef648242140fdb8d0dc92e52
2019-06-06 17:06:03 +02:00
Harald Welte d48c0c7f87 bts: Check if BTS_TRXC port is mapped before attempting UDP socket connect
A large number of our tests is currently failing with
	BTS_Tests.ttcn:341 Dynamic test case error: IPL4 Test Port not mapped
which was introduced by Change-Id Ie7d311bf8f03bf9b1d29b5bb28ffad793f215fd1

Change-Id: Ia1ef4ac7dcfec137a8613bc49a7f312d81a86153
2019-06-05 10:09:33 +02:00
Harald Welte a39ac756d3 bts: Add LAPDm test for SABM with wrong C/R bit
Test that the BTS will take no action when it receives an SABM frame
with the C bit set wrong (R); Inspired by TS 51.010-1 25.2.5.2

Implemented as TC_sabm_incorrect_c().

Related: OS#4032
Change-Id: I4fbe7e708c9b1a2c04e5d24a205b5b5af20ff8c7
2019-06-04 23:13:47 +02:00
Harald Welte 44479781b0 bts: Add test csse for I frame with wrong C/R value
Implemented as BTS_Tests_LAPDm.TC_incorrect_cr()

Related: OS#4032
Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104
2019-06-04 23:13:41 +02:00
Vadim Yanitskiy b399281d05 start-testsuite.sh: do not override LD_LIBRARY_PATH
The Eclipse titan.core may not only be installed to hard-coded
'/usr/lib/titan' patch, but to any other location too. In the
later case, one would have to make sure that the custom path
is in $LD_LIBRARY_PATH. So we shall not override it.

Change-Id: I1ec28e8c3081d5de1bea90a7451791ac8cbbd27c
2019-06-04 19:45:09 +00:00
Vadim Yanitskiy dc8db92c86 BTS_Tests.ttcn: fix name of f_trx_fake_toffs256()
Change-Id: I83a1d68ffbfc4d588e143fecc62517baac9b31af
2019-06-04 22:27:55 +07:00
Vadim Yanitskiy 10d72468f4 BTS_Tests.ttcn: indicate default RSSI=-60 to FakeTRX
Change-Id: Ib13e3f8d9fbcd2722c6522a1bb5c513e34adfb18
2019-06-04 22:27:52 +07:00
Vadim Yanitskiy f4e997c5d4 BTS_Tests.ttcn: fix TRXC port mapping between test_CT and ConnHdlr
Before this patch, sending special TRXC commands to FakeTRX, such as
FAKE_TOA and FAKE_RSSI, from ConnHdlr resulted in a receive timeout
waiting for the response.

As it turned out, both the test_CT and the ConnHdlr have a TRXC port,
as depending on the test one would want to globally control it
from test_CT or from within a ConnHdlr.

However, only one of the two should be active (connected) at any given
point in time. Otherwise we'll have two UDP sockets on the same bind
port, and it's more or less random on which of them it ends up.

Let's add an optional parameter 'trxc_comp', which would indicate
whether we need to control TRXC from ConnHdlr or not.

Let's get rid of both f_trxc_connect() and f_main_trxc_connect(),
which basically do the same, but run on different components.

Change-Id: Ie7d311bf8f03bf9b1d29b5bb28ffad793f215fd1
Closes: OS#4039
2019-06-04 22:24:40 +07:00
Vadim Yanitskiy fc1a3ca32b BTS_Tests.ttcn: correct error messages about TRXC connection
Change-Id: Ie3dbe925b8840c0c8d8047ee5878fcdaa1395ab3
2019-06-04 19:35:13 +07:00
Harald Welte 7d9f6db401 bts: Implement testcase for RR response frame loss
Test is implemented as BTS_Tests_LAPDm.TC_rr_response_frame_loss()

Change-Id: I32340fff6666fee0ebfb9b31b55e0982d0d917a1
2019-06-04 09:12:03 +00:00
Harald Welte 76771f1cc2 bts: Factor out mobile-originated LAPDm establishment
which avoids us to have to copy+pate this between several test cases.

Change-Id: I8da753bb3d809ec09f9380bb4bac666ceaf61f00
2019-06-04 09:12:03 +00:00
Harald Welte b2a3034826 bts: Add test for expiring T200 N200+1 times
Change-Id: I9e1dbc889575f8952a4581551076829825b3b1cd
2019-06-04 09:12:03 +00:00
Harald Welte a7d81f1761 RSL_Types: Fix definition of RLL ERROR INDICATION
This message uses the "RLM Cause IE" and not the "Cause IE"

Change-Id: If3b92ab475817922c05c9af691d9f79da33804ac
2019-06-04 09:12:03 +00:00
Harald Welte ef6fd44965 bts: Also test SACCH in TC_segm_concat
Change-Id: If9b51b4d6c357aa015f31e1e6851d4d1bb71a58f
2019-06-04 09:12:03 +00:00
Harald Welte 9ea918c2a8 bts: Add TC_segm_concat to test segmentation+concatenation
Change-Id: I6a9ce3e27f4a01412186b3b5d8d2b86573b6f8ac
2019-06-04 09:12:03 +00:00
Harald Welte 2f2b2b7f95 bts: Extend LAPDm test suite with a number of new tests
This adds the following test cases to BTS_Tests_LAPDm.ttcn:
* TC_sabm_retransmit_bts()
* TC_sabm_invalid_resp()
* TC_sabm_dm()
* TC_establish_ign_first_sabm()
* TC_iframe_seq_and_ack()
* TC_iframe_timer_recovery()

Change-Id: I4e1136c0c0f10d5bc8d01e826ae5d92f17a0b2aa
2019-06-04 09:12:03 +00:00
Pau Espin e6f071fe57 sgsn: Add tests to check GTP retransmit queue
Change-Id: I3c4a3573482bb1fa1549c732a0f78c2d00eadd86
2019-06-04 08:38:13 +00:00
Pau Espin f8034480a0 msc: Fix Iu tests timing out due to explicit CM ServiceAccept not recvd
Even if ciphering it not enabled, osmo-msc still sends a
SecurityModeCommand to use IntegrityProtection, and as a result osmo-msc
assumes implicit ACCEPT in all UTRAN CM service requests.

Fixes: OS#3991
Change-Id: Ida91f907dd6dfae68cbc63752ddc6f2948792689
2019-06-03 14:04:50 +00:00
Harald Welte 1365a4e7c5 LAPDm_RAW_PT: Fix handling of LAPDm on SACCH (L1 header)
The  existing implementation dind't account for the two-byte L1 header
preset on the SACCH in both uplink and downlink.

Change-Id: Iae97ad153e9d1688306b39b5fb43ade323dbe500
2019-06-02 23:29:05 +02:00
Harald Welte 66f07549b7 LAPDm_RAW_PT: Switch to dedicated channel without RACH+IMM.ASS
Change-Id: I07dd9191ca441bfd1e43e3521e98f88ad2d0489a
2019-06-02 22:36:15 +02:00
Harald Welte 104740610e bts: don't require users to pass test case name to f_init()
The f_init() function itself can very well derive the identity using
the built-in testcasename() function.  There's no need asking users
to do that - many of them don't do it in the first place :/

Change-Id: I17a61a84fba4df31b8baab1f631c8aa55d894dbd
2019-06-02 22:36:15 +02:00
Harald Welte 61332c0367 bts: BTS_Tests_LAPDm.ttcn: rename f_init() to f_lapdm_init()
This is to avoid name clashes with f_init() from BTS_Tests.ttcn

Change-Id: Ie6272165b1dbda53d2d02af43c8e969da7a54d2e
2019-06-02 22:36:15 +02:00
Harald Welte 72c81e7cbc bts: Remove one indent lvel from BTS_Tests_LAPDm.ttcn
Change-Id: I4637393df9989a97a4d70f08bd334d0f8cfd2284
2019-06-02 22:36:15 +02:00
Harald Welte c38611bab5 bts: Derive test component that talks RSL and LAPDm
Change-Id: I6e24c6f6a904c4c051780c35af82c3bd53c970ce
2019-06-02 22:36:15 +02:00
Harald Welte 97cca2f5cb move lapdm/L1CTL_Test.ttcn to bts/BTS_Tests_LAPDm.ttcn
Change-Id: Ibbc967f0bd9a19ab4bbd17f612654d72cb32d571
2019-06-02 22:36:15 +02:00
Harald Welte ba0c81bf3f lapdm: Rename 'dummy_CT' to more reasonable 'lapdm_test_CT'
Change-Id: If72542f665a814bcda7c41120675a57ccf3407f4
2019-06-01 23:14:50 +02:00
Vadim Yanitskiy 7c2c10cbf0 BTS_Tests.ttcn: introduce TC_ho_rach() for handover RACH
The idea of this test case (as can bee seen from its name) is to
verify handover RACH detection. What we basically do is:

1. Activate a logical channel on the BTS side (HO_SYNC for now);
2. Switch the MS (e.g. trxcon) to that channel without waiting
   for Immediate Assignment and sending Access Burst;
3. Send an Access Burst on that channel using RA = HO_REF;
4. Wait for RSL HANDOver DETected from the BTS;
5. Release a dedicated connection.

There is no way to verify if the Handover Reference received
from the MS matches the one that was sent to the BTS. We can
introduce a separate test case that would just send an Access
Burst with RA != HO_REF.

Change-Id: If2e8d9c9947823df62f4bcc9a7fcd20734ff7858
Depends on: (trxcon) Ia967820a536c99966ba2c60b63d2ea9edb093f46
2019-06-02 02:03:16 +07:00
Vadim Yanitskiy ab448a516a library/RSL_Types.ttcn: t(r|)s_RSL_CHAN_RQD: make chan_nr configurable
Change-Id: I89e9286e86b09ed54eb7749d107f5d8d57b93644
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy e432ba9222 L1CTL_RACH_REQ: make both chan_nr and link_id configurable
Change-Id: Ica6b9551b11c20fa0b8f4a8dcdc91ca07601642c
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy 0a8d6daa65 L1CTL_Types.ttcn: accept SacchL1Header in ts_L1CTL_DATA_REQ_SACCH
In BTS_Tests.ttcn we used to compose L1ctlDataReq manually. This
can be done by ts_L1CTL_DATA_REQ_SACCH() template itself, so
let's abstract BTS_Tests.ttcn from doing that.

Change-Id: I1ae948bd0314cdf15c21ce4b6346d5e32f1fcf95
2019-06-01 14:03:42 +07:00
Pau Espin 690d6593e9 msc: Add module param to disable osmux (fix msc-latest jenkins job)
ttcn3-bsc-test-latest currently fails on most tests because it tries to
use "osmux off" VTY param and only current osmo-msc master supports
it.

Change-Id: I53d58b2d905905ebf1df322d0389b3715a48212f
2019-05-31 20:42:41 +00:00
Pau Espin 3dd33bc8f6 msc: Enable/disable osmux always based on test
Initially it was thought safe to only enable it since the osmux test was
at the end, but actually IU tests run after it, and those don't expect
osmux to be enabled.

This way we also always match osmo-msc osmux state with whatever the
test expects (and sets through f_init()).

Change-Id: I8fb48af7d37f1a2391a39c19f5ec5064cd5869d2
2019-05-31 20:42:41 +00:00
Vadim Yanitskiy 2f01fbd040 ts_TRXC_FAKE_RSSI(): define RSSI range, allow signed values
Change-Id: I8944e690c0da648eae3005777f2487c77b66a17b
2019-05-31 20:41:57 +00:00
Harald Welte 32658b31c9 lapdm: fix comment 'thinko' about which type of message is retransmitted
Change-Id: I6585fc9f7e5e9fb57fe65372d0a14d68a939b73a
2019-05-30 15:44:05 +02:00