Commit Graph

1703 Commits

Author SHA1 Message Date
Neels Hofmeyr 67add5eb78 include logformat in log_merge.sh
Change-Id: I4838cee7742ab99eb935f149a69e925258bbef36
2019-11-28 01:47:10 +01:00
Neels Hofmeyr 98caf1ca1c don't always imply 'make deps'
'make deps' always fails if there is no internet uplink.

Change-Id: Ic2e6af6f32d8c4bc276ca34cfeb697e9205a2649
2019-11-28 01:47:10 +01:00
Neels Hofmeyr 413298a5f3 disable tcpdump
Change-Id: I46116df68b2f8c9ca253a9285d0a571904521727
2019-11-28 01:47:10 +01:00
Neels Hofmeyr fc04c92447 msc: expect only one Paging on GERAN
After discussion on this thread:
http://lists.osmocom.org/pipermail/openbsc/2019-November/013058.html

Do not expect repeated Paging on GERAN.

Pending clarification on 3G, still expect repeated Paging on Iu, though we are
not 100% certain that this is indeed required.

Fixes MSC_Tests.TC_lu_and_mt_sms_paging_repeated,
but not MSC_Tests_Iu.TC_iu_lu_and_mt_sms_paging_repeated

Change-Id: Ie914ea88f31ac158f4bd1700143bbe728dd05e0b
2019-11-28 01:47:10 +01:00
Neels Hofmeyr 310cb61df3 msc: Iu: fix missing 'ran_is_geran := false' for TC_iu_lu_and_mt_sms_paging_repeated
Change-Id: I011795cacf62f2cac6861fe657966795e6370ddb
2019-11-28 01:47:10 +01:00
Neels Hofmeyr 384c4941fb msc: fix 2 Iu tests: use f_mm_common() instead of f_mm_auth()
Fix these tests by using f_mm_common(), which takes care of Iu auth+ciph:
TC_iu_lu_imsi_reject
TC_iu_lu_imsi_timeout_gsup

Change-Id: Id2bf160ac4e1cad4770202c6a6f1b8eeeee21d68
2019-11-28 01:02:47 +01:00
Neels Hofmeyr 536ac2e207 msc: add tests for SMS and voice call while Paging
Start a second
- MT SMS
- MT call
while a Paging is already ongoing.

The second trans being an SMS works.

The second trans being a call fails with current osmo-msc master; a fix is in
the related patch (s.b.).

Related: Idd4537b5f4817d17e5c87d9a93775a32aee0e7be
Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
2019-11-28 00:08:10 +01:00
Neels Hofmeyr c0c1aca92e hlr: stop on various failures
I found some of the tests hard to analyse when geting failures, because they
don't stop the test on failure. Spread some 'mtc.stop' so that the test stops
at the failed message instead of carrying on.

Change-Id: I804aca84d0ccf4767a5c097cf6c882ccbd87c4e1
2019-11-25 20:08:02 +00:00
Pau Espin 1755fab662 pcu: Introduce test TC_mo_ping_pong
Ideally some more checks should be done on this test at the end, but
it's fine keeping it as it is for now and can be extended later.

Change-Id: I3be5123ff5294e5851652ec14d54589442082b28
2019-11-23 08:10:19 +00:00
Pau Espin ce571b5cc4 sgsn: Introduce test TC_attach_req_id_req_ra_update
The scenario in this test triggers a crash in osmo-sgsn fixed by
osmo-sgsn.git I64fa5cf1b427d3abb99e553e584897261a827ce6.

With that osmo-sgsn patch applied, the process doesn't crash anymore but
the test still fails due to an XID message being sent with a new
yet-not-seen-by-ttcn3 TLLI and as a result TTCN3 BSSGP_Emulation fails:
BSSGP_Emulation.ttcn:390 setverdict(fail): none -> fail reason: "Couldn't find Component for TLLI 'FE791757'O", new component reason: "Couldn't find Component for TLLI 'FE791757'O"

Other than that, the test runs fine. It still needs to be clarified
whether the new TLLI sent by osmo-sgsn is expected and test needs to be
fixed, or whether it's an sgsn bug.

Related: OS#3957, OS#4245
Change-Id: Id5554a91a8bda712e282c5a3e9e30fb0ca1ec0e8
2019-11-23 08:00:46 +00:00
Neels Hofmeyr b26196be09 re-implement compare-results.sh as compare-results.py
The compare-results.sh is annoyingly slow. Since our ttcn3 tests containers
support Python 2, re-implement in Python for much quicker evaluation.

Change-Id: I0747c9d66ffc7e4121497a2416fca78d7b56c8e6
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 8df6962dec msc: add f_tc_invalid_mgcp_crash
Make sure that osmo-msc doesn't crash if a successful CRCX response contains an
invalid IP address.

Originally/recently, osmo-msc did not validate the IP addresses at all. In an
intermediate patch I added error handling, releasing the call. That uncovered a
use-after-free problem in libosmo-mgcp-client. This problem is fixed by
osmo_fsm_set_dealloc_ctx() and an osmo-mgw fix (see
I7df2e9202b04e7ca7366bb0a8ec53cf3bb14faf3 in osmo-mgw).

Add this test to make sure the crash is not re-introduced.

Change-Id: I0c76b0a7a33a96a39a242ecd387ba3769161cf7a
2019-11-23 07:59:07 +00:00
Neels Hofmeyr ba960a140d msc: log tweaks for call / call hangup
Change-Id: I06474e3d592195a8c422493166d9f042da1ac7e6
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 8fe8a90da2 msc: add and fix Iu mt call
Change-Id: I3ce29f3d9254656dc295674e8cec72a741b7764a
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 0b16bf1fcb msc: fix Iu mo call
Change-Id: I0ead36333ab665147b8d222070ea5cf8afc555ec
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 3c89a6bce6 msc: overhaul voice call testing
* Semantic:

We don't really know which side the MSC first creates a CRCX for. Instead of
assuming that the RAN side is always CRCX'd first, simply handle a "first" and
a "second" CRCX, not making any assumptions which is for which side.
Notably, there still are quite a few places assuming which CRCX corresponds to
the RAN/CN side, but the changes are sufficient to still pass the tests when
osmo-msc swaps the CRCX order; sometimes for slightly obscure reasons, for
example because it doesn't matter that the wrong port number is returned during
a subsequent MDCX... Cleaning up the rest is still todo for later.

Remove code dup from call establishing code, particularly for MGCP.

Use f_mo_call_establish() and f_mt_call() where ever possible, to make all of
the call establishing tests handle upcoming changes in osmo-msc's order of
messages, without re-implementing the changes for each test individually.

The X-Osmux parameter was so far expected to appear in the first CRCX received,
assuming that this first CRCX is for the RAN.  Instead, detect whether X-Osmux
is contained in a CRCX, and reply with an Osmux CID if so, regardless of it
being the first or second CRCX.  Count the number of X-Osmux parameters
received in CRCX messages, and compare after call setup to verify X-Osmux
presence.

Since f_mo_call_establish() can't handle RANAP assignment, a few Iu tests that
worked with the older code dup will break by this patch. This is fixed by a
subsequent patch, see I0ead36333ab665147b8d222070ea5cf8afc555ec.

* Details, per patch chunk:

Change ts_BSSMAP_IE_AoIP_TLA4 to a non-value template, so that we can use a
wildcard for the assigned port number from MGCP (depending on RAN or CN CRCX
first, the RAN port number can be one or the other).

In CallParameters, move MGCP handling instructions into a separate record
"CrcxResponse", and have two of them for handling the first and the second
CRCX, replacing mgw_rtp_{ip,port}_{bss,mss} and mgcp_connection_id_{bss,mss}.

In CallParameters, add some flags for early-exiting call establishment with a
particular desired behavior, for specialized tests.

In CallParameters, use common default values and don't repeat them in each and
every call establishing test.

Set cpars.mo_call := {true,false} implicitly when f_{mo,mt}_call_establish()
are invoked.

Remove CRCX comments implying RAN or CN side, instead just talk of the "first"
and the "second" CRCX.

Implement one common f_handle_crcx() function, which is used by
f_mo_call_establish(), f_mt_call_complete(), as_optional_mgcp_crcx(), and
implicitly uses the first/second CRCX handling.

For Assigment, use a wildcard RTP port so that we don't have to assume which
CRCX was for the RAN side.

In f_mo_call_establish(), insert special case conditions to make it enact
errors at specific times, for individual tests. That saves re-implementing the
entire call establishment (code dup).

For error cases, add expectation of a CC Release message in the call
establishment. This should not apply for normal successful operation, but
because interleave does not support conditionals, add flags
got_mncc_setup_compl_ind and got_cc_connect to break the interleave when
establishing is complete, so that the CC Release is skipped.
A CC Release always breaks the interleave, at whatever time it arrives.

Tests adopting f_{mo,mt}_call instead of code dup:
  f_tc_mo_setup_and_nothing()
  f_tc_mo_crcx_ran_timeout()
  f_tc_mo_crcx_ran_reject()
  f_tc_mo_release_timeout()
  f_tc_mo_cc_bssmap_clear()

Change-Id: I8b82476f55a98f7a94d5c4f1cd80eac427b2d20f
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 06b859ca31 msc: add sdp to MNCC
SDP is added to the MNCC protocol in osmo-msc
Ie16f0804c4d99760cd4a0c544d0889b6313eebb7.
This patch adds SDP to the ttcn3 MNCC messaging.

These changes still work with current osmo-msc master that doesn't send SDP /
ignores received SDP in MNCC.

Change-Id: Ic9568c8927507e161aadfad1a4d20aa896d8ae30
2019-11-23 07:59:07 +00:00
Vadim Yanitskiy 36558d9526 library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Ia5c4e504a21dc5508920553d3856027455dba1b1
Related: OS#4102, OS#1545
2019-11-23 07:57:45 +00:00
Harald Welte 619b2a6547 VPCD protocol support (for vsmartcard.git PCD/PICC code)
vsmartcard.git contains an implementation of a virtual card reader
(vpcd) which registers with PC/SC (such as pcsc-lite).  It simply
binds to a TCP port and waits for a TCP client to connect to it,
implementing APDU transfer over TCP.

This code implements the related protocol as a TTCN-3 test port
for Eclipse TITAN, which will enable us to implement a 'virtual smart
card' in TTCN-3 tets cases, primarily for testing remsim-bankd at
this point.

Change-Id: Iac37dd231a0f2e1efd484887bca1a9d672b446bb
2019-11-22 22:53:40 +01:00
Harald Welte 04c7a3d669 REMSIM_Tests: Fix REMSIM_Tests.cfg
Change-Id: Ia31c5e440fc8daec92a620c9aea7432b6cf7ea17
2019-11-22 00:40:15 +01:00
Vadim Yanitskiy 26cd244a9f PCU_Tests_RAW.ttcn: fix the expectations of TC_cs_lqual_ul_tbf
As it turned out, OsmoPCU is not supposed to change the Coding
Scheme immediately when the recent link quality value leaves the
current window. Instead, in order to avoid rapid changes of the
Coding Scheme, it also takes the previous value into account.
Thus the current Coding Scheme is only changed if both current
and old values fit into a new window.

This change makes the test case pass.

Change-Id: I5d503d5a9c46cb9de84fbabd2d591afbe4216fdb
2019-11-17 02:06:19 +07:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00:00
Pau Espin 61122c8f35 bts: TC_rsl_ms_pwr_dyn_down: Fix expected MS Power level
Related: OS#4244
Change-Id: I62c468b27d05fbff4a98ea24981188689f5899d3
2019-11-15 18:46:58 +00:00
Pau Espin 7021cfd167 stp: Introduce traffic mode type tests with unknwon dynamic ASPs
Change-Id: Ib142b021bb6d268831479723ad629be9ed378f81
2019-11-12 13:06:24 +01:00
Pau Espin 9f51483da1 stp: Move logic to create unknwon dynamic ASP to f_connect_ipa()
This type of scenario is used in several tests and will be used in more
tests in the future, so let's move there for easiness.

Change-Id: Ic65ff2ff9dc3cc82ae3fefcf3caf406279cd6b97
2019-11-12 13:06:24 +01:00
Pau Espin b72928d854 stp: Introduce TC_tmt_override
Change-Id: Id99ec3eaa431512114817d2a2af77013762ab2b9
2019-11-12 13:06:24 +01:00
Pau Espin 01ec0bf209 stp: Refactor STP_Tests_IPA tests and introduce new TC_tmt_loadshare
Infrastructure in STP_Tests_IPA changed to be more similar to what is
done in STP_Tests_M3UA, which already contain more advanced tests.

Array of AS names mp_ipa_as_names is added in order to let TTCN3 port
which AS is configured in STP for each src port.

Change-Id: Iae213c58598cc0207503fd10f09d2d57aab941fe
2019-11-12 13:06:22 +01:00
Pau Espin 872cd74cf5 stp: osmo-stp.cfg: Fix missing ASP relation in AS
Change-Id: Idcfbff548076abc17f0f6c9b13a820c8ef3033e1
2019-11-12 13:05:46 +01:00
Pau Espin 05726dd2e9 stp: Make sure all AS are shutdown when test finishes
This way traffic modes set dynamically by peers are cleared and can be
reset by next tests easily.

Change-Id: I177441b2d43298b3836ccf78fe11267333e80665
2019-11-12 13:05:46 +01:00
Harald Welte 829dac4358 stp: Add tests for running STP in M3UA ASP role
Change-Id: Ifec443858256ad79fbe29e26c609322809dd07b1
Related: OS#2005
2019-11-12 13:05:46 +01:00
Harald Welte dc9b6919aa M3UA_Templates: Fix tr_M3UA_ASPUP() length value copy+paste error
Change-Id: I7ef53b93fcdfe1ce7914bd4edb1fed8a8351b1b4
2019-11-12 13:05:46 +01:00
Harald Welte b9f7bbbc19 STP_Tests_M3UA.TC_tmt_loadshare: Clarify log message in failure case
Change-Id: I28a86f0ea0f8df28d8d22732a8647a07a936c100
2019-11-12 13:05:46 +01:00
Harald Welte cf41d4cf4c STP_Tests_M3UA.TC_tmt_{loadshare,override}: Fix double-ASPUP
Change-Id: I3acf1ce18d1a232c9ce457a19a6d36be380c42dd
2019-11-12 13:05:46 +01:00
Harald Welte 0db4413ff6 stp: Introduce STP_Tests*.ttcn for testing OsmoSTP
In the past, we were automatically running [large parts of] the nplab
M3UA and SUA test suites, but those implement only a fraction of the
functionality.  Particularly, they don't cover the non-standard IPA
behavior, and they don't cover RKM (routing key management).

Let's introduce an initial set of STP tests with this patch.  We try
to not duplicate nplab here, and implement bits not covered there.

Change-Id: I628a87385cac0dfe708a0d74a5088fbd5a4790cd
2019-11-12 13:05:41 +01:00
Harald Welte 3ffb3af476 update 'deps' to use M3UA libraries with proper NOTIFY support
Change-Id: Ifb90c815adae8e30f57c188d1f9db6d6c77d199b
2019-11-07 13:38:18 +00:00
Vadim Yanitskiy 970b153d4b BTS_Tests.ttcn: fix: move TC_pcu_ptcch to a proper place
We have a module parameter 'mp_l1_supports_gprs' that indicates
whether the L1 back-end (trxcon, virt_phy, or Calypso) does
support PDCH and TBF management.

The TC_pcu_ptcch does not require support of TBF management, only
PDCH (namely PTCCH) needs to be supported. This is already
implemented in trxcon, and can be easily implemented for Calypso.

Change-Id: Id2e751e825a7a5128bc3f2e4677d8ef31174b501
2019-11-06 04:56:35 +00:00
Pau Espin 8f77363ea3 bsc: Verify presence of MS Power Parameters IE on one test
Otherwise most tests in bsc-latest fail because in latest release BSC
never sends that IE.

Related: OS#4244
Change-Id: I725836784a7900d2ea51eae188c2c279e8639dbf
2019-11-05 19:32:34 +00:00
Pau Espin 7a9ccf8df9 bsc: Log wrong and expected values if MS Power level verification fails
Change-Id: Idacfdb8d9061d78ce6fa521d4008974c2d3d74df
2019-11-05 19:32:32 +00:00
Pau Espin 8f30ccdc28 bsc: Allow setting expected ms max power level with module param
It will allow changing ms max power in osmo-bsc.cfg as well as TTCN3
expactancies in BSC_Tests.cfg easily in docker-playground.git without
needing to recompile or change code in TTCN3.

Change-Id: Ib00c96902377582bc32778c5b947a6b4274041aa
2019-11-05 19:31:50 +00:00
Neels Hofmeyr ac7526dce4 msc: split off f_mgcp_find_param_entry()
Split f_mgcp_find_param_entry() out of f_mgcp_find_param() to be able to act on
an MgcpParameterList without an enclosing MgcpMessage.

Will be used by upcoming I8b82476f55a98f7a94d5c4f1cd80eac427b2d20f

Change-Id: I90f213d2a1be979afa024e0faa25d532f9858636
2019-11-04 15:07:04 +01:00
Neels Hofmeyr eccaa994e2 cosmetic: remove brace from comment
This '{' in the comment gets my auto indenting / syntax brace matching all
confused.

Change-Id: I303abe800037abd0c9694ae750a7acaa79c9754f
2019-11-04 00:17:41 +01:00
Neels Hofmeyr 3d22e4a1c2 improve/fix f_tc_mo_setup_dtmf_dup
- Fix error log for a missing final DTMF.

- Instead of code dup to establish a call, use f_mo_call_establish().  This
  will make the test benefit from changes to f_mo_call_establish() (which will
  soon come up to accomodate changes in osmo-msc's codec negotiation).

- Instead of hardcoding the expected N_SD counter values to detect DTAP
  duplicates, use f_bssmap_last_n_sd() and f_next_n_sd(), so that the N_SD
  counter is correct regardless of how many DTAP were sent in
  f_mo_call_establish().

- Instead of hardcoding a correct N_SD in the end, use skip_seq_patching ==
  false, so that the ttcn DTAP correctly tracks N_SD for subsequent call
  release messages.

- Release the call.

Change-Id: Ibfa8b906764f2d5ed75fe74125be42af4546e864
2019-11-04 00:17:41 +01:00
Neels Hofmeyr d9d835db4a msc-test: improve error log on Assignment RTP port mismatch
Before this, if an Assignment Request contains an unexpected Transport Layer
Address, the test completely rejects the Assignment Request.

Instead, accept any tla in the Assignment, and compare the expected tla in the
Assignment's interleave action. Thus we directly get logging hinting at the tla
instead of a T_guard timeout.

Change-Id: I04847c10d6c3bf9e04cfda6e343dfd4a65be71a5
2019-11-04 00:17:41 +01:00
Pau Espin f7630a6498 bsc: Verify ms power level value from RSL IE MS Power during CHAN ACT
Change-Id: I0a632156420251b14d1bbfd4ca19dc2bdf5a5f1e
2019-10-28 15:15:43 +01:00
Pau Espin 3d008ae837 bsc: Verify RSL IE MS Power Parameters is send upon CHAN ACT
Depends: osmo-bsc.git Icaaa61b363b093f00b6653c3df64d3e66583b9f8
Related: OS#1622
Change-Id: I2ecf03bbab169f9fda4e4a61d233d6a30b2a91b9
2019-10-28 14:50:27 +01:00
Pau Espin f8e9be73b8 deps: Fix titan.ProtocolEmulations.M3UA commit reference
The branch upstream has been rebased and old reference no longer exists.

Change-Id: I9e631663de2da0bf371404ae092ac50fdbab9c9d
2019-10-22 19:10:24 +02:00
Vadim Yanitskiy 8c242f041a BTS_Tests.ttcn: add a test case for PTCCH/D and PTCCH/U
This test case is aimed to verify handling of both PTCCH/U and
PTCCH/D logical channels, recently implemented in [1]. This is
done by sending 16 Access Bursts on PTCCH/U, and then by
sending a random data block on PTCCH/D.

The existing TC_pcu_data_req_ptcch does not cover PTCCH/U, and
moreover involves TBF handling which has nothing to do with
PTCCH. Let's keep it anyway.

[1] I232e5f514fbad2c51daaa59ff516004aba97c8a3

Change-Id: I011ffdfa63b698ce6085968d15ffb4ff4bd23ee5
Related: OS#4102
2019-10-21 11:25:40 +00:00
Vadim Yanitskiy 20f8700767 PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()
As it turns out, it was a bad idea to use a counter in altstep
as_ta_ptcch(), because its value is getting lost. Let's instead
introduce a new type PTCCH_TAI_ToA_MAP, which is basically a
list of ToA values for each PTCCH/U sub-slot (TA Index), and
pass it to the altstep.

Change-Id: I74252dfb929fcb32d07e8728d692674931fae727
2019-10-09 15:24:22 +00:00
Vadim Yanitskiy b58b7308e5 PCUIF_RAW_Components.ttcn: ClckGen_CT: fix PTCCH event handling
Both TDMA_EV_PTCCH_DL_BLOCK and TDMA_EV_PTCCH_UL_BURST events may
happen together during the same TDMA frame (fn % 104 == 90). We
shall not skip TDMA_EV_PTCCH_UL_BURST. Let's fix this.

Change-Id: Ifc66d5d1c5f9eaa7bed6882105298c45257ebef0
2019-10-09 15:24:22 +00:00
Oliver Smith 27cbd3c7e3 gitignore: add *.netcat.stderr
Change-Id: I0119153aa0a7f035f067c5a8607f8f1930b9fc1c
2019-10-09 15:37:27 +02:00