Commit Graph

1135 Commits

Author SHA1 Message Date
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +02:00
Vadim Yanitskiy a201b97200 library/TRXC_Types.ttcn: correct FAKE_RSSI command template
Absolute form of FAKE_RSSI command shall contain an optional
threshold value. Otherwise it's interpreted as relative form.

Change-Id: Ief89b2601277488bb1782b981aff1061ddaa6637
2018-10-23 10:43:15 +00:00
Pau Espin 3dcf38f7dc bts: Disable testing FACCH/H with real HW
Temporary disable testing on FACCH/H because Calypso PHY is not stable.
Otherwise some tests fail half of the time due to this unstability.

Related: OS#3653
Change-Id: I078cdfbf8d27e543a723eab90f66b2fcda016b5d
2018-10-23 10:35:15 +00:00
Pau Espin e9571aaee5 bts: Introduce mp_ul_rxlev_exp and use mp_rxlev_exp to craft meas rep
Change-Id: I1c8f05bde6f9dc8e8a649e877209192d829dd923
2018-10-23 10:34:43 +00:00
Philipp Maier 109e6aaaa1 MSC_Tests: Extend timeout in TC_mo_setup_and_nothing
The mncc guard timer in osmo-msc expires after 180 sec. This tests
terminates early and fails. Lets expand the timeout in order to give the
test a chance to pass.

Change-Id: I9f954a8807c0f0513422693ac24c647da0bfafd1
Related: OS#3599
2018-10-22 20:23:26 +00:00
Vadim Yanitskiy 4ebdad65a2 BTS_Tests.ttcn: fix: don't overwrite the expected meas results
Since OS#2988 was fixed, we should not overwrite nor ignore the
measurement results in f_build_meas_res_tmpl().

Change-Id: Ie902bfc7619181b528eafbce367c87e0b062243a
2018-10-21 12:29:50 +00:00
Stefan Sperling aa1e60f584 add an IPA test which sends a chopped payload
Add another IPA test to the BTS and BSC test suites.
This new test sends the header in one burst, followed by the
payload which is transmitted byte-per-byte.

The test uses an ID REQ message. If acting as a server, the test
can expect an ID RESP message. However, if acting as a client, the
server will close the connection when it receives the ID REQ.
The CTRL interface port on the BSC does not close the connection in
this case, so that particular port is skipped by the test for now.

Change-Id: If75cb90841bb25619b414f0cabe008a2428a9fdf
Related: OS#2010
Depends: I4804ccabd342b82d44e69dbc6eaaae220ec7d4e4
2018-10-15 16:41:16 +02:00
Stefan Sperling 0ec1c26808 add chopped IPA ping test to BTS tests
Run the chopped IPA ping test from the IPA_Testing module
as part of the BTS test suite. Contrary to the BSC version
of this test, this test listens for an IPA connection rather
than connecting to an IPA server. Make code in the IPA_Testing
module for accepting connections actually work.

Change-Id: I4804ccabd342b82d44e69dbc6eaaae220ec7d4e4
Related: OS#2010
2018-10-15 15:19:32 +02:00
Stefan Sperling 554123f739 run TC_chopped_ipa_ping on BSC ctrl interface
With a related patch to libosmocore, this test will pass on
osmo-bsc's ctrl interface.

Change-Id: I20a4f251dbe3e75a5c53a0ff167998bbd1266f62
Depends: I9d7137c830981ccad03806b30b776e2b1f1b4699
Related: OS#2010
2018-10-15 11:53:46 +00:00
Stefan Sperling fd0a130314 use tag for test dependency commit
Use the output of 'git describe' to pin the commit checked out
for dependency titan.ProtocolModules.SGsAP_13.2.0_commit, i.e.
the tag which points to 81544cf008378058b95ff20d33f3770fadb7e235.

Using a plain commit hash will always re-trigger an update of
the working tree in this particular case because 'git describe'
won't ever return an error.

Change-Id: Ia994b5c4488fd9b0d410b992e515c6eec4dd23b1
2018-10-12 16:34:46 +02:00
Neels Hofmeyr 61ebb8b7da bsc: add 3 tests for inter-BSC HO outgoing failures
Add
* TC_ho_out_fail_no_msc_response()
* TC_ho_out_fail_rr_ho_failure()
* TC_ho_out_fail_no_ho_detect()

Depends: I0980cacb9713e41a1eef3a0a7f6cc892e8a20da5 (osmo-bsc)
Change-Id: If772dbbc5f9790d3f911465e1303dd0a99811154
2018-10-11 17:21:47 +02:00
Harald Welte 7460a728fc IPA_Types/Emulation: Add RSPRO support
RSPRO is the protocol used by osmo-remsim.  It is embedded into an IPA
multiplex, and hence the TTCN-3 IPA code needs some extension to cover
support for it.

Change-Id: I536d6843b3e65b3ee35fbbcd6353e0fb0ce21c8e
2018-10-10 20:42:44 +00:00
Harald Welte 18314435e9 Add SGsAP_Templates for SGsAP on the MME<->MSC interface
Change-Id: I435dab312fc4965c69ffb9cc22917539ebab93e7
2018-10-10 20:33:21 +00:00
Pau Espin a0fb42a11c bts: f_tx_lapdm: Build SacchL1Header with proper values
Change-Id: I2c77d9d6262bd4763b3fb53a4a595d2c61f45f4b
2018-10-10 17:47:45 +00:00
Philipp Maier 4860473c7b MSC_ConnectionHandler: Use explicit AoIP flag
Most differences between sccplite and AoIP are visible during the
assignment. The current implementation checks for the presence of a CIC
in the ASSIGNMENT REQUEST in order to detect if the communication should
be modeled by AoIP or sccplite. This method is error prone and does not
work very well in situations where only signalling is used, because
there in sccplite and AoIP no CIC or AoIP trasp. identifier is present,
so there is nothing to check on. To resolve this we need an explicit way
to tell the MSC_ConnectionHandler that it has to behave like an AoIP MSC
or like an sccplite MSC.

- Add an aoip flag to TestHdlrParams
- Make sure BSC_Tests.ttcn sets the AoIP depending on mp_bssap_cfg.transport

Change-Id: I800249e783deb018d99e81d814843e0574a5c69b
Related: OS#3639
2018-10-10 14:23:40 +00:00
Stefan Sperling 59c15d67ca resolve ambiguity of MobileIdentityLV type name
There are two distinct types defined for a Mobile Identity LV IE.

One type definition lives in GSM_RR_Types and defines the "canonical"
IE form, with a full octet for the length.

Another one lives in RLCMAC_CSN1_Types which defines how a mobile
identity appears in paging requests. In this case, the length field
is only 4 bits in size. Rename this latter type from MobileIdentityLV to
MobileIdentityLV_Paging and add a comment to highlight this distinction.
TS 144 060 Table 11.2.10.2 explicitly states that only the value
part of this IE matches the definition of the canonical IE as
"defined in 3GPP TS 44.018" (actually, TS 44.018 further redirects
the reader to TS 124 008; see section 10.5.1.4 there).

As an aside, a third definition of the MobileIdentityLV type exists
in MobileL3_CommonIE_Types, which matches the "canonical" form.

Change-Id: I990316cd5ef5aaf079b03c344e3185ae6ab8ba6d
Related: OS#2404
2018-10-10 11:09:25 +02:00
Stefan Sperling 4170a139d4 document why ipa chopped ping fails with control interface
We cannot test the control interface with an IPA ping message.
The control interface only supports osmocom-specific extensions,
and the IPA ping message is not part of those extensions.
Other tests will have to be devised for the control interface.

Change-Id: Iae0f16394c78196de621c14b34d1b1905c0cb7c8
Related: OS#2010
2018-10-09 08:38:47 +02:00
Stefan Sperling 0796a82c86 Add a TTCN3 module for IPA protocol testing
This new module allows us to test IPA code in libosmocore
and libosmo-netif. Currently only one test is implemented,
which sends a chopped IPA ping message and expects to receive
an IPA pong.

The system under test is any IPA speaker on any TCP port.
Any test suite may call parametrized functions to create
an IPA testing component and run a particular test.
So far, one such test has been added to the BSC_Tests suite.

Change-Id: I246a405414e36a44dc1e308692faab8bf04da0e6
Related: OS#2010
2018-10-08 17:56:36 +02:00
Philipp Maier 48aeeecfac MSC_ConnectionHandler: Make sure COMPLETE LAYER 3 INFORMATION contains a codecList
Since our BSC implementation supports AoIP, the COMPLETE LAYER 3
INFORMATION message must contan a Codec List (BSS Supported) information
element. The test currently just receive a L3 compl Template and then
continue. This is implemented without an altstep. So lets have an altstep
with timeout here and make sure that the codecList information element is
always included.

However, since AoIP was specified after sccp-lite, we need to make sure
that for sccp-lite configurations, the Codec List is not included.

- Check L3 compl message using an alt-step
- Make sure codecList is always included (for AoIP)

Change-Id: Ia16a454e78421430ec32cc37939d429970cb06ec
Related: OS#3548
2018-10-05 11:15:59 +00:00
Vadim Yanitskiy 35677870c5 BTS_Tests.ttcn: fix: expect RSL_MEAS_RES messages
Since both Calypso PHY and trxcon (since OS#2988 is fixed) are
always sending the Measurement Reports in dedicated mode, the
test cases should expect to 'see' the RSL_MEAS_RES messages,
and ignore them if they are out of the testing scope.

This change makes the following test cases pass:

  - TC_rll_est_ind,
  - TC_rll_rel_ind_DCCH_0,
  - TC_rll_rel_ind_DCCH_3,
  - TC_rll_rel_ind_ACCH_0,
  - TC_rll_rel_ind_ACCH_3,

by adding the 'lazy' version of as_meas_res() alt-step.

Change-Id: I34227b981f76377c338fad4ff9560ba2042abce4
2018-10-05 11:14:58 +00:00
Vadim Yanitskiy e0b91a764a BTS_Tests.ttcn: fix: properly detect Measurement Reports
The altstep for detecting Measurement Results, that was introduced
in I15782ec93d68a0dc54b2ed7a84cb70d780ba0ce1, was implemented in a
wrong way. Basically, the DL Measurement Reports (coming from the
MS) are being combined with the UL measurements, and then being
send as a RSL_MEAS_RES message, not RSL_INITDATA_IND.

Let's use the existing as_meas_res() in 'lazy' mode for that.

Change-Id: Iea5ee868ede8bfe1e2b1cbf5abcbf2844d3fe9a4
2018-10-05 11:14:56 +00:00
Vadim Yanitskiy 41baf00d99 BTS_Tests.ttcn: add 'lazy' mode for as_meas_res()
This mode would be useful for test cases, which expect to receive
the RSL_MEAS_RES messages, but don't care about their correctness.

Change-Id: I39118d6e64c767fad2c9618ec0ef4532dc60e715
2018-10-05 11:14:53 +00:00
Philipp Maier 7695a0d879 BSC_Tests: use consistant AMR S0-S15 bits
At the moment we use the default S0-S15 bits for the AMR config,
regardless what RSL_IE_Body mr_conf or osmo-bsc.cfg sets.

- Make sure consistant S0-S15 bits are used for AMR related tests.

This is a re-submit of change I794e6d4fe8abc67337428cbe0bcc8802fae37a6e,
which had to be reverted because the depending patch in osmo-bsc is not
yet merged into master. This caused TC_assignment_codec_amr_f and
TC_assignment_codec_amr_h to fail.

Change-Id: Ia98f18ba2c17c85ed01488734dc6df67f5b60d41
Depends: osmo-bsc: I2d8ded51b3eb4c003fe2da6f2d6f48d001b73737
Related: OS#3529
2018-10-05 12:47:18 +02:00
Pau Espin 99a7aca62d bts: Use f_L1CTL_PARAM to set expected ms power level for dummy MeasRep
If for whatever reason (eg. CPU scheduling saturation) the L1CTL cli
(TTCN3) doesn't send Measurement Reports on time and no previous one
is cached or has been erased by L1CTL_DM_REL_REQ, lower osmocombb layers
will generate their own dummy Measurement Reports since SACCH must
always be filled.
Those dummy Measurement Reports are filled from
parameters previosuly set using L1CTL_PARAM_REQ (implemented by
f_L1CTL_PARAM() in TTCN3).
Since that function is never called, we need to call it to set the
expected MS power level values in case the cache is empty and we don't send
expected values in case we don't send the Measurement Report through L1CTL
on time.

Change-Id: Ie1fd9cee3472c7aa6580f846d277f485d3401641
2018-10-04 06:38:41 +00:00
Pau Espin ed359cb59f bts: Add parameter to set and expect a specific MS power level
This change uses recently added ts_L1CTL_DATA_REQ_SACCH to be able to
set the L1 Header parameters to match the expected MS power level
announced by the BTS.

Change-Id: Iedab8681a0ba4652a6bb1c001418599a4ff746b6
2018-10-04 06:38:35 +00:00
Vadim Yanitskiy b992050365 BTS_Tests.ttcn: don't tolerate any RSL messages by default
Change-Id: I70dc8af999eed8f7ed6a0d9dad4d3a9406340017
2018-10-04 06:21:00 +07:00
Vadim Yanitskiy 4d78a70802 BTS_Tests.ttcn: fix: properly expect I-frames in f_TC_encr_cmd()
For some reason, in f_TC_encr_cmd() it was expected / assumed that
when a ciphered I-frame is sent from MS on L1CTL, nothing else
than this frame would arrive. But since we have fixed Measurement
Reporting in trxcon (see OS#2988), the MR related messages do
appear on A-bis interface now!

This change introduces a new function f_data_mo(), which should
be used to send I-frames from MS and expect them on A-bis.

So, the following test cases:

  - TC_encr_cmd_a51;
  - TC_encr_cmd_a52;
  - TC_encr_cmd_a53;

should pass with both trxcon and Calypso PHY now :)

Change-Id: I08cb28dd9fa23f3ef8b0c9ede3d4c47f5702a1c1
2018-10-04 06:20:58 +07:00
Vadim Yanitskiy 8d8f91c18b BTS_Tests.ttcn: mark f_unitdata_mo() as private
Change-Id: Idd31608cd91631a92ea9d73e1db508605d7314d4
2018-10-04 06:19:45 +07:00
Vadim Yanitskiy ad131c874a BTS_Tests.ttcn: share as_rsl_sacch_ind() and as_rsl_any_ind()
Change-Id: I7ace54643c10df38a3ea941242f8b65264ef1322
2018-10-04 06:18:59 +07:00
Pau Espin 0aad596264 L1CTL_Types: Add support to set L1 Header params during SACCH tx
Change-Id: Id014f790ee2ede8ae796c37b1c6b25c4af9034d2
2018-10-03 21:39:10 +00:00
Vadim Yanitskiy 98e0315878 BTS_Tests.ttcn: extend f_unitdata_mo() with tolerance parameters
The ability to control which kinds of RSL messages are permitted
in a given use case (and which are not) makes f_unitdata_mo()
function much more flexible.

Let's introduce two new parameters, one of which would make its
'alt' statement tolerant to SACCH messages (Measurement Reports),
and another to other kinds of RSL messages.

Please note that the original behaviour of f_unitdata_mo()
went untouched, so it's still tolerant to any other messages.

Change-Id: I15782ec93d68a0dc54b2ed7a84cb70d780ba0ce1
2018-10-03 21:37:40 +00:00
Vadim Yanitskiy 8f98d3fcc4 library/RSL_Types.ttcn: expect any l3_info for 'tr_RSL_UNITDATA_*' by default
This is quite useful when one needs to expect an RSL UNITDATA
message with any payload. Let's set 'l3_info' to '?' by default,
like it's already done for 'ts_RSL_DATA_*'.

Change-Id: I45260343b34d8d054e7efa72de11dd4cb510a8cc
2018-10-03 21:37:40 +00:00
Vadim Yanitskiy fabe0f202a library/RSL_Types.ttcn: fix inadequate template restriction
The 'tr_RSL_UNITDATA_IND' is a 'response' template, so there
is no reason to restrict 'link_id' to any obvious value.

Change-Id: I29ac0a2828b565baa1d2f3ac0a922bc441378f94
2018-10-03 21:37:40 +00:00
Pau Espin 121724cc99 bts: Add timing offset tolerance module parameter to support real HW
When we don't use trxcon (ie we run real HW) we need to relax template
matching when we receive UL measurements in that case.

Change-Id: Icf1d2216d29c1ebf68c672e6ca06c54a7457304b
2018-10-03 21:28:01 +00:00
Alexander Couzens 9a75ab43ce sgsn: update expected-results
Change-Id: Ie08fb0b5a94728640f65f56430a217b51aea3dde
2018-10-03 08:16:09 +00:00
Philipp Maier 0be8716e01 Revert "BSC_Tests: use consistant AMR S0-S15 bits"
The change depends on another change in osmo-bsc, which
is not in master yet. Because of this TC_assignment_codec_amr_f
and TC_assignment_codec_amr_h are currently failing. So lets
revert this patch and re-submit it later.

See also: osmo-bsc change I2d8ded51b3eb4c003fe2da6f2d6f48d001b73737

This reverts commit 7f5609ad3e.

Change-Id: Ib16d14c723773ce67508c7e6028e594c15779506
2018-09-28 23:02:47 +00:00
Neels Hofmeyr 8e1f3c5d2f osmo-bsc.cfg: drop 'add' keyword from 'neighbor add'
Adjust for osmo-bsc change I143f21f6069d1a86096cc8240cf69eb7ea9c8ac8.

Change-Id: I6a83a8d4ba61b87905c6fae457d4b4eb6078dce9
2018-09-27 22:01:40 +02:00
Pau Espin 9c3ff4e3ec bts: Account for elapsed time in paging timer
Previous implementation always waited for "interval" time until sending
next paging cmd, and didn't finish the test until all expected paging
cmds were sent. As a result, each time it triggered it accumulated some
delay which could go from 2 seconds to 12 seconds depending on machine
load.
As a consequence, the expected number of paging cmd messages to be sent
in 20 seconds was being sent in 22-32 seconds, hence changing the load
on osmo-bts and as a result changing the test results.

Low threshold needs to be adapted since now they are sent in exactly 20
seconds max and the load handled by osmo-bts is bigger.

Fixes: OS#3025
Change-Id: I9651136d6810420e0a4d887bfb11c913a24f0457
2018-09-26 20:42:36 +02:00
Neels Hofmeyr bd0ef93d4f bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc
Add f_gen_handover_req() like f_gen_ass_req(), to match AoIP or SCCPlite
requirements.

For incoming HO, MSC_ConnHdlr needs to know the SCCP addresses to expect the
incoming SCCP Connection from MSC to BSC. Add 'handover' section to
TestHdlrParams, and pass in the addresses from test_CT via that.

In osmo-bsc.cfg, add a remote neighbor config, so that the VTY command
'handover any to arfcn 123 bsic any' can trigger an outgoing inter-BSC HO.

Add various BSSMAP handover templates to BSSMAP_Templates.ttcn.
Add RR Ho Command template to L3_Templates.ttcn.

Move ts_BSSAP_Conn_Req() from msc/BSC_ConnectionHandler.ttcn to
library/BSSMAP_Emulation.ttcn, so we can also model an SCCP Connection Request
in BSC_Tests.ttcn (this time from MSC to BSC).

Add the two new tests to bsc/expected-results.xml.

Related: OS#2283
Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
2018-09-26 07:27:24 +00:00
Harald Welte 6b3e4ab4b7 ensure well-formed config files
Change-Id: I09eedd3cda993b9fabfdcf7caf0b3a050eaad9b1
2018-09-25 18:51:28 +00:00
Daniel Willmann 52918e5fcf MSC_Tests: Reply to Classmark Req in TC_lu_imsi_auth_tmsi_encr_3_1_no_cm
After osmo-msc I73c7cb6a86624695bd9c0f59abb72e2fdc655131, osmo-msc
sends a BSSMAP Classmark Request if encounters a missing Classmark,
which is the case during LU when A5/3 is enabled.

Fix this test by answering the Classmark Request, if any.

Change-Id: I25578c050b7e105ed71b064891d4cd418ee30fcf
2018-09-25 12:45:46 +00:00
Philipp Maier 7f5609ad3e BSC_Tests: use consistant AMR S0-S15 bits
At the moment we use the default S0-S15 bits for the AMR config,
regardless what RSL_IE_Body mr_conf or osmo-bsc.cfg sets.

- Make sure consistant S0-S15 bits are used for AMR related tests.

Change-Id: I794e6d4fe8abc67337428cbe0bcc8802fae37a6e
2018-09-21 12:53:23 +02:00
Neels Hofmeyr 92b12b748c bsc: test Classmark Enquiry
Enhance TC_classmark to also include the BSSMAP Classmark Request -> RR
Classmark Enquiry part. So far it was only testing the return path of RR
Classmark Change -> BSSMAP Classmark Update.

This test will thus fail with current osmo-bsc master, and will succeed as soon
as osmo-bsc If5db638fd6e8d9c2ef9e139e99f0fabe1ef16ddf is merged.

Add:

* ts_BSSMAP_ClassmarkRequest in BSSMAP_Templates.ttcn
* tr_RRM_CM_ENQUIRY in L3_Templates.ttcn

Change-Id: Idaab4d568cf986b4897ba008f6262c839d1592fb
2018-09-18 14:33:42 +02:00
Harald Welte f097a8b94e GSM_Types: Add CBCH_Block definition of TS 04.12
Change-Id: Ib034aba11a0219959c4224238e559ba36e95cacf
2018-09-16 18:12:17 +02:00
Harald Welte 42ca6b1c31 GSM_Types: Add support for Osmocom RSL ChannelNr CBCH
Osmocom uses 0xC8 as channel number for CBCH, this is an extension
to the 08.58 definitions.

Change-Id: I2203f4a9012c154c12ac9d8f9c448a9ed0f49197
2018-09-16 12:41:11 +02:00
Harald Welte cc373205ad rsl: Add SMSCB related RSL types / templates
Change-Id: I203e72a203ffa7538aadc7b96e1ae7e21956c160
2018-09-16 12:41:11 +02:00
Harald Welte f50e3ae532 bts: Add second VTY connection to BSC
Change-Id: If4b5a906a0841c0a8c3d7c4e9e5a3d1208ecf16a
2018-09-16 12:41:11 +02:00
Harald Welte a266325929 Osmocom_VTY_Functions: Generalize to handle multiple VTY ports
The existing Osmocom_VTY_Functions code was centered around a global
module parameter specifying the prompt prefix.  This prevented a
single test to use multiple VTY connections to different Osmocom
programs.

This patch generalize the code by widening the prompt matching
in f_vty_wait_for_prompt() and by allowing the caller to specify
the prompt prefix to override the modulepar.

Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
2018-09-16 12:41:11 +02:00
Harald Welte 43c5464370 bts: update TODO comments; remove tests already covered
Change-Id: I35003e20b9b511e5d514549a9ad0acc32b243651
2018-09-16 12:41:11 +02:00
Harald Welte 3db03118a3 add ttcn3 test suites slides from OsmoDevCon 2018
Those slides are copied from http://git.gnumonks.org/laforge-slides/plain/2018/osmodevcon2018-ttcn3_test_suites/
to make sure they are more easily found.  It would be nice to convert
them into an actual asciidoc book with one chapter per test suite which
would be built from within this repository.   This way we can keep
documentation and code better in sync.

Change-Id: I8a0d66babc165678ec53a1ee1c673e93708b8b79
2018-09-16 12:39:51 +02:00