Commit Graph

2306 Commits

Author SHA1 Message Date
Harald Welte e241df4c72 frnet: Add BSSGP_Emulation
Change-Id: I00f69a30f8ffcaed680f0f885b6789b45120f700
2020-10-12 17:19:20 +02:00
Harald Welte 7dcf174098 FRNET: Frame Relay network side emulation
Change-Id: I95d64dc26a8d2ff02d6cf2bfcd22a97e5481f957
2020-10-12 17:19:20 +02:00
Harald Welte 17bab82de0 WIP: frame relay test
Change-Id: I055d7bd9c7eb05c0b17db0a35d701df0eb457d62
2020-10-12 17:19:20 +02:00
Harald Welte e1aa2796f1 stp: Add TC_rapid_init_shutdown()
Change-Id: I3d37cd80acfaf042b60f1590ee12a0e26d8853b5
Related: OS#4625
2020-10-12 17:19:20 +02:00
Harald Welte 3355c4dc28 bts: HACK: Run TRXC over 127.0.0.1 only
Due to https://osmocom.org/issues/4798 I'm unable to make fake_trx.py
work on anything but 127.0.0.1

Using the config changes in this commit, I can exectue the tests against
the following fake_trx.py command:

./fake_trx.py -R 127.0.0.1 -r 127.0.0.1 --trx TRX1@127.0.0.1:5700/1   --trx TRX2@127.0.0.1:5700/2 --trx TRX3@127.0.0.1:5700/3

Change-Id: I37e78b4b68beca2ceb15819a0fc30a0134cb177d
Related: OS#4798
2020-10-12 17:19:20 +02:00
Harald Welte d0aed4f1b6 bts: Update osmo-bsc.cfg and osmo-bts.cfg
Somebody seems to have forgotten to update the osmo-bsc.cfg file here,
as osmo-bsc wouldn't even start using the file here.

Change-Id: I8453da3bda36912ee42fb0c8d862f75b2065965f
2020-10-12 17:19:20 +02:00
Harald Welte 9b965d5350 bts: Increase SI sampling duration if SI2quater is involved
The existing sampling duration of 8s was insufficient to collect
sufficient samples to confirm the scheduling rules.

Change-Id: I2f631935c86fb840cdd733c28b2df503512341fa
2020-10-12 13:15:53 +00:00
Harald Welte a616ec9260 bts: Log more details in case SI sampling returned insufficient results
Change-Id: I2b853dfff0800cd87e49a3360019ff7198aeafb2
2020-10-12 13:13:04 +00:00
Harald Welte c87d81f916 bts: Avoid race condition in TC_pcu_deact_req
When our emulated PCU sends a DEACT.req to the BTS, there is no way
of knowing when exactly that command will have been completed: There is
no confirmation sent in response.

Let's introduce a f_sleep(1.0) to give the BTS sufficient time for
deactivating the channel.

This will make  TC_pcu_deact_req pass reliably.  It currently fails
in about one third of all test executions on jenkins.

Change-Id: Id9a559b8b208a60f71c3eb9a23830e4d2dbc5df9
2020-10-12 13:13:04 +00:00
Harald Welte c935fad594 bts: Adjust to VTY text change
In osmo-bts Change-Id If53fb07ec38f6bbc368ce84d14e59fa8167691d3
unfortunately the wording / syntax of the VTY was changed.  Let's
adjust to the new wording.

Change-Id: I4a6d37febde104e70ce03992b7e2e8fb793b5a00
2020-10-12 13:12:26 +00:00
Harald Welte 194b691b18 bts: Make f_power_from_band() fail in case of unknown band
Otherwise we get into weird error cases about unbound variables that are hard to debug.

Change-Id: I5716a5dc6ce95daa663be87a1a4fe611b719495e
2020-10-12 13:12:26 +00:00
Harald Welte 52ae168480 bts: Fix TC_rach_load_count
The first RACH LOAD IND may only cover a fractional reporting
interval, and hence must be ignored.

Change-Id: I32a703847fbf2b95993e910e6510613902e2bb1a
2020-10-12 13:12:26 +00:00
Harald Welte e37f9a504f bts: Fix TC_rach_load_idle_thresh0()
The first RACH LOAD IND may only cover a fractional reporting
interval, and hence must be ignored.

Change-Id: I43ee8e846803e2ef6218a3e7ac385ed8af30c217
2020-10-12 13:12:26 +00:00
Harald Welte 762202288b bts: Make TC_pcu_socket_verify_info_ind pass
f_init / f_init_pcu simply save the first PCU_INFO_IND
in g_pcu_last_info.  That first one might still be wrong as
the PCU might connect to the BTS before the BTS is configured
accordingly.

Let's wait for 2 seconds and actually use the last (most recent)
PCU_INFO_IND for the test.

Change-Id: I45717605fde66bf870bcb6e2560f0fc753d05d95
2020-10-12 13:12:26 +00:00
Alexander Couzens 475074bd3b bsc: copy osmo-bsc.cfg from docker-playground
The old file wasn't valid anymore.

Change-Id: Ic72bd755828d0cb6c5858e2fb7800e875f64369a
2020-10-12 02:25:17 +00:00
Harald Welte cb14e0665c Osmoocm_Gb_Types.ttcn: Add various additional templates
Those can help to match if messages meet certain constraints stipulated
in the BSSGP specification.

Change-Id: I05c768f5a9e4f0b5c1375c2603135a349c38e849
2020-10-11 16:34:39 +00:00
Harald Welte c46ea3cefc bsc: Fix random failures in BSC_Tests.TC_early_conn_fail
We cannot use a random 8bit value as RACH request, as some of that
space actually maps to emergency call RACH, which is rejected unless
we enable it in the config.

Change-Id: Ie073fe721022c392278e8632ab52122b4b89cbe1
2020-10-11 18:19:44 +02:00
Harald Welte f3d3a72caf Common.cfg: Always log VEERDICTOP on Console
This will keep the console posted about any verdict changes.

Change-Id: I11c7568df5ff63066cdf1f6868b3da005e960495
2020-10-10 18:15:37 +02:00
Vadim Yanitskiy d53fb672c9 PCU_Tests: introduce TC_pcuif_info_ind_subsequent()
This change reproduces a segfault caused by the recent regression [1].
The IUT tries to bind on BSSGP host:port that it's already bound to.

[1] Ib389925cf5c9f18951af6242c31ea70476218e9a

Change-Id: I4c3bc883d795e5d1ee5ab175ac03684924692a7c
Related: SYS#5108
2020-10-10 10:30:06 +00:00
Harald Welte e97e3af203 PCU_Tests_{NS,SNS}: Fix our expectations regarding CellID in BVC-RESET
The BVC-RESET / BVC-RESEt-ACK follow a set of rules:

* Signaling BVCI=0 never has a CellId in BVC-RESET nor BVC-RESET-ACK
* Any BVC-RESET or BVC-RESET ack in BSS->SGSN direction must have CellID
* Any BVC-RESET or BVC-RESET ack in SGSN->BSS direction must NOT have CellID

Let's adjust our test expectations accordingly.

This will break tests against "latest", but the amount of work-arounds
needed in this code outweighs the benefit.

Change-Id: Ic8a83f5214c372faa15178dd9b54364e7d2a60cb
2020-10-09 14:59:56 +02:00
Harald Welte 5339b2e372 BSSGP_Emulation: Support multiple PTP-BVC within one Entity
The existing BSSGP_Emulation is built around the assumption that every
instance of BSSGP_Emulation only servers one signaling-BVC and one
PTP-BVC.  While this is true for osmo-pcu at this point (BTS-colocated
PCU), other BSS/PCU implementations differ.

In general, there can always be any number of PTP BVC (one per cell)
next to the signaling BVC (one per BSS).  Let's represent this in
BSSGP_Emulation so we can create more comprehensive tests.

Change-Id: I7e30b4c4e188518a574e082962fba457b3a97ce3
2020-10-09 12:27:11 +02:00
Harald Welte 23e274919d PCU_Tests_NS: Fix our expectations regarding CellID presence/absence
This is required by the spec, and implemented libosmocore since
Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1

So let's change our test expectations.  Meanwhile, introduce
mp_tolerate_bvc_reset_cellid for working around the bug in 'latest'.

Change-Id: Icebee25b53fef623db6ae91ca0d943e70a3c86b7
2020-10-09 12:27:11 +02:00
Harald Welte 12d19b81a7 BSSGP_Emulation: Ensure BVC-RESET for BVCO=0 has no CellId IE
This is required by the spec, and implemented libosmocore since
Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1

So let's change our test expectations.  Meanwhile, introduce
mp_tolerate_bvc_reset_cellid for working around the bug in 'latest'.

Change-Id: If6245d73ed701e631b67146ace4ba028bdb4226c
2020-10-09 11:44:20 +02:00
Vadim Yanitskiy 2ef6a2f7fb BSC_Tests: fix f_mo_l3_transceive(): relax DLCI matching
Since If4d479a54cad467f53b49065c1c435a4471ac7d2, osmo-bsc started
to send more concrete DLCI values on the A/BSSAP interface.  In
particular, the control channel identification bits now indicate
whether it's SDCCH/FACCH or SACCH channel.

Let's use '?' as the default DLCI template that we expect to get
from the IUT, so those test cases, for which DLCI is not a part
of the testing scenario, would not fail.

Change-Id: Ida659d53e0d31f9aa0ea2ccccefc94d8c659eb76
2020-10-08 23:17:44 +07:00
Harald Welte 04ce4c6047 pcu: Don't log timer operations of ClkGen-0 (every 4.16ms)
We don't need to spam the console with that kind of information.

Change-Id: I029193f6e21415f53424ebf4417e3fcd9a53c86c
2020-10-04 23:41:45 +02:00
Harald Welte c967d0e6f2 BSSGP_Emulation: Only add CellId to BVC-RESET[-ACK] conditionally
We always used to include the CellID IE, but 3GPP TS 48.018 is
actually quite specific about when it should be present and when not.

Change-Id: Iffd023f0272c9ccb087bdd225fcfb08424a46bdf
2020-10-04 21:09:11 +02:00
Harald Welte 18ed23cda5 regen-makefile.sh: Put libraries in LINUX_LIBS, not LDFLAGS
Additional libraries to be linked should be in LINUX_LIBS (appended at
the end of the linker command), not part of LDFLAGS (prepended to
the beginning of the linker command).

On binutils 2.35.1 / Debian unstable, without this patch, I get

/usr/bin/ld: IPL4asp_PT.so: undefined reference to `sctp_bindx'
/usr/bin/ld: IPL4asp_PT.so: undefined reference to `sctp_connectx'

which is resolved by this patch

Change-Id: I8a339076f445e3c650e407ae982c7c2dc4a760b2
2020-10-04 21:09:11 +02:00
Harald Welte 847a77e32f NS_Emulation: pass around string idenifier for components created
We want to see useful identification for components in the log, and
hence must be giving every component a name at create() time.

Change-Id: I0fe650243953e4d85161684865acd0354b2e465f
2020-10-03 18:27:05 +02:00
Harald Welte 3dd8355d7d NS_Emulation: Delay Tx of first NS-RESET until Provider tells us it's up
Change-Id: I300cfeb120540940990a834596b0a83a539df080
2020-10-03 18:27:05 +02:00
Harald Welte 4a6a663654 NS_Emulation: Refactor if/elseif/... clause to altsteps with guard
This makes for much more readable code, and we can even do without
activating any default altsteps.

Change-Id: I4c38dd55b7c27899735f5730851d36c1410d96a8
2020-10-03 18:27:05 +02:00
Harald Welte bd612cd328 NS_Emulation: Introduce status events from provider -> emulation
This allows NS_Emulation to react to changes of the underlying
transport layer (e.g. Frame Relay Link/DLCI up).

Change-Id: If00e9c50dc664ce62b6c0cbde99d741e8173169b
2020-10-03 18:26:59 +02:00
Harald Welte 867243a3ec NS_Emulation: Add [optional] support for FrameRelay transport
This adds a NS_Provider_FR which interfaces between FrameRelay_Emulation
and NS_Emulation.  Include support for it only if enabled at compile
time to avoid pulling in a dependency on the FrameRelay stack for every
user of NS_Emulation.

Change-Id: I42ca811d23e383e362d2527c8ff2c916a62a5b42
2020-10-03 18:24:50 +02:00
Pau Espin 8c0f2fc0b0 stp: wait until IPA handshake is done in f_connect_ipa
Otherwise when trying to send stuff to an IPA ASP in some test, it may
fail because the ASP is till not active in the STP (because IPA
handshake was yet not finished, race condition).

Change-Id: I8ea11fe331baf2b65ce0b7b3c1a2b480332faa2a
2020-10-03 08:16:56 +00:00
Vadim Yanitskiy 61f784a436 BSC_Tests: introduce TC_tch_dlci_link_id_sapi for OS#3716
The aim of this test case is to verify DLCI / RSL Link ID conversion
for MO/MT L3 messages on SAPI0/SAPI3.  In particular, the test suite
verifies the following scenarios:

  - RSL -> BSSAP:
    - 16 MO messages on FACCH/F with SAPI0,
    - 16 MO messages on SACCH/F with SAPI3;
  - BSSAP -> RSL:
    - 16 MT messages on FACCH/F with SAPI0,
    - 16 MT messages on SACCH/F with SAPI3.

Change-Id: Ica69ae95b47a67ba99ba9cc36629b6bd210d11e4
Related: OS#3716
2020-10-03 03:40:03 +07:00
Vadim Yanitskiy 0033a3b4e8 BSC_Tests: introduce f_mt_l3_transceive() sending BSSAP -> RSL
Change-Id: I5f1685815a4477b4d50351d3518ae21dd7d20139
Related: OS#3716
2020-10-03 03:40:03 +07:00
Vadim Yanitskiy b93aa4375c BSC_Tests: parametrize f_mo_l3_transceive()
Change-Id: I617a103e9dae8f16e3f3996c89e53ace49f7bfa8
Related: OS#3716
2020-10-03 03:40:03 +07:00
Vadim Yanitskiy 74ae5eb448 BSC_Tests: s/f_verify_active_layer3/f_mo_l3_transceive/g
The new name is more concrete and better reflects what the
function does: transmit a MO L3 payload to the IUT over the
A-bis/RSL and receive it back on the A/BSSAP.

Change-Id: Ic2b60b60c49ae7788ce03503b8b867bb9e55244b
Related: OS#3716
2020-10-03 03:36:15 +07:00
Neels Hofmeyr 67de93784e BSSAP_LE: comment/log tweaks
Change-Id: I39ae5abc932c8cb5eb37b8c25a84621bd9ff30ca
2020-10-01 06:48:55 +02:00
Neels Hofmeyr 7b562bfe42 fix typo BSSMAP_LE_LCS_CAUSE_UNSPEIFIED
Change-Id: Iff154cba13febf1a2e623b6de64fb39ffb91b302
2020-10-01 06:48:55 +02:00
Neels Hofmeyr c4c2a9176b fix BSSAP_LE_Types FIELDORDER
Change-Id: I6f3d5b238912923431db36a1ba7b4973ae4e2e91
2020-10-01 06:48:55 +02:00
Neels Hofmeyr 929b406940 update expected results
Change-Id: Icb534a2b00fc48c3ead009a620e6061e595cb581
2020-10-01 06:48:55 +02:00
Neels Hofmeyr 4365481254 bsc: undup f_verify_active_layer3()
Change-Id: Ia4433618787b58f8789c9e97cdfbb8b320a09395
2020-10-01 06:48:55 +02:00
Neels Hofmeyr 767548a82b bsc: f_logp(): add VTY pt so it works on various components
So far only worked on test_CT, now also on MSC_ConnHdlr by passing the
respective BSCVTY.

Change-Id: I85ad0a59af72aa72e26a1252f946ada43388dc17
2020-10-01 06:48:49 +02:00
Philipp Maier a208389c07 MSC_ConnectionHandler: allow to use IPV4 as default
When the BSC sends a CRCX without an IP address in it, the testcase will
automatically assign an IPV6 address in the response. However, this
breaks compatibility with older versions of osmo-bsc that do not have
IPV6 support. Lets add a module parameter in order to be able to use
IPV4 as default if required.

Change-Id: I30c77abef63636bb02db12d2f2b2d79ea244b96c
2020-09-29 21:28:59 +00:00
Pau Espin 37cf40843e sip: ACK on SIP failure message to avoid it being retransmitted
Otherwise the SIP message is retransmitted by osmo-sip-connector around
10-11 times, even when next test has started, making it fail since it's
not expected.

Change-Id: Icd0f7a7fac4be2aa97eb986c3d3d27dd70a49357
2020-09-28 10:38:07 +00:00
Harald Welte 5e8573e9b7 NS_Emulation: Prepare NSConfiguration for non-IP providers
NSConfiguration currently contains parameters relevant only for IP
based transport.  Move IP/UDP parameters into a sub-structure in
anticipation of Frame Relay support.

Change-Id: I6904520d8c2f546327029777d68b1907611a8cf5
2020-09-27 09:15:32 +00:00
Pau Espin 6ed083c6c8 bsc: Call f_shutdown_helper() on all tests missing it
This should hopefully avoid sporadic errors during tear down of tests
such as TC_si_acc_rotate.

Change-Id: I8c8a1061b546576b7a5c4b11f20dfc887aaab6e0
2020-09-25 20:37:58 +00:00
Daniel Willmann 535aea686e pcu: Check stats for pcu channel allocation, bytes transferred
Change-Id: I90964b32fa11ed2582afc5fb56bd302b06606f86
Related: SYS#4877
2020-09-25 12:31:36 +00:00
Harald Welte 9a7c512bbd NS_Emulation: Fix Tns-alive/Tns-test expiration detection
Change-Id: Icb7d076f57c166b498c1b3edd84edcf13ea9739d
2020-09-25 10:01:53 +00:00
Pau Espin 00f40e8a0d cosmetic: bsc: Fix indentation alignment
Change-Id: I5484784fca254044055a9f131e1ebb19de8ceba5
2020-09-25 09:57:53 +00:00