Commit Graph

163 Commits

Author SHA1 Message Date
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