Commit Graph

254 Commits

Author SHA1 Message Date
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
Philipp Maier c6e06f76ae MSC_Tests: fix TC_mo_crcx_ran_reject
The testcase intentionally responds to the RAN sided CRCX
with a garbeled message to cause the MGCP handlin inside
the MSC to fail. The MSC is then expected not to perform
further MGCP operations since it did not get a proper
response to the first CRCX, so the specific endpoint name
is not known, eventually preventing from doing an MDCX.

However, the testcase responds to incoming DLCX commands,
instead setting the verdict to fail.

Also the altstep that dispatches the message after the
errornous MGCP response unconditionally catches all BSSAP
messages before entering the sub-altstep
as_clear_cmd_compl_disc() that handles the clearing of
the connection. Eventually the clear command is never
received in this sub-altstep.

- Make sure the verdict is set to fail when an MGCP
  message is received after the errornous response to
  the CRCX.

- Remove the unconditional BSSAP.receive in order to
  be able to dispatch the clear command properly

- Update the expected-results.log file

Change-Id: I806491741d310e4410f6cb4ce0309235e9bf4300
Related: OS#2882
2018-04-11 16:50:59 +00:00
Harald Welte f45efeb15e msc: Initial SMS testing (MO + MT SMS, successful case, no SMPP)
Change-Id: I707330454ffab87daebf22ba83e6ba2873996424
2018-04-09 22:53:49 +02:00
Harald Welte b9e86fa815 msc: generate mobile identity inside f_establish_fully()
This reduces the code duplication in every caller of the function.

Change-Id: Iaa071b131a8ff372d70677c8622d227f88e9ea53
2018-04-09 18:19:36 +00:00
Harald Welte 51affb6e03 L3_Templates: Introudce constants for tiFlag
... this makes the code more readable/understandable.

Change-Id: Ic06eb2016eb9979b8556366e4a909f3c0336aa92
2018-04-09 18:19:36 +00:00
Neels Hofmeyr 2b326fa81d fix MSC.TC_lu_clear_request: allow LU Reject, forbid 2nd Clear Cmd
When the MS sends a Clear Request in the middle of a Location Updating, it
should be permitted for the MSC to send a Location Updating Reject back. Extend
with an alt that also allows a LU reject before the Clear Command.

The test explicitly hints at https://osmocom.org/issues/2862 which rightfully
forbids the MSC to send a second Clear Command after the first is completed.
However, this test so far explicitly permits a second Clear Command, so it was
probably passing in error all the time. Set verdict to failure if a second
Clear Command is received before the DISC_IND.

This changes the test verdict to failure with current osmo-msc master,
rightfully so; the failure will be fixed by the upcoming MSC subscr conn FSM
refactoring.

Change-Id: I7bc5555b829d61b0a2529107bc9b58446865545d
2018-04-06 01:17:52 +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
Harald Welte 2043d68918 msc: Fix config file syntax.
In Change-Id: I52a4c8118828c1605cf672889982f987568ad17d we introduced
config file syntax errors.  It seems that change was not tested at all
before pushing :(

Change-Id: I80577798b502957afaa46abb510bcca3dc174ee4
2018-03-29 13:17:18 +02:00
Philipp Maier 7593298b36 MSC_Tests: Add support for multiple BSC
The upcomming tests for inter-BSC handover make it necessary to
simulate multiple (two) BSCs to the MSC, while the current
Implementation can only handle one BSC instance at a time.

- Allow multiple BSC instances to be created
- Add a simple reset-test to test what happens when
  two BSC instances are started (BSSMAP reset from two
  different BSCs)

Change-Id: I52a4c8118828c1605cf672889982f987568ad17d
Related: OS#1609
2018-03-28 12:34:54 +02:00
Philipp Maier 0f4a0f941f Cosmetic: Update MSC_Tests.cfg
The MMSC_Tests.cfg config file lacks most of the test comments.

- make sure the control section of MSC_Tests.ttcn and MSC_Tests.cfg
  match up.

Change-Id: I89e6c65427a993261cab6a284e6cc3dbc5a5562f
2018-03-28 12:28:05 +02:00
Philipp Maier 3716a5e364 BSC_Tests: split up f_mt_call and f_mo_call
The functions f_mt_call and f_mo_call establish a call, hold it
for 3 sec. and tear it down again. However, there may be test
situation where one wants to establish a call and then hold it
in order to perform other actions.

- split up the function into an _establish and _hangup part.
- add a replacement f_mt_call and f_mo_call function for the
  already existing testcases

Change-Id: I0da9cf64d10de4036eb037ef5e491bfe3088670b
2018-03-22 12:43:56 +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
Philipp Maier 2a98a73be4 MSC_Tests: Test what happens when the DLCX is dropped
Test the reaction of osmo-msc when the DLCX at the end of a call
is not answered. Normally osmo-msc should time out and clear the
connection.

Change-ID osmo-msc:I78f1b6a9149488a4ad3f120c1e190a83c07d4b89 fixes
a regression that causes osmo-msc to segfault due to a use after
free. This testcase provokes the situation that leads to the
crash.

Change-Id: Ic124ea116496209f9a1d8e74ae3e3a36cf866db0
Related OS#2881
Related OS#2882
2018-03-19 16:12:31 +01:00
Philipp Maier cd66857671 cosmetic: correct indentation
Change-Id: I5fdb3d3db201e33456e03ffda55752efe4ada733
2018-03-19 16:12:31 +01:00
Harald Welte 5946b33e37 msc: wait for clear-command/complete/sccp-release
Not all tests were waiting/expecting the complete connection
shutdown, which results in the possibility for CLEAR CMD to arrive
during shutdown of the TITAN components and cause related errors.

Change-Id: I3a6c2e1f78b58f86ef84d4e323f432016a9afa7e
2018-03-18 23:33:42 +01:00
Harald Welte bdb3c45a38 msc: Fix TC_cl3_{no,rnd}_payload
It may very well be that the MSC is first accepting the SCCP connection
and possibly sending a L3 (error) message before clearing/closing
the SCCP connection in case of errors in the COMPL L3 info.

Change-Id: I4cf08608413e9e1fb54848849baed79204f5dcd1
2018-03-18 22:46:14 +01:00
Harald Welte edbab816ba MSC_Tests: Fix to use 2-digit MNC
Until recently, OsmoMSC didn't distinguish 2-digit from 3-digit MNC,
and the config file states '42' as MNC while the tester used '042' in
several locations.  This causes almost all MSC_Tests fail with recent
osmo-msc.

Let's fix the tests to use '42', as they should always have.

Change-Id: Id02bfd74127cf5551923912934240035106a8a4e
2018-03-18 17:09:02 +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
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
Philipp Maier 94f3f1bfa6 MSC_Tests: Test SCCP clearing on release timeout
Provoke a timeout error in the MGCP FSM which then triggers a
release on the CC layer. Ignore this release and let the CC leyer
timeout. The MSC is expected to clear the SCCP connection.

Change-Id: If3e0bee11763f1c6b2cfae91f2a818ff7d0df9e7
Related: OS#2881
Related: OS#2882
2018-03-16 11:10:22 +01:00
Philipp Maier f1e02bb46b MSC_Tests: Support wildcarded endpoints (follow up)
The following tests still lack support for wildcarded endpoints:

MSC_Tests.TC_lu_and_mo_call
MSC_Tests.TC_emerg_call_imsi
MSC_Tests.TC_mo_crcx_ran_reject
MSC_Tests.TC_mt_crcx_ran_reject

- Also add support for wildcarded endpoints for those tests.

This is a follow up patch for:
Change-Id I0efeae0f8a6e98deb843e79648f84a262f1d98f8

Change-Id: I16cb2582b9d1764d7cb7e4b787368a4dd5ddf69c
Related: OS#2710
2018-03-16 09:15:32 +00: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
Philipp Maier 4b2692d50b MSC_Tests: Support wildcarded endpoints
At the moment the testsuite is unable to detect when the call agent
performs a CRCX request with a wildcarded endpoint.

- Set a default endpoint name in cpars in case the MSC does
  a CRCX request with wildcarded endpoint name.

- Detect if the MSC supplied a wildcarded endpoint name. Do
  not overwrite the default setting in cpars then.

- Attach the endpoint name as Z: parameter in the response so
  that the MSC knows which endpoint to use. (Unconditional,
  does not harm on non wildcarded requests)

Change-Id: I0efeae0f8a6e98deb843e79648f84a262f1d98f8
Related: OS#2710
2018-03-14 21:08:20 +00:00
Philipp Maier 8e58f596dc MSC_Tests: Respond to BSSMAP release
The testcase TC_mo_crcx_ran_timeout does not respond to the BSSMAP
relase request that is sent when the MGW times out.

- Acknowledge the release request before waiting for the MSC
  to clear the SSCP connection

Change-Id: Ifcf9ebd2cc5184524ecae735257ed12a0ca70f71
Related OS#2881
Related OS#2882
2018-03-14 12:33:34 +00: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
Philipp Maier 328d166dbb MSC_Tests: Add testcase TC_cr_before_reset
This testcase triggers a bug in the BSSMAP reset logic that tricks
the MSC into a deadlock situation. The bug can only be triggered on
a freshly started MSC, otherwise the testcase will not have any
effect at all. That's why it its important that this is the first
testcase to be executed. If the IUT (MSC) is still affected by the
bug. It will enter the deadlog situation and all subsequent testcases
should fail until the IUT (MSC) is restarted. The matching real-life
scenario would be that the MSC restarts. The BSC is not informed by
the restart, so it continues to make connections (which fail) until
it notices that the MSC was down and the execution of a BSSMAP reset
procedure is required.

See also Gerrit Change Id:
I3fdcec5dbeaa0e21fd6a92568a623faa368239be

Closes: OS#4120
Change-Id: I1d7575e5bec9edabcc832c754d19dc5ba489861a
2018-03-07 18:40:44 +01:00
Neels Hofmeyr 1b3c6e3cc7 msc: add TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug (OS#2947)
To trigger the segfault described in OS#2947, run TC_lu_imsi_auth_tmsi_encr_3_1
with logging category for MSC to set to debug.

Change-Id: I72a1dbb30e0a39dbf4b81c7e378d5607b62e10d3
2018-03-02 00:35:25 +01:00
Neels Hofmeyr 29b8da0011 msc: add TC_lu_imsi_auth_tmsi_encr_3_1_no_cm
This is a variation on TC_lu_imsi_auth_tmsi_encr_3_1 that "indicates" inability
of A5/3 by completely omitting a Classmark2.

Add flag send_cm_update to f_tc_lu_imsi_auth_tmsi_encr_3_1() so that we can
easily omit the classmark update. Set this flag to true in existing
TC_lu_imsi_auth_tmsi_encr_3_1, and add pass false from the new test.

Change-Id: I903136d5acbd88f2e0e26fee22e3878258e04786
2018-03-02 00:35:25 +01:00
Neels Hofmeyr 9adaa70e78 msc: cosmetic: pass BSC_ConnHdlrPars to f_start_handler() as argument
Previously, f_start_handler() would initialize the BSC_ConnHdlrPars instance,
making it impossible to change those parameters before the test function was
invoked.

Add separate f_init_pars() function that sets the default parameters.

Change f_start_handler() to take a BSC_ConnHdlrPars argument; i.e. that
f_init_pars() can be called first, the parameters can then be modified and
finally fed into f_start_handler().

Change-Id: I46de36a032c2473025d0eb01e5909dbcdaf394f7
2018-03-02 00:35:24 +01:00
Neels Hofmeyr c1f105acb8 msc: cosmetic: f_perform_lu() / pars: move send_early_cm to BSC_ConnHdlrPars
By moving to the BSC_ConnHdlrPars, also the tests that expect a LU failure able
to indicate a send_cm_update flag.

All current callers of f_perform_lu() pass send_early_cm as 'true', all are
covered by a default of 'true'.

Change-Id: Ic882293f199a33133a171bff14ff433f99cc8576
2018-03-02 00:35:23 +01:00
Neels Hofmeyr e9b8eebfc3 msc: cosmetic: f_start_handler(): drop the id arg, use testcasename()
Change-Id: Id4efe8cd00f44ea744996efe04802c5107f2a191
2018-03-02 00:35:20 +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
Harald Welte 872ce17d35 move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions
Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c
2018-02-18 10:23:41 +01:00
Harald Welte 158a7ca881 Add L3_Common for shared L3 functions between MSC and SGSN testing
Change-Id: I16e80df610235849180dc946f9457302deafb9d2
2018-02-16 20:03:47 +01:00
Harald Welte e5695f5544 msc: move f_gen_{imei,imsi,msisdn} to L3_Templates.ttcn
This allows them to be reused in upcoming SGSN tests.

Change-Id: I0459eeb44e58342da656f2312560466698374b72
2018-02-16 20:03:47 +01:00
Daniel Willmann 90829d6eff MSC_Tests: Set verdicts from inconc to fail
Channels not being closed/cleared at the end of the test is a clear
failure, so don't mark the test as inconc.

Change-Id: Ie9188111da744f0aafaac02841d36a957bfc8d86
2018-02-15 17:45:14 +01:00
Daniel Willmann 5868e62e21 MSC_Tests.f_tc_mo_crcx_ran_reject(): Send release complete to release
Change-Id: I8a19541f3276b994ed34a1d3f9920010660a2ddd
2018-02-15 17:42:59 +01:00
Daniel Willmann 92f662789d BSSMAP_Emulation: Parameter to skip seq no patching
This is needed to check that duplicated messages will actually be thrown
away by the MSC.

Change-Id: I0a6914067ec8daa8903f0ef0c877f178cfd61659
2018-02-15 10:29:01 +01:00
Daniel Willmann 8b084374b5 MSC_Tests: Add CC sequence no. test with DTMF
Change-Id: I9674343acc18187b9e016bd8e0be470d5424046f
2018-02-15 10:29:01 +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 a4ca446034 WIP: Prepare MSC_Tests for ability to emulate two BSCs
Change-Id: Ibe3ae6ed4181c6ba7501f5443b4f22e3c8abeb3e
2018-02-13 08:15:33 +01:00
Harald Welte 33ec09bf34 msc: Mobile Terminated Voice Call test
Change-Id: I4fa353623991ac98726217559fea9f83f64715ea
2018-02-11 11:49:48 +01:00
Harald Welte 0bef21e645 msc: Add Emergency call to f_mo_call() and use it from TC_emerg_call_imsi
This fixes TC_emerg_call_imsi with current osmo-msc master. The old
implementation was broken as it didn't deal with MGCP yet.

Change-Id: Ic35797931387b078205269365421ad730db7af15
2018-02-10 11:06:55 +01:00
Harald Welte 081b19a791 msc: Unify channel establishment for CM SERV REQ + PAGING
Change-Id: I24e3dfa1ef88c48c39bf0248074e88e682bc8404
2018-02-10 11:06:55 +01:00
Daniel Willmann 4bd9955045 MSC_Tests: Make imsi suffix for f_start_handler unique per test
Change-Id: I02d1f2ac717fee278e3903d325942697637a5d28
2018-02-06 16:23:36 +01:00
Max 6367d7b807 Don't symlink non-existent file
Change-Id: I10309f07fb207c027703f0b43a478c152a029b6d
2018-02-05 16:58:27 +01:00
Harald Welte aa54cf8b7b msc: Disable t310 test for now (seems to never terminate on TITAN 6.1.0)
Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8
2018-01-30 08:16:05 +01:00
Harald Welte 9de8479399 msc: Cipher mode negotiation test
This adds a series of test cases that test various combinations of
A5/0, A5/1, A5/2 and A5/3 on both phone as well as network config
side.

Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102
2018-01-28 01:08:18 +01:00
Harald Welte de37149345 msc: Introduce BSC_ConnHdlrNetworkPars
This record collects information about the network configuration,
such as whether or not authentication, tmsi allocation and/or
encryption are enabled.  The individual helper functions can then
react according to this information, without having to pass long
argument lists along the call chain.

Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6
2018-01-28 01:08:18 +01:00
Harald Welte 6126fb0ee0 msc: Make MGW ip/port parameters configurable as module parameters
Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc
2018-01-27 20:08:41 +01:00
Harald Welte 3c68a54896 msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.)
Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c
2018-01-27 19:10:07 +01:00