Commit Graph

72 Commits

Author SHA1 Message Date
Philipp Maier 88f4ae890f BSC_Tests: use isvalue() instead of isbound()
Currently we use isbound() in f_start_handler() to check if the BTS
which we want to connect is indeed populated. However. isbound()
seems never become true in this particular situation.

- Use isvalue() instead of isbound()

Change-Id: I25ddd55b7626087570311999b85ec7632b162c06
2018-03-01 14:32:59 +00:00
Philipp Maier 282ca4b49a BSC_Tests: try to avoid race condition
When the test component ends and the underlaying
components are shut down. Messages from the system
under test may still be picked up and forwared. When
a message is handed from one component to one that
is already shut down, the testcase is flagged as
errornous setverdict(error).

An idea to fix thisis to stop all test ports using
all port.stop. However, this does not solve the
problem entirely. We still observing errors.

- add f_shutdown_helper() and call it from the
  end of each testcase

- perform an all port.stop; in f_shutdown_helper()
  to freeze all communications between the ports
  of the different components.

Change-Id: Id3bc840c0428d08dfbeedacc408b3dd1cd0fa7ec
2018-02-28 09:45:23 +00:00
Philipp Maier 1e6b442263 bsc: fix TC_paging_imsi_a_reset
The testcase TC_paging_imsi_a_reset sends a paging request that
causes pagings on all cells. Then it performs a BSSMAP reset and
checks if the paging has stopped. In order to be sure that paging
requests from before the reset procedure are not mistakenly
detected as after-reset-pagings the RSL queue is cleared. However
this is only done for IPA_RSL[0], which means IPA_RSL[1] and
IPA_RSL[2] still contain old paging requests, which lets the test
fail.

- Clear IPA_RSL[1] and IPA_RSL[2] as well.

Change-Id: If0cdc0325fd0e1dcf3e4ce52e4de27adb4d9cf48
2018-02-23 18:10:46 +00:00
Harald Welte 89ab1914e4 BSC: Add CCHAN_PT recently introduced in RSL_Emulation
RSL_Emulation has recently gained a port for the common channel
management messages, but BSC_Tests was not updated with this port,
resulting in RSL_Emulation enqueuing messages to the port which then
creates dynamic test case failures.

Let's simply connect to the port, even though we currently are not
interested in any of the messages received there (mainly
RSL_MT_BCCH_INFO during startup).

Change-Id: Id8a3c4409599783ca4cd0b49f2570bcb3bb34952
2018-02-23 19:03:54 +01:00
Philipp Maier 8c04b0aa32 bsc: fix testcase TC_paging_imsi_nochan
The testcase TC_paging_imsi_nochan assumes that a paging for no
channel, with no specifc cell associated and without TMSI is
illegal. This is not correct. All these fields have legal values
and the TMSI field is optional.

- Replace the testcase implementation, use f_pageing_helper() to
  create the paging.

Change-Id: I6a56fb0ee06ae7e72a7ac2b6b058ad54f94127ab
2018-02-23 13:53:46 +01:00
Stefan Sperling 830dc9d07b Add tests for OS#2714, "close RSL connections from unknown Unit ID".
This adds two new tests: One for RSL, and a second one which performs
the same test on the OML port. Both tests open an IPA connection and
send a unit ID which is unknown to the BSC. The tests expect the BSC
to close the connection immediately.

We need to add handling for a socket error in IPA_Emulation because
otherwise these tests do not pass reliably as some closed connections
are not properly detected.

Change-Id: I6a947d7411a016e4d7650031396cae3575756453
2018-02-19 13:06:09 +01:00
Philipp Maier 779a7923c7 BSC: add TC_paging_counter to control section
The testcase TC_paging_counter is missing in the control section.
This means that if it is not started explicitly, it is not executed.

- Add TC_paging_counter to control section

Change-Id: Ie37b8cb554ea1db64a8d7927eb300d368ce67137
2018-02-16 19:09:00 +01:00
Philipp Maier 956a92f036 BSC: Do not access unbound BTS objects
BTS[1] in function f_start_handler() is not always populated.

- Check BTS[1] before accessing it.

Change-Id: I37fdf7e6ef521677613f4eadc6f1ea236c04ce8e
2018-02-16 19:09:00 +01:00
Harald Welte 261af4b501 WIP: Intra-BSC handover testing
Change-Id: Ic47e639a7c8640c736c84a44780fc8e111a64b52
2018-02-13 08:15:33 +01:00
Harald Welte bc03c7693f bsc: Add VTY module to BSC_Tests
Change-Id: Ia78f1231f56fc5f3b003bccc850ea109ed4ed2d8
2018-02-13 08:15:33 +01:00
Harald Welte a4ca446034 WIP: Prepare MSC_Tests for ability to emulate two BSCs
Change-Id: Ibe3ae6ed4181c6ba7501f5443b4f22e3c8abeb3e
2018-02-13 08:15:33 +01:00
Philipp Maier e8f38ed2b3 BSC: do not flush RSL queue early in TC_chan_rel_a_reset()
When f_expect_chan_rel() is called after receiving the BSSMAP
RESET and DISC.ind f_expect_chan_rel() is called. The flush
parameter is not set, which means the default flush = true is
valid. This leads into an early flush of the RSL Queue and
tosses the RSL RELEASE REQUEST we expect, so the test can not
pass, even when the BSC sends the RLEASE REQUEST.

Looking further up in the code. IPA_RSL[0].clear is called,
so the Queue is flushed to get rid of unwanted messages from
the IMMEDIATE ASSIGN. There is no need to flush the queue
a second time anyway.

- Do not flush the RSL queue, set flush=false when calling
  f_expect_chan_rel()

Change-Id: I2962f741e0b13dec08ac6c918d326828beb65a6a
2018-02-10 10:09:28 +00:00
Harald Welte e9e02e4556 bsc: Add TC_err_84_unknown_msg to check if unknown RR message triggers RR STATUS
... as declared in TS 24.008 Section 8.4

Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a
2018-01-31 23:37:14 +01:00
Harald Welte e3bd658abf bsc: reduce code duplication; add new test case on too short messages
Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185
2018-01-31 23:37:14 +01:00
Harald Welte ea99a000ea bsc: Add TC_unsol_ass_compl / unsolicited assignment complete
Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f
2018-01-31 20:47:04 +01:00
Harald Welte fbf9b5eafd bsc: Add TC_unsol_ho_fail test case for unsolicited handover failure
Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea
2018-01-31 20:47:04 +01:00
Harald Welte 898113b838 bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion
Related: OS#2902
Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93
2018-01-31 18:50:41 +01:00
Harald Welte beb9dbc3ee bsc: Change expectation in paging tests
When we page an unknown/unsupported CellIdentifier format, OsmoBSC
decides to page on all BTSs to be safe.  This way we have a chance of
making communication happen, rather than breaking it.

Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea
2018-01-31 18:50:36 +01:00
Harald Welte 751d3eb19f BSC_Tests: Implement remaining missing paging tests
We now test all of the cell identification types specified in BSSMAP,
and also lists with a length != 1 entry.

Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b
2018-01-31 16:08:26 +01:00
Harald Welte 2fccd98a63 BSC_Tests: fix f_pageing_helper() in case no paging was expected
We have to wait for sime time until some RSL paging command would have
arrived, rather than continuing too quickly.

Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94
2018-01-31 16:08:26 +01:00
Harald Welte 9e4273ef7e bsc: Permit MGCP messages from random ports on BSC side
Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb
2018-01-29 21:35:13 +00:00
Harald Welte f70df65570 RSL_Emulation: Permit registration of explicit Channel Number
During assignment or hand-over, a given TTCN-3 component may be
interested in registering more than one channel number.  Add an explicit
procedure port with associated registration procedure, similar to what
we already do in GSUP, MNCC and others.

Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb
2018-01-29 21:35:13 +00:00
Harald Welte 5cfa867ba1 bsc: Fix TC_paging_imsi_nochan
The point of this test is to verify that *no* paging messages are sent
if "No cell" is given as cell identifier list by the MSC.  We can thus
not use the existing pageing_helper function, but have to handle this
a bit differently.

This makes TC_paging_imsi_nochan runs pass.

Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30
2018-01-29 21:35:12 +00:00
Harald Welte 725844b3cc bsc: Fix TC_chan_act_ack_est_ind_refused()
This test case was incomplete in that it didn't account for a RLL REL
REQ/RESP before RF_CHAN_REL.

Together with OsmoBSC Change-Id
I64a46b5bcd4272e3fa2ff4ee824c2f3fdff6854b, this test now passes.

Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9
2018-01-29 21:35:12 +00:00
Harald Welte f77aef6d02 bsc: Fix TC_chan_act_ack_est_ind_noreply()
This test case was incomplete in that it
* applied the wrong timeout T3101 instead of T3210
* didn't account for a RLL REL REQ/RESP before RF_CHAN_REL

Let's fix it. Together with OsmoBSC Change-Id
Ie11d7d06353ba1b1e2fab6763dd7b032ce8a5d2c this check now actually
passes for the first time.

Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b
2018-01-29 21:35:12 +00:00
Harald Welte 91d54a569c bsc: reduce code duplication by introducing f_expect_chan_rel()
The handling of channel release is copy+pasted, let's introduce
a shared function.

Change-Id: If74b0838187f60004b7daf6176db259af511bf87
2018-01-29 21:35:12 +00:00
Harald Welte 6ff76ea569 bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm
In OsmoBSC Change-IdI68286d26e2014048b054f39ef29c35fef420cc97 we
introduce a proper subscriber connection state machine which fixes
the order of events during channel release after connection failure.

Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c
2018-01-29 21:35:12 +00:00
Harald Welte dd8cbf3640 bsc: Update TC_exhaustion to recent osmo-bsc
When Change-Id I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 was merged,
OsmoBSC started to always allocate SDCCH first, no matter what the
establishment cause.  This basically means we don't do very early
assignment anymore.  TC_exhaustion must be adapted to allocate all
SDCCH and all TCH before failing.

Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082
2018-01-29 21:35:12 +00:00
Harald Welte 99740c83d3 bsc: Don't test CTRL commands for old NITB parameters
Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5
2018-01-29 21:35:12 +00:00
Daniel Willmann 191e0d9260 bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler for MGCP
forward-ported by Harald Welte

Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5
2018-01-29 21:35:12 +00: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 67089ee9a4 BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler
... and pave the way from using it on the other side in MSC testing

Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2
2018-01-21 19:31:09 +01:00
Stefan Sperling b041b3d339 Test control connection status query for MSC 0.
This new test exercises the new 'msc.0.connection_status' control
command which is added in https://gerrit.osmocom.org/#/c/5630/

Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099
Related: OS#2729
2018-01-12 14:25:44 +00:00
Harald Welte 38b2a10e0b BSC_Tests: Fix TC_assignment_fr_a5_4
Don't expect the ASSIGNMENT to fail in case of unsupported A5/4,
but expect a CIPHERING MODE REJECT.

Change-Id: I15024f61e67795b7e5ce72e1b641db6ca92ff76d
2017-12-25 00:00:58 +01:00
Harald Welte 4532e0a145 convert TC_assignment_sign to 'new style' tests
the use of the MSC_ConnHdlr automatically handles the MODIFY on
both RR and RSL level.

Change-Id: Iad7122ff5220ffc1640d802db47b1aa97986ed5b
2017-12-23 02:29:46 +01:00
Harald Welte 1b473ca34d BSC_Tests: Delete unused/dead code
Change-Id: Ife089a2c292f4eae7a7c76dd2f112e7821f02cda
2017-12-17 20:25:53 +01:00
Harald Welte 21b46bdb74 BSC_Tests: Update readme + source code comments
Change-Id: I7b7d0e504e3e94077d674b464f39bd8851941922
2017-12-17 19:48:03 +01:00
Harald Welte f0d6ac6d80 BSC_Tests: reduce amount of sleeping to speed up test suite
Change-Id: Ifd956556969467d4f059d2c8e58a924eb7ec0418
2017-12-17 17:02:45 +01:00
Harald Welte 44bdaa5bad fix TC_ctrl expectation: We expect 3 BTSs
Change-Id: I4ba5d357474d43c3065858bfa18bf73f1c4eba5d
2017-12-17 17:02:45 +01:00
Harald Welte 89d42e8fe9 BSC_Tests: Only start the number of BTSs required for a given
Change-Id: Ife3ec4900a73a29c2ef258a5a9d38b95ced8dc86
2017-12-17 17:02:45 +01:00
Harald Welte 73cd271a56 BSC_Tests: Implement ecnryption related procedures
Let's verify the operation of the CIPHERING MODE COMMAND as issued
by MSC, performed by BSC and implemented by simulated BTS/MS.

Change-Id: Ibc06bd2177c63837a794a0ca1f54ebef17499e78
2017-12-17 13:24:39 +01:00
Harald Welte 552620d570 BSC_Tests: Migrate various ASSIGNMENT tests over to MSC_ConnHdlr
This way we benefit from the ability to handle the RR MODE MODIFY,
RSL MODE MODIFY, IPA CRCX and IPA MDCX capabilities of the MSC_ConnHdlr
component.  While each test case now needs a separate function in
addition to the actual testcase, this allows for more flexibility
and a more complete emulation of BTS behaviour.

Change-Id: Iba50663cb5104bf34bd6fc8aac2aa3b47155fe99
2017-12-17 13:24:39 +01:00
Harald Welte c1a2fff5e0 BSC_Tests: Re-wire MSC_ConnectionHandler to handle BSSAP and RSL
Using the MSC_ConnHdlr component, we can now handle the BSSAP (MSC)
and RSL (BTS) side of a single radio channel.

Change-Id: I00dcf1e4eaa7f133788cc01fbbcd4148a0258ef4
2017-12-17 13:24:39 +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 f1b64e208f BSC_Tests: Ensure MSC passes SpeechCodecList in AoIP ASSIGNMENT
Change-Id: I66deffc50b5adcc8707747c0baa2e65ee36bf18e
2017-12-15 14:56:48 +01:00
Harald Welte 235ebf1b9c BSC_Tests: Add whole bunch of new assignment tests
Change-Id: Ia7304f2e2265c2ebd92575a9403b082579397656
2017-12-15 14:19:10 +01:00
Harald Welte cfe2c962a7 BSC_Tests: Add TC_outbound_connect to test if BSC rejects inbound SCCP connections
Change-Id: Ie9087df9ff9b48c8be242b1ae66cbca936b07121
2017-12-15 14:19:10 +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 16a4adfa5f BSC_Tests: Add TC_assignment_cic_only (AoIP Assign. must fail with only CIC)
Change-Id: Iee7202841ad8466a65b5d54679262be100863e39
2017-12-15 14:19:10 +01:00
Harald Welte 4e9b9cc114 BSC_Tests: Add test case for RSL link drop counter
Change-Id: I7b692cceaed07c112f8c62b87081cfdb322c8120
2017-12-14 18:31:02 +01:00