Commit Graph

393 Commits

Author SHA1 Message Date
Neels Hofmeyr 92d4842022 bsc: fix TC_chan_rel_hard_rlsd_ms_dead: ignore RLL REL
The intention is to ignore RLL REL requests, and not to actually block the alt
statement in f_expect_chan_rel() if any RLL REL messages show up.

Change-Id: I3bbcdc41d186a3464cd4adb5c5b770bdec056993
2018-06-16 15:58:03 +02:00
Pau Espin a4cecf5af7 Add README.md file for several suites
Content grabbed from [1] and converted to markdown as it's more probable
to have it displayed correctly on popular git repo hosting platforms.
Syntax for embedded graphviz taken from [2].

[1] http://git.gnumonks.org/laforge-slides/plain/2018/osmodevcon2018-ttcn3_test_suites/osmodevcon2018-ttcn3_test_suites.adoc
[2] https://github.com/stlehmann/markdown-graphviz

Change-Id: I9aad03e605569e9613665a7585d60bf308bcb54f
2018-06-14 18:55:36 +02:00
Harald Welte 99f3ca0c48 bsc: Add TC_{early,late}_conn_fail()
Those test cases simulate a BTS-originated RLL CONN FAIL IND at
"unusual" time:

a) before we actually establish any RLL
b) after / while we're tearing down the RLL

This is triggering an osmo-bsc segfault, see OS#3182.

Change-Id: I324c410d7565c189dbc91df577d92b87c036732c
Related: OS#3182
2018-06-14 12:36:13 +00:00
Harald Welte 641fcbe890 bsc: Factor out duplicated code into f_exp_chan_rel_and_clear()
There's a sequence of commands which was repeated over at least
four test cases.  Let's factor this out into the new
f_exp_chan_rel_and_clear() function, and use that function from
all the former copy+pasted sections.

Change-Id: Ic6791fce4e8787e38b818a12ed526d3e47f313ef
2018-06-14 12:36:13 +00:00
Alexander Couzens 02496257f6 *.default: change logging filemask from ERROR | WARNING to += PARALLEL | VERDICTOP
PARALLEL | VERDICTOP will log when the port is dying or when other
components will change to fail. This helped to find a timeout in the
SGSN tests where a function call message timed out.

Change-Id: I770ac964dc37e2752e7d35e493f707b091c739b0
2018-06-12 13:51:14 +02:00
Harald Welte 550daf97b7 bsc: Add TC_chan_rel_hard_rlsd_ms_dead
In this test case, the MSC performs a hard SCCP release of the
SCCP connection.  This makes the BSC send a RLL REL REQ on the lchan,
but we simulate a broken/lost MS which doesn't respond to that.

Current OsmoBSC master will fail this test, and that's exactly why we
need it.

Change-Id: I800168499c2ab30af72625aba6fc740bc16e5653
Related: OS#3333
2018-06-11 19:22:13 +02:00
Harald Welte c3260d9a4c bsc: Reduce TC_bssap_rlsd_does_not_cause_bssmap_reset to 4 lchan
This test establishes an SDCCH for each iteration.  However,
* due to OS#3333, osmo-bsc is currently not properly releasing those
  lchan's,
* due to OS#3222, we furthermore don't allocate "larger" channels like TCH

and as a result on a combined CCCH system we only have 4 SDCCH, which
is less than the 8 that we try to use here.

Change-Id: I0f7fff54248a505387bdfe105259e8ad10ce6c77
Related: OS#3333
Related: OS#3332
2018-06-11 17:48:16 +02:00
Harald Welte 32574eef07 bsc: Avoid duplicate DISC.req in TC_bssmap_clear_does_not_cause_bssmap_reset()
Change-Id: I11b4a1e95dcc522f2a9c14a8b625eab2356a1c18
2018-06-11 15:22:59 +02:00
Harald Welte a189718a4e BSC_Tests: ensure different RA+FN in *_does_not_cause_bssmap_reset()
For each of the SCCP/BSSMAP connections we create, let's make sure we
use a different RA and frame number, to make sure the test is more
realistic, and to aid any debugging.

Change-Id: I35540979c38d46f03702812e93742d7db772c533
2018-06-11 15:22:59 +02:00
Harald Welte 935fbe336a bsc: Don't expect BSC to release SCCP in LCLS.TC_lcls_connect_clear()
While osmo-bsc was still affected of OS#3331, it would release the SCCP
connection from the BSC side.  This is illegal as per 3GPP spec and
has meanwhile been fixed in osmo-bsc master.  However, the testcase
BSC_Tests_LCLS.TC_lcls_connect_clear() relied on the broken behavior,
let's fix that.

The testcase now releases the SCCP connection from the simulated MSC
side in response to the BSSMAP Clear Complete from the BSC.

Change-Id: Ic3e1f8729a093b04941ec7ca72664d53adb21229
2018-06-11 15:22:59 +02:00
Neels Hofmeyr beb58a6020 update expected results: bsc, sgsn
Change-Id: Icc8bb648b3c79b2e29450ca38dd95bad1d2d09aa
2018-06-07 15:47:26 +02:00
Harald Welte 343b774d21 bsc: Fix f_establish_fully() for cases where we expect ASSIGN FAIL
When f_ass_patch_lcls() was recently introduced during LCLS support
patches, we broke any testcases that *expected* an ASSIGNMENT FAIL
by overwriting the ASSIGNMENT FAIL with an ASSIGNMENT COMPL.

This patch fixes f_ass_patch_lcls() to only patch 'assignmentComplete'
members, if this assignmentComplete is actually chosen.

This fixes BSC_Tests.TC_assignment_fr_a5_1_codec_missing

Change-Id: I64fbf4cc3178a91913143960475a0d3758779ced
2018-06-05 21:45:02 +00:00
Harald Welte 5d50a283ee bsc: Enable LCLS in osmo-bsc.cfg
Change-Id: I39b0812423dd22f677334ad0ac406a23a1214fa9
2018-06-03 15:15:25 +00:00
Harald Welte ff579f90e5 LCLS: Introduce a copy+pasted f_connect_handler() function
... using the original one is hitting a ttcn3_compiler bug in
TITAN 6.3.1, see https://www.eclipse.org/forums/index.php/m/1789918/

Change-Id: I7c2dfd3c6e63b54c019fba0c07a1bb777d68f6b5
2018-06-03 10:34:22 +00:00
Harald Welte cc0b014903 bsc: Add LCLS related test cases
This is an early WIP, we actually will need to establish two calls/legs
before the BSC is able to locally correlate them.

Related: OS#1602
Change-Id: Ie6d0b9c38027abf65c7c564fc79b889d013fa6a7
2018-06-03 10:33:41 +00:00
Harald Welte 75b3426009 bsc: Disable verbose logging of MGCP encoder/decoder
Change-Id: I8147029a20828e762819be35ffebd801b22d2b6b
2018-06-03 12:29:45 +02:00
Harald Welte cbe911cbf4 bsc: Derive MGCP EP + Port numbers from new g_pars.media_nr
Change-Id: I44b46c9bc8f13eed9b3d18a6ce67980d2af0d46a
2018-06-01 18:35:24 +02:00
Harald Welte e102eae88c BSC_Tests.ttcn: mark some functions as non-private
Change-Id: I25301d27510cbe41c09d4fd81c07d453c5f5b4ef
2018-06-01 18:35:19 +02:00
Harald Welte 336820cf5e BSC_Tests.ttcn: Split f_connect_handler() off f_start_handler()
In case we want to derive other component types by extending
MSC_ConnectionHandler, we will want to connect additional ports
before starting the component.

Hence, split the connect part into f_create_handler(), while keeping
the create + start part in f_start_handler().

Change-Id: If272816b7e720e8b8f000f7ab8baa20619b35fb7
2018-06-01 18:25:57 +02:00
Harald Welte d68d2f0c0d bsc: Remove duplicate f_sleep() function, we have one in Osmocom_Types
Change-Id: Ic0ccca39be48dc2d42b92d433dcb5c6d65adbb33
2018-05-31 20:59:43 +00:00
Stefan Sperling 68a9b35746 expect previously failing paging tests to pass
Two paging tests were failing in Jenkins due to a configuration problem.
This has now been fixed so we can expect these two tests to pass:
TC_paging_imsi_nochan_lac
TC_paging_imsi_nochan_lai

Related: g#9361
Related: docker-playground 4147adabb9917fd852cc49c93603f379ec810c6b

Change-Id: I1a3dc5fb13385549bb9ec523271a5da5dc6aaa8c
2018-05-29 16:08:15 +00:00
Stefan Sperling 2ace5a20c1 sync local osmo-bsc.cfg with that used by jenkins
The osmo-bsc.cfg file in docker-playground/ttcn3-bsc-test contains
codec, encryption, and ipaccess settings which were missing from
the corresponding configuration file in this repository. This caused
spurious test failures when running BSC_Tests outside of Jenkins.

Change-Id: If392dcd42fb741c7ab8ae204bbefde89f05f0afe
2018-05-29 17:09:41 +02:00
Philipp Maier 2300073379 BSC_Tests: fix TC_ciph_mode_a5_{0,1,3}
The helper function f_tc_ciph_mode_a5(), thich performs all of the
three tests currently disables the ASSIGNMENT COMMAND since due to
a bug in OsmoBSC a MODE MODIFY would be attempted by the BSC,
causing the testcase to fail.

The problem in OsmoBSC is now fixed and the ASSIGNMENT COMMAND can
be re-enabled again for this test. However, the test function
includes and expects an AoIP transport layer address, which is
not included for signalling assignments.

- Make sure no AoIP transport identifier is included in ths
  ASSIGNMENT COMMAND

- Do not expect an AoIP transport identifier in the
  ASSIGNMENT COMPLETE from the BSC

- Re-Enable the generation of the ASSIGNMENT COMMAND

Change-Id: Ib39d7dd2d1b3665570d7b287e431d10111316437
Closes: OS#2936
2018-05-28 10:21:42 +02:00
Philipp Maier 8ef527e75c MSC_ConnectionHandler: check channel mode in f_establish_fully
The helper function f_establish_fully() checks the channel type
for compatibility. If the channel type is compatible with the
desired mode a channel mode modification could be necessary if
the current channel mode is different from the desired channel
mode. However, this is not checked at the momemend. We just
blindly expect a MODE MODIFY message from the BSC and ignore
the cases where the current channel mode and the desired channel
mode already matches up. This is the case if only a signalling
channel is requested with f_establish_fully for example.

- Check if the channel mode of the current channel and the
  desired channel mode match up.

- Make sure that the MODE MODIFY from the BSC is only
  expected when the channel modes are different.

Note: The function f_channel_needs_modify() that is used
to determine if a channel modification is needed or not
does not cover all cases yet. (see fixme note)

Change-Id: I9004f299220b01ecea6b2316ba3f913c316947dc
Closes: OS#2762
Related: OS#2936
2018-05-28 09:33:35 +02:00
Harald Welte 4bcbd17aa4 Fix BSSMAP RESET in handler mode
This fixes I55c94f18531bb7e5369500dc90f4b0ff3a420774 which was
merged a bit too fast, it seems.

Change-Id: I42f663f47d38c9e0fd0c0148aacafbf0ecaf3448
2018-05-27 19:48:27 +02:00
Harald Welte d5833a8dcc BSSAP_Adapter: Split f_bssap_start() from f_bssap_init()
In non-handler mode, the SCCP emulation is currently started before
there's a user registered to SCCP_SP_PORT.  If the first BSSMAP
package arrives from the network, then the SCCP_Emulation will crash
as it cannot deliver the resulting SCCP user primitive to the user.

Let's split start from initialization, so user code can still register
something to SCCP_SP_PORT before starting SCCP_Emulation.

Change-Id: I55c94f18531bb7e5369500dc90f4b0ff3a420774
2018-05-27 15:33:27 +00:00
Harald Welte 8f67d1d387 bsc: Disable TC_assignment_fr_a5_1_codec_missing for SCCPlite
In SCCPlite, the codec list is always missing, and that's the
successful situation, not a failure case.  Let's run this test
only in AoIP scenarios.

Related: OS#2544
Change-Id: I01db7628c2b1c58419d544fc6fa311b9d9b59fb9
2018-05-25 20:56:58 +02:00
Harald Welte 17b27da90f bsc: TC_assignment_cic_only for IPA/SCCPlite
Of course a "CIC only" assignment will succeed in AoIP, so let's
invert the logic: Test "AoIP only" assignment in that case, and expect
it to fail.

Related: OS#2544
Change-Id: I3b8e5e6ec001f3cab6a00072ef0a7b97c13c278d
2018-05-25 20:56:57 +02:00
Harald Welte 79f3f54f2c bsc: Don't expect codec list in IPA/SCCPlite case
In classic non-AoIP-cases, OsmoBSC should simply return the
chosen speech version, but not any codec list in the BSSMAP ASSIGNMENT
COMPLETE message.  Let's adjust the expectations accordingly.

Related: OS#2544
Change-Id: Id8e2a749bce91cfadd316bc2d56d1289412b9026
2018-05-25 20:56:51 +02:00
Harald Welte ed848519f0 bsc: Alter Assignment Req + Complete depending on AoIP or SCCPlite
When sending BSSMAP Assignment Request, we need to decide if we want
to fill in the AoIP TransportIdentifier or the CIC.  The former
is needed in AoIP, the latter is needed for SCCPlite and classic SCCP.

Related: OS#2544
Change-Id: I8aa0cf2189101de49a6da81625226bdcbbaff027
2018-05-25 20:56:47 +02:00
Harald Welte b7b9c543f6 bsc: Update expected-results.xml with 3 new ciphering related tests
Change-Id: I2465016a7f355a657187d39c90992ade1afe584f
2018-05-10 23:04:00 +02:00
Harald Welte 3c86ea036d bsc: New test cases for encryption without assignment
The existing encryption related test cases are all testing a case
involving the assignment procedure.

This patch adds some new testcases that test encryption without
any assignment, like e.g. in a typical LU.

Change-Id: I443cd8127e76f70fcaa7bf1638c2219524fa9381
Closes: OS#3183
2018-05-10 22:28:05 +02:00
Harald Welte 7a14fd5c43 bsc: f_establish_fully(): Support non-assignment cases
If it's a pure signalling procedure (like LU), the MSC will never
even send a BSSMAP ASSIGNMENT CMD.  Our test suite should be able
to produce this kind of behavior by passing "omit" as assignment
comamnd to the f_establish_fully() function.

Change-Id: I9bb5c8c19518905cf1ce121aa0b433886ec594d5
2018-05-10 22:26:55 +02:00
Harald Welte 8a9bf6f215 bsc: Verify correct encryption n RSL CHAN_ACT during assignment
Change-Id: Iff77586ea39da32df570048b1d83f5a0edb5a533
2018-05-10 22:00:49 +02:00
Harald Welte 651fcdc7c0 bsc: Unify encryption related test cases
Rather than having copy+pate code, parameterize it.

Change-Id: Ifc554245f80b09309f2da60c9d17c289c331b22e
2018-05-10 21:35:01 +02:00
Harald Welte 8863fa1152 bsc: Avoid having to pass testcasename() to f_start_handler
Change-Id: If9a02bb192b224e5225a4a2f0e66b1f0254b0d46
2018-05-10 20:15:27 +02:00
Harald Welte e613f96593 bts: ciphering tests
Change-Id: If450e36cfd8cde713f304e57ec09bc1239bdf7ea
2018-05-10 18:36:59 +02:00
Harald Welte 0ea2d5efb4 bsc: Add TODO notes about extensions of PDCH tests
Change-Id: I3c0d338a9b8affe7f77c1b0b392999b5af668c71
2018-05-09 12:22:39 +02:00
Neels Hofmeyr de17222ead update expected results
bsc:
  TC_assignment_sign fails with different message

msc
 fixed:
  TC_lu_clear_request
  TC_emerg_call_imei_reject
  TC_cm_serv_req_vgcs_reject
  TC_cm_serv_req_vbs_reject
  TC_cm_serv_req_lcs_reject
  TC_cm_reest_req_reject
  TC_cl3_rnd_payload
  TC_lu_and_mt_sms
 new:
  TC_smpp_mo_sms
  TC_smpp_mt_sms

sgsn fixed:
  TC_attach_umts_aka_gsm_sres

Change-Id: Ie9ef25fb2081ebab7a2b08c06307fa391f8f747a
2018-05-02 12:03:52 +02:00
Harald Welte 7ef51aa2a2 BSSAP_Adapter: Introduce transport over IPA/SCCPlite
In addition to the existing 3GPP AoIP stacking, allow BSSAP to
run on top of a SCCPlite stacking.  Implement both the server and the
client role for IPA.

Related: OS#2544
Change-Id: Ie844c4de62e0ef5d5c4c366185968211a7f6d676
2018-04-17 21:49:05 +02:00
Philipp Maier 6a50c7cae0 BSC_Tests: Assign g_pars in TC_assignment_sign
The testcase TC_assignment_sign does not assign g_pars in its
test function. However, it assigns local variable pars but then
never uses it.

- remove local variable pars and assign g_pars instead

Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Related: OS#2762
2018-04-16 20:39:43 +00:00
Neels Hofmeyr 98d428da11 bsc, msc: update expected results
Mark TC_paging_imsi_a_reset fixed.

Add various new tests.

Change-Id: Ib3a36efeb086fd995d7dad4e040f5a46b1b1ca0a
2018-04-11 19:49:36 +02:00
Neels Hofmeyr fc0384a046 mask timestamps and source file nrs in expected-results.xml files
Prepare for upcoming updates with concise diffs.

Change-Id: Ic9f006aa8db1b477598605e0525faeb229b03641
2018-04-11 19:32:01 +02:00
Neels Hofmeyr 1fd6679d9d fix build: don't clean out expected-results.log: rename to *.xml
'make clean' as generated by ttcn3_makefilegen removes all *.log files, which
of course cleans out expected-results.log, which should not happen. Since this
is a junit XML file, rename the suffix to .xml.

Change-Id: Ic334f6b758eef865e3a497aa430691a3ae696d25
2018-04-11 19:29:18 +02:00
Neels Hofmeyr 9f23091dab bsc cfg: fix ARFCN-BSIC collisions
All three BTS are configured for ARFCN 871 and BSIC 63, which causes trouble
for handover tests. Set BSICs to 10, 11 and 12 (not 0,1,2 to mark the
distinction from the cell_identity).

It wasn't a problem so far since we cheated by passing the BTS target number
from VTY. But as soon as we will start identifying handover target cells by
ARFCN+BSIC exclusively, TC_ho_int would fall on its face without this patch.

See also: docker-playground I29a117aa54aa06ca49646f25a08af8521832fd8d
Change-Id: I2ea8889ea40953f5a23eab40db52585556a410bc
2018-04-11 01:24:48 +02:00
Harald Welte 94e0c3428e bsc: Testing of dynamic PDCH (both IPA style and Osmocom style)
This adds a set of four new testcases relted to dynamic PDCH switching:
One successful and one unsuccessful for each Osmo + IPA style dynamic
PDCH.

Closes: OS#3099
Change-Id: I7a7a937548a35461d86e93ead79c39a37a59563e
2018-04-07 19:28:01 +02:00
Neels Hofmeyr 3cf797d7a5 add compare-results.sh, call from start-testsuite.sh
Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
2018-04-06 01:07:15 +02:00
Philipp Maier 38d6894cd6 BSC_Tests: Add missing routing context to modulepar
The BSSAP_Configuration leaves the rctx parameter unbound.

- Make sure that rctx is set to 0

Change-Id: If0f08665694be8eba817a4525686a9a37caf1dbb
2018-03-29 15:46:31 +02:00
Philipp Maier cb6cc481d1 fix TCH/H for TC_chan_exhaustion
At the moment we use onle TCH/F and PDCH in our osmo-bsc config,
but the tests TC_assignment_codec_amr_h and TC_assignment_codec_h
requre a half rate channel in order to work. Configuring one TCH/F
to TCH/H seems not to hurt any tests except TC_chan_exhaustion

- also regard half rate channels in TC_chan_exhaustion
- change included sample osmo-bsc.cfg

Change-Id: Idd5a9602f1b49b5aa0fc510faa151fe16c0b404d
Related: OS#3100
2018-03-27 11:28:17 +00:00
Harald Welte 930d0a70e3 bsc: Fix tons of TTCN3 compiler warnings
Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
2018-03-23 12:32:00 +00:00
Harald Welte a63b91017a bsc: TC_assignment_codec_*: Verify RSL side codec/mode
Let's not only match if the BSSMAP ASSIGNMENT COMPL matches what codec
was requested in BSSMAP ASSIGNMENT CMD, but also verify that the
RSL side channel was activated with the right channel mode IE.

Change-Id: I6ef24b5b82a5c100ffffe056adadd26e69b968b9
2018-03-22 21:16:39 +01:00
Philipp Maier 8d540f0d4e BSC_Tests: remove obsolete VTY configuration
The settings concerning the IPA ping are a leftover from the
time where osmo-bsc used an IPA multiplex to support the the
SCCP lite A interface dialect. Since the related code is now
removed and osmo-bsc has been migrated to libosmo-sccp and
real AoIP interface, the configuration is no longer needed.

Change-Id: If67cdba2a043c5dbf23f998659c5000db924a7df
2018-03-21 23:57:30 +00:00
Harald Welte 60aa576a62 bsc: Add tests for assigning channels of all 5 codecs
This tests if the BSC is chosing the correct codec during the assignment
procedure.

Change-Id: Ia67c09fa725eff48ec56779f8674ddcaa08a8793
2018-03-21 22:48:18 +01:00
Harald Welte 6fa1f73346 MSC_ConnHdlr: Fix RlsChannelNr encoding in f_ChDesc2RslChanNr()
Make sure that the "tag" member of the RslChanelNr sub-structure
is always initialized.  This can be achieved without any extra code
by using the existing templates rather than hand-coding it.

Change-Id: I990ac8ac0ce51e11f1d683382c9fc2d4e1201aa7
2018-03-21 22:48:18 +01:00
Harald Welte e97eab4da4 bsc: Allow multiple subsequent calls of f_MscConnHdlr_init()
If the function was called once, don't start another VTY/telnet
component.

Change-Id: I47bdeb0417a6814ed3a3f5c0c5797bd1bc7a59ba
2018-03-21 22:48:18 +01:00
Harald Welte a0630034bd bsc: Move TestHdlrParams to global per-component var g_pars
Change-Id: Ifd811bab7719b205a6174e3f6ba367643dfcb0ec
2018-03-21 22:48:14 +01: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
Stefan Sperling 7b5e178290 make ttcn3 RNC paging tests pass
We do not implement paging by RNC. Fix test expectations accordingly.

Change-Id: I490fdaa9a73565c7e53e9a7eeafa0ee89c29b9d8
Related: OS#3073
2018-03-20 19:32:43 +01:00
Stefan Sperling 049a86ee1e add regression test for paging with unknown MCC/MNC
Verify that the BSC does not page a subscriber when a cell identifier
with an unknown MCC/MNC is provided by the MSC.

This test introduces a magic value which represents an unknown MCC/MNC
combination: MCC=678 MNC=f90

Change-Id: I0b0af14a9a1cb7e5a7a4ec12cc489473fd7ead02
Related: OS#2980
2018-03-20 15:51:00 +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
Harald Welte 12055479de bsc: fix shutdown
Change-Id: I23932927bd6bb9b5e447acbeafc2748a77513a0d
2018-03-17 20:30:39 +01:00
Harald Welte c306859aea bsc: Clear RSL port of all BTSs, not only those where we expect paging
After all, we don't want stale queue entries especially in those where we
are not expecting any paging.

Change-Id: Id876b68087ef13d58177027b7e664404e6b7b2d9
2018-03-17 20:30:39 +01:00
Harald Welte 24135bd27f bsc: Fix encoding of 2-digit MNC (paging tests)
The TTCN-3 data types are abstract data types,  Encoding artefacts
like 'F' for padding shouldn't be seen by the user.  Hence, let's
pass a 2-digit-long or 3-digit-long hexstring into the encoder
functions and let them determine if they should introduce any 'F'
for padding or not.

Change-Id: If4d3dfc16381493d7e710be746ed963975051fc1
2018-03-17 20:30:39 +01:00
Harald Welte 2caa106251 bsc: TC_paging_imsi_load: retransmit 'no paging buffer space'
If 5 seconds expire, the BSC will automatically re-fill a credit
of 20 paging slots [to work with BTSs where the paging buffer space
indications somehow are missing].  Let's make sure we don't hit
that case, even if the operating system sleeps for more than 5s
in this test .

Change-Id: I1c65096a685b70dc5183592382ec03553ba3628f
2018-03-17 18:21:48 +01:00
Harald Welte 3b57ab5d8f bsc: TC_paging_imsi_load: clear RSL queue before checking for paging
Change-Id: I27ce27b3f9e33e7696fee71032fe28ce9ea6327c
2018-03-17 18:21:48 +01:00
Harald Welte 8af4d797fa BSC_Tests: Fix TC_rsl_unknown_unit_id / TC_oml_unknown_unit_id
We are testing purely IPA/RSL/OML, and half-starting the BSSAP/M3UA
emulation is not a good idea, if it generatees events that we don't
catch

Change-Id: Ie90cd88e63ba6062e4ea2592045e9c97bc11887e
2018-03-17 18:21:48 +01:00
Harald Welte 6a12969ba8 BSC_Tests: Adjust TC_ctrl to match new '3 digit MNC situation
Change-Id: Ia19aeb1a7adf4f838bd289b0140a98501907d1ae
2018-03-17 18:21:48 +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
Stefan Sperling 83348bcfbf fix cell identifier generation in ttcn3 paging tests
The cell identifier used by the paging tests is 001-01, i.e. uses a
2-digit MNC. With the introduction of 3-digit MNC support in osmo-bsc,
the paging tests became incompatible with a osmo-bsc config with:

  network country code 1
  mobile network code 1

Explicitly declare a Cell_Identity with 2-digit MNC (includes an 'f').

Also, fix f_enc_mcc_mnc to properly encode 2-digit MNC values.

Related: OS#2847
Change-Id: Ide5228b403e43de8649b6eda18749ea2a9f592a9
2018-03-14 17:59:41 +01:00
Harald Welte 99ca30ce2e remove *.default from [EXECUTE] in *.default files
The problem is that the .cfg file cannot override the [EXECUTE]
provided list of tests

Change-Id: I7e1e0499b3b32014b25ae4b515263f57a4ea6daf
2018-03-13 14:30:55 +01:00
Neels Hofmeyr fd445c34fe bsc: add TC_ms_rel_ind_does_not_cause_bssmap_reset
bsc: add TC_bssmap_clear_does_not_cause_bssmap_reset(), but the same triggered
by an MS Rel Ind and a BSSMAP Clear Request sent to the MSC first.

This test will only succeed once TC_chan_rel_rll_rel_ind() succeeds, i.e. with
below osmo-bsc fix.

Related: OS#3041
Depends: I0f8c9c4e6b6850b15c70250fd3f88bdf75f9accf (osmo-bsc)
Change-Id: Ie4aa2f01c83b40303fa40ed64dbfce372b7cd96c
2018-03-12 04:43:16 +01:00
Neels Hofmeyr 27f643639e bsc: TC_chan_rel_rll_rel_ind: expect full MSC Clear Request
This test sends a REL IND from the MS and immediately expects an lchan release.
Instead, osmo-bsc patch I0f8c9c4e6b6850b15c70250fd3f88bdf75f9accf decides to
signal full BSSMAP Clear Request to the MSC first, so expect that first.

Note that this test currently fails, and said osmo-bsc.git patch will make this
test pass.

Change-Id: I737be141b69a250eb6eb38007f8042981c1a31cf
2018-03-12 04:43:16 +01:00
Neels Hofmeyr 4ff9328beb bsc: add TC_bssmap_clear_does_not_cause_bssmap_reset()
Same as TC_bssmap_rlsd_does_not_cause_bssmap_reset(), but with a proper BSSMAP
Clear from the MSC first.

Related: OS#3041
Change-Id: If6ca85d7b80a727cbfdabbf07529ced22602734e
2018-03-12 04:43:16 +01:00
Neels Hofmeyr cdc2d7690d bsc: add TC_bssap_rlsd_does_not_cause_bssmap_reset
A test with BSSMAP Clear involved would also be a nice addition, but this so
far tests a direct RLSD from the MSC.

(One way to invoke a typical release situation would be a scenario like in
TC_chan_rel_rll_rel_ind(), but that test currently fails; another would be to
directly invoke a BSSMAP Clear from the MSC first.)

Related: OS#3041
Change-Id: I168cf240383485a5ffbbde377b4f89c5d1f5ab93
2018-03-12 04:43:12 +01:00
Neels Hofmeyr cc3f76adb2 bsc: cosmetic: T_guard timeout: add 'self.stop'
If the T_guard runs out, unless we self.stop, we might run into this
potentially confusing follow-up error:

00:23:04.206712 mtc BSC_Tests.ttcn:322 Dynamic test case error: Copying an unbound value of type @RSL_Types.RSL_Message.
00:23:04.206778 mtc BSC_Tests.ttcn:322 setverdict(error): fail -> error

Change-Id: I1d373159483bdd9f74e8944e430913e73c289e03
2018-03-12 04:43:12 +01:00
Philipp Maier ffe5f0e546 MSC_ConnectionHandler: make sure altstep exists
The altstep as_handover does not exit as each of its branches is
equipped with a repeat statement on the end. This trapps us in
an endless loop.

- remove the repeat statement at the last logical step which is
  at the RSL_REL_REQ.

Change-Id: I8cb57a9fef606f459542708206f5ea4de1def7a1
2018-03-01 14:32:59 +00:00
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
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
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 2f8eed0aac BSC: Update BSC_Tests.cfg
The provided BSC_Tests.cfg, which contains as a commented line for
local debugging, does not contain all tests from the control section.

- Update BSC_Tests.cfg so that it contains all tests from the
  control section

Change-Id: I67f5906c3c67ae5793d88eee81b58ceac0bed658
2018-02-16 19:09:00 +01:00
Philipp Maier 70558e3780 BSC: add codec-list to osmo-bsc.cfg
The provided osmo-bsc.cfg does not contain any codec list, this
causes failure of the assignment related tests.

- add missing codec list

Change-Id: Id2509bcac4c54c910efd2db749eaa2085daa358d
2018-02-16 19:09:00 +01:00
Philipp Maier b8e8a1da0e BSC: remove obsolete loglevels from osmo-bsc.cfg
The provided osmo-bsc.cfg contains obsolete log levels.

- Remove obsolete loglevels

Change-Id: I00001c949b69ecaef8a8ed0163779a470378ab08
2018-02-16 19:09:00 +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 e057146df7 re-organize configuration files; add tcpdump integration
Let's make sure we share common configuration between the test
suites and split the config file into a "default" part which is
used (but not copied) in the Docker images, and a "local" part
which is basically those overrides that the user (or docker image)
wants to do from the default.

Change-Id: I3db452e24e5238aa05254d903739c64d202e61db
2018-02-14 18:50:16 +01:00
Harald Welte 261af4b501 WIP: Intra-BSC handover testing
Change-Id: Ic47e639a7c8640c736c84a44780fc8e111a64b52
2018-02-13 08:15:33 +01:00
Harald Welte c20b1c4207 MSC_ConnectionHdlr: Add telnet to VTY to each ConnHdlr
This allows each ConnHandler to issue telnet commands to the VTY

As a side-effect, it puts some more stress on the VTY interface,
as each [parallel] DchanHdlr now has its own telnet connection.

Change-Id: Ibd726af53219d829286da80b44ea4d9fb2ffdf3d
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
Philipp Maier c0375167da MGCP: remove hack to fake SDP
A problem with the parameter ordering inside the mgcp-client
(osmo-mgw) prevented TTCN3 from accepting the SDP data that
was generated by the IUT. The problem is now fixed and the
hack can be removed.

- remove hack

Change-Id: Ic37f78c2676e7c98144f10e9f3b55bc9651a4f7c
Related: OS#2818
2018-02-08 17:25:03 +01:00
Philipp Maier b20c3dcced msc: convert bssmap chipher to rsl chiper representation
The representation of the chiphering algorithm is different bssmap
and RSL. BSSMAP uses a bitmask and RSL a numeric value. For A50 and
A51 the values match up by coincidence, from A5/2 onwards they differ.

- Add a function to convert the BSSMAP representation to the RSL
  representation and use the converted value to set up the temlate
  for the expected RSL message

Change-Id: I274c1ff0b5636c48411f994f918e783b468cb3be
2018-02-08 15:17:30 +01:00
Philipp Maier 86f3920e5b bsc: fix f_establish_fully() for expected assignment failures
The altstep guard statements are to restrictive so they do not
match on an expected assignment failure anymore.

- Add a new altstep for expected assignment failures.

Change-Id: I78b839f0bcb7e2da61bff0add3abc452bfea40a2
2018-02-07 18:45:08 +01:00
Max 6367d7b807 Don't symlink non-existent file
Change-Id: I10309f07fb207c027703f0b43a478c152a029b6d
2018-02-05 16:58:27 +01: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 363cb0a394 bsc: Handle wildcard endpoint name in MGCP CRCX
MGCP permits for the CallAgent to send a wildcarded endpoint name,
at which point the MGW itself must allocate an endpoint name and
return it as SpecificEndpointId parameter in the CRCX response.

Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34
2018-01-30 20:10:56 +01:00
Harald Welte 1909f464af bsc: Unregister old RSL channel number after assignment
Change-Id: I27d113391094f938ff92c4d6514172ee634f695c
2018-01-29 22:35:41 +01:00
Harald Welte 21583088e8 bsc: f_establish_fully(): Wait for release of old channel
We shouldn't "pass" f_establish_fully() in the assignment case
as long as the old RF channel hasn't been released via RSL.

Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d
2018-01-29 22:35:41 +01:00
Harald Welte 211219ee1a bsc: Implement Assignment handling
This adds code for the rather intricated and nested transactions
happening on RSL, BSSAP, MGCP and RSL-IPA.  We use explicit
invocation of altsteps to simplify the main function f_establish_fully.

Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b
2018-01-29 22:35:41 +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 15510cbde5 bsc: Cosmetic: Update commented-out config file options
There's no point in listing non-existing module parameters. Instead,
list those that the BSC testsuite actually has

Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df
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 a3d192f1e4 bsc: Expect CRCX and send an ACK back
Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6
2018-01-29 21:35:12 +00:00
Daniel Willmann aeea76fe5d bsc: Reply to CRCX with ACK
Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df
2018-01-29 21:35:12 +00:00
Daniel Willmann 21ea2396a5 bsc: Register expect criteria for MGCP CRCX
Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e
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
Daniel Willmann 3826a1bd1d BSC_Tests: Add MGCP_Emulation to gen_links
Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01
2018-01-29 21:35:12 +00: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 0cf76ad9f7 Move BSSAP_Adapter.ttcn to library so it can be reused
Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42
2018-01-21 19:31:09 +01: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
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
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
Stefan Sperling 7159dbbce6 Fix BTS location area code assignment in test configuration.
The paging tests expect BTS 0 and 1 in LAC 1, and BTS 2 in LAC 2.
BUt the osmo-bsc configuration file had BTS 1 in LAC 2, and BTS 2 in LAC 1.

Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76
2018-01-09 13:19:46 +01:00
Harald Welte df32723446 GSUP Support and first test against OsmoHLR
Change-Id: Idd7a6aca1ab193da39294f49a3adc4c1cd7cecff
2017-12-28 23:17:24 +01:00
Harald Welte 2e1a1da674 bsc-test: Fix compilation after IuUP support was introduced
Ever since I46de7fb9c324654275a27aa5f8c1be70340e3229 we had problems
linking the object files together due to a missing object

Change-Id: I5d8c37f924b3a2c8b28cace4da2add1fadd0151a
2017-12-28 23:17:24 +01:00
Harald Welte 8098164721 RTP_Emulation: Integrate IuUP support
Change-Id: I46de7fb9c324654275a27aa5f8c1be70340e3229
2017-12-25 00:03:07 +01: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 1a40de6a7f MSC_ConnectionHandler: fix f_rsl_reply() for RSL_MT_ENCR_CMD
For some weird reason the link_id is *not* the second IE in
RSL_MT_ENCR_CMD, while it is in all other RSL RLL or DCHAN messages.

Change-Id: Iea93aa8dba74d25c74a257d011ba43308ee375e4
2017-12-23 02:29:46 +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 8b20f7c963 BSSAP_Adapter: Fix missing 'repeat' in as_reset_ack()
The as_reset_ack() exists to acknowledge any incoming RESET without
every test case having to deal with it explicitly.  However, of course,
the processing of an inbound RESET should not abort but the alt clause
shall continue.

Change-Id: I94dc72b5788ccc8dff2c4b80599c9fbf7e90e730
2017-12-22 20:40:38 +01:00
Harald Welte df32ab1be8 BSC_Tests: remove bogus line sfrom osmo-bsc.cfg
Those lines serve no purpose (and are being removed from osmo-bsc master)

Change-Id: Icf037e8cd9a51e676eac472b29c0d616a5632c5d
2017-12-18 08:40:39 +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 8d5eead70e MSC_ConnHdlr: Fix f_rsl_reply() for RSL_MT_ENCR_CMD
In all RSL messages the link identifier is usually the second IE.
However, as the only known exception, the RSL Encryption Command has it
as third IE.

Fixes the following error message:
Dynamic test case error: Using non-selected field link_id in a value of
union type @RSL_Types.RSL_IE_Body

Change-Id: I2bbb83b5394d0b693a47d286beed5c699ab6e8ae
2017-12-17 19:00:34 +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 82d2b87b47 MSC_ConnHdlr: Tighten permitted messages
Accept CRCX only once; Accept MDCX only after CRCX; Accept RSL MODIFY
only after RR MODIFY.

Change-Id: I44abdc3d000c76243f9885f0e30e15c2dc9aadaa
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 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 bab2f7a74f update README.txt with status of current implementation
Change-Id: Idd5ac4273975b5c0e3ea373f1b8f6d6b2e534c0b
2017-12-15 15:16:42 +01:00
Harald Welte b58e8a098d BSC_Tests: Update CFG with list of test cases
Change-Id: Ia3b8632e0528e862288f7c8565a2e1db04f9eebc
2017-12-15 15:11:19 +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
Harald Welte 799c97bb9d BSC_Tests: Add TC_chan_exhaustion to test for channel exhaustion
We ensure that all channels are allocated, and that the first allocation
beyond the avialable channels will fail and generate an IMM_ASS_REJ.

WE also verify that the related counters are incremented as expected.

Change-Id: Iade77321588190cec89cfcd9c18d84a7144e0198
2017-12-14 18:30:53 +01:00
Harald Welte 618ef64574 BSC_Tests: Add TC_chan_act_nack to test RSL Channel Activate NACK
Change-Id: Ic0188065f50d29c44d7bf220f2ef881997a14b68
2017-12-14 14:58:20 +01:00
Harald Welte 1ff6999b81 BSC_Tests: Add TC_paging_counter to test paging related counters
Change-Id: I48057cb4eeb96637a663940cf4de4df1a9f2e85d
2017-12-14 12:31:17 +01:00
Harald Welte a8ed906866 BSC_Tests / RSL_Types: Add enumerated for RSL Cause value
this looks much more human-readable in the logs...

Change-Id: I2bc3de37a3059cc16c6293df45e5c4d620422502
2017-12-14 09:46:01 +01:00
Harald Welte 5cd20ed288 BSC_Tests: Add more tests about invalid channel activations
Change-Id: I8a44b5eab6c6e09330305547d145820983f90140
2017-12-13 22:34:00 +01:00
Harald Welte d693965455 BSC_Tests: remove copy+paste CHAN RQD -> CHAN ACT -> CHAN ACK
... and replace it with a function

Change-Id: Id75cc92ddf1c1833c892a7bfa77d6561fd0f3679
2017-12-13 21:02:46 +01:00
Harald Welte 69c1c261ba BSC_Tests: Make as_Tguard() more robust (don't abort after RESET)
Change-Id: Ia5a39d372c1b7ec8267446f2762aabc600667775
2017-12-13 21:02:08 +01:00
Harald Welte 5d1a2209f2 bsc: Run three virtual BTSs (2 in one lac, 1 in another)
This allows us to verify if the BSC pages *only* where it is supposed
to page based on the cell identity list in the 08.08 PAGING.

Change-Id: I53ffe44279a7b83e045b3fdb25da64529955d457
2017-12-13 19:51:29 +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 e65d40e4db BSC_Tests: Ensure that PCH load indications suppress further paging
Change-Id: I1111996e497bc3ef179b57df135975160b4f7a52
2017-12-13 00:50:11 +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 1098500d2d BSC_Tests: Verify paging stops after BSSMAP RESET on A interface 2017-12-12 09:29:15 +01:00
Harald Welte ad3339051e Add osmo-bsc.cfg and osmo-stp.cfg for this test case 2017-12-11 19:53:35 +01:00
Harald Welte 6f521d8e05 BSC_Tests: Add 12 different PAGING tests 2017-12-11 19:52:02 +01:00
Harald Welte bd868bd91e BSC_Tests: Avoid race condition with OML
We use the "oml-connection-status == degraded" to determine if
the OML connection has been brought up by the external helper.

However, this status is advertised from the moment the ID_ACK was
issued on the OML connection, and *not* only from the moment on
when we're expecting the RSL connection (after initializing all MO).

Let's introduce some delay to avoid running into a race condition here.

The proper solution is to implement OML inside the test suite, which
is too large of a task to be done right now, where the focus is on
RSL+BSSAP testing.
2017-12-10 18:28:40 +01:00
Harald Welte 15e1dea8c2 BSC_Tests.cfg: Use 'control' section as default test suite 2017-12-10 18:28:21 +01:00
Harald Welte b291770b7b BSC_Tests: Ensure TC_chan_rel_rll_rel_ind terminates with 'fail' not 'error' 2017-12-10 15:48:52 +01:00
Harald Welte 85804d4dd0 BSC_Tests: Add new TC_chan_rel_a_reset
This test case tests for proper release of RF channels after the MSC
issues a BSSMAP RESET.
2017-12-10 14:11:58 +01:00
Harald Welte f7e771027f BSC_Tests: Suppress logging for M3UA/SCCP/IPA/CTRL
This makes it easier to interpret the log output
2017-12-10 14:11:17 +01:00
Harald Welte 60e823a555 BSC_Tests: More robust against race condtions in IPA CCM and RESET 2017-12-10 14:10:59 +01:00
Harald Welte d8c36cda22 BSC_Tests: Add new TC_chan_rel_hard_rlsd (MSC sends hard RLSD) 2017-12-09 23:05:31 +01:00
Harald Welte 4003d11fe8 BSC_Tests: Add various additional test cases 2017-12-09 22:37:21 +01:00
Harald Welte a5d2ab2cdc BSC_Tests: Only one CTRL interface per BSC, not per BTS
... and use CTRL to deteremine once external OML dummy has
re-established the connection so we can start RSL subsequently.
2017-12-09 14:21:42 +01:00
Harald Welte 96c94410c1 BSC_Tests: Add CTRL interface connection 2017-12-09 03:13:36 +01:00
Harald Welte a76c4bb7b9 Extend IPA_Emulation with support for CTRL 2017-12-09 02:06:07 +01:00
Harald Welte ae02669508 BSC_Tests: Start with much simpler tests at BSSAP / SCCP level
Rather than using the more complex RSL Emulation and BSSAP emulation
components, we attach to the RSL and BSSAP Codec Ports and send some
messages back and forth for low-level testing such as timeouts, response
to RACH requests, failure of MSC to react to CR requests, etc.
2017-12-09 01:03:01 +01:00
Harald Welte f8a0bdaad5 BSSMAP_Templates: Add parameters to tr_BSSMAP_ComplL3 for better matching 2017-12-09 00:53:17 +01:00
Harald Welte 696ddb6de3 bsc-tests: Add BTS_Simulation, RSL_Tests and .cfg file 2017-12-08 14:01:43 +01:00
Harald Welte 28d943ef35 ts_BSSMAP_HandoReq: Hand in raw list as argument, not IE type
Also, add new ts_BSSMAP_Paging() template.
2017-11-25 15:01:16 +01:00