Commit Graph

56 Commits

Author SHA1 Message Date
Alexander Couzens 619213f8ef fix typo in NS_CAUSE_PROTOCOL_ERROR_UNSPECIFIED
Change-Id: Ifbf86138f3f2e9c053c99b6f58c510d38bad4e88
2021-04-24 14:07:20 +00:00
Daniel Willmann 325458ddf7 gbproxy: Fix TC_dl_unitdata test failure introduced by 6ee0126971
This commit used a send template (ts) to match a received BSSGP PDU which
doesn't work due to some differences in the length field.
Use tr_BSSGP_IMSI again and change the template restrictions so it
compiles.

Fixes: 6ee0126971
Change-Id: I85676e96f8d32a9d2c7deadc1d66707b6b8697d0
2021-02-11 15:16:57 +01:00
Pau Espin Pedrol 6ee0126971 Osmocom_Gb_Types: Fix tons of template restriction warnings
Change-Id: I3da153ce5e83b231501e74b958fcac9f10c00849
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 7e88ce91d4 Osmocom_Gb_Types: Fix warning: control reaches end of non-void function
Change-Id: Ic2b8d0215c378ec2fd1a44775dc4e43616ca9f3c
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 810b1df0d8 Osmocom_Gb_Types: Fix warning: inadequate restriction on the referenced function
Fixes warning:
Osmocom_Gb_Types.ttcn:1377.13-32: warning: Inadequate restriction on the
referenced function `f_oct_or_wc(bmax, 2)', this may cause a dynamic test
case error at runtime

Change-Id: Icb8698c7f2ca697a3638d5a4e4e38f20e14fd34c
2021-02-08 12:32:07 +01:00
Philipp Maier 14d3a8e7c3 GBProxy_Tests: fix TC_rim_* tests
The TC_rim tests do not use the RIM templates from Osmocom_Gb_Types as
intended.

Change-Id: Ie484f288aa0515ef4df4a3cf7f8a347a3f3cf587
Related: SYS#5103
2021-01-30 19:18:36 +00:00
Philipp Maier e00776c5db Osmocom_Gb_types: add minimum requred tr_ templates for RAN INF
When testing the serving BSS part of the RIM application in osmo-pcu, we
will need receiving templates that allow us to verify the response (RAN
INFORMATION) rim container.

Change-Id: I964d7504f3c4aeaa4ce537316b3140e8b893003d
Related: SYS#5103
2021-01-29 21:18:18 +00:00
Alexander Couzens 20cd41ec89 Introduce NS test cases
Related: SYS#5208
Change-Id: Ic619a374b88879d3116f8f28afb14401c3e3192b
2021-01-25 14:14:47 +01:00
Harald Welte be7afce974 NS_Emulation: Respect data_weight==0 or signalling_weight==0
* allow configuration of signalling + data weight for each NS-VC
* advertise per-NSVC signalling/data weight in SNS-CONFIG
* keep track of unblocked NS-VCS separately for data / signalling
* transmit BVCI=0 traffic only over signalling NS-VC
* transmit BVCI>0 traffic only over data NS-VC
* accept incoming BVCI=0 traffic only if signalling_weight > 0
* accept incoming BVCI>0 traffic only if data_weight > 0

Related: OS#4953
Change-Id: I9798e639b4bc8658482945970775b012b5840779
2021-01-20 15:56:31 +01:00
Harald Welte 1308dbbd8f NS_Emulation: Move SNS handling from NS-VC to NS-VCG
We need to move the IP-SNS handling up one layer, as only the NS-VCG
knows all the other NS-VCs, and after the SNS-CONFIG-ACK, we must
mark all of our NS-VCs as alive and start the alive procedure.

Related: OS#4953
Change-Id: Ie0f4342a0346952d7c50ac36900148e311d4c782
2021-01-18 19:55:03 +01:00
Harald Welte 04358655bf gbproxy: Add test cases for STATUS handling
We expect the uplink BSSGP status to be routed based in the
inner/contained downlink PDU - and vice-versa.

Change-Id: If2ddd158346a3da340f1c673354196f3872c4f67
Related: OS#4951
2021-01-17 18:16:04 +01:00
Harald Welte 112bc1469a Osmocom_Gb_Types: Extend RADIO-STATUS templates
RADIO-STATUS can occur with TLLI, but also with P-TMSI or IMSI.
Update our templates accordingly while keeping backwards compatibility.

Related: OS#4951
Change-Id: I1119e50e457b02d52e7c2c26a8b8039bf2118296
2021-01-17 17:39:29 +01:00
Harald Welte be9bf1e74d Osmocom_Gb_Types: Add templates for various BSSGP PDU types
Related: OS#4951
Change-Id: I89044bf8e736cc1997dff1a550b3e194f8ac1b9d
2021-01-16 22:54:29 +01:00
Harald Welte 14ac346b5d Osmocom_Gb_Types: Add 3GPP spec chapters; unify formatting
Change-Id: I9c3e5458ba7637a1e85f7bb3b32e16a90fad7bc5
2021-01-16 22:54:29 +01:00
Harald Welte dbd5e677ce gbproxy: Move away from random TLLI
We used to generate a random TLLI for each ConnHldr.  Instead, use a
deterministic function to generate the P-TMSI (just like we do for the
IMSI) and derive a local TLLI from that P-TMSI.

Related: OS#4472, SYS#5002
Change-Id: Ic1eaa1d298fe998ca97432769953bfc5a5333ae4
2021-01-16 22:50:21 +01:00
Pau Espin 8bd54cf77a library: Add templates to initialize CellId, RAI, LAI
Change-Id: Ie9d86e1b651dff279e7d50a4282bf14fbed5bb76
2021-01-11 13:54:30 +00:00
Philipp Maier b76a279edf Osmocom_Gb_types: add RIM templates
The template set we use for testing the GB (BSSGB) interface on
osmo-sgsn and osmo-pcu lacks templates to generate RIM (ran information
management) messages. The records and unions are already specified in
BSSGP_Types.ttcn, we just need to form templates in order to be able to
use them.

Change-Id: Ic495e0bb6ceb2b65cbc7c3da7ee519a013aede55
Related: SYS#5103
2021-01-05 16:28:20 +01:00
Harald Welte cc3894b612 gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)
Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d
Closes: SYS#5210
2020-12-10 22:13:25 +01:00
Harald Welte 86bdcaa79d Osmocom_Gb_Types: Fix t_BVC_FC_BVC_ACK() TAG IE length
Change-Id: Ib9a09fea85110a4f0966c07d911e37234aa06391
2020-12-09 15:30:52 +01:00
Harald Welte f20af41003 gbproxy: Introduce TC_overload
When the SGSN is sending an OVERLOAD message, we expect that to
propagate down to every BSS on the other side.

Change-Id: Ic61fabd9c633bcb3f256fe7aa5834e66cc66a4fb
2020-11-28 16:14:59 +01:00
Harald Welte c0351d1015 gbproxy: Introduce TC_llc_discarded
This tests the LLC-DISCARDED message, which relates to a BVCI but
is itself sent on BVCI=0.  We expect it transparently passes from BSS
to SGSN.

Change-Id: I98d02d6fa68bddf15b732d06dab00e91e72995d1
2020-11-28 16:12:27 +01:00
Harald Welte f8e5c5dfc7 gbproxy: Test for SGSN-INVOKE-TRACE
Change-Id: I1e46e5c403712eb7972c57e6b6f6eb0850b96ae3
2020-11-28 16:12:27 +01:00
Daniel Willmann 00c0bbf272 Add templates for LLC_DISCARDED
Change-Id: I587ec89471083e339065f6371ffe6253d49007bf
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 7f1d78e164 Add templates for FLUSH_LL_ACK
Change-Id: I57ef98b9a3022ed5915381504aa129979799bee8
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 379fc250de Add templates for FLUSH_LL
Change-Id: Id432022fdd7f96bc014f0fd81658fa4aa796a688
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Harald Welte 0e18824f3b gpborxy: Implement variety of paging tests for PS-PAGING and CS-PAGING
Change-Id: Ida44b62dfdb9c4ce2755de63d51a9907d34f247f
2020-11-23 14:51:38 +01:00
Daniel Willmann 670bbc0c4e Osmocom_Gb_Types: Fix indentation
Change-Id: I4ca156b53dfe9daa190d52a7de46be56cf74099a
2020-11-20 15:09:00 +00:00
Daniel Willmann 05d4638b9b Add templates for BSSGP Radio Status procedure
Change-Id: I6d49eb4907c4568d88da5d6fd7962e388a3607fb
Related: SYS#5210
2020-11-20 15:53:55 +01:00
Daniel Willmann ace3ece7be gbproxy: Add test for RA Capability Update procedure
Change-Id: I023b3d24a31d117f05c7327b08e9f8f930720944
Related: SYS#5210
2020-11-16 20:32:20 +01:00
Harald Welte 6dc2ac471b gbproxy: Test for RA Capability procedure
Change-Id: If7e5a5cab1e445e0b4ef0466990e352143c31245
2020-11-16 20:32:20 +01:00
Harald Welte 2436fb5bcc BSSGP: parametrize tr_BSSGP_DL_UD
Change-Id: Ib4a1d64da634813b49474c13ae080d729bbabcf1
2020-11-16 19:13:26 +00:00
Harald Welte 8f66af1665 move f_gprs_tlli_{type,random} to Osmocom_Gb_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I6fc41ed94e97e0ec44dc4ea56d110bdd9ac77a72
2020-11-12 21:51:40 +01:00
Alexander Couzens 7b1e44f791 PCU: add IPv6 support for SNS
With PCUIF 10 the remote can be IPv4 or IPv6.
Add all missing parts including SNS IPv6 elements,
the support to omit IPv4 elements and a PCU_Tests_SNSv6.cfg
configuration to run all tests with IPv6

Change-Id: I43d64caca600fff78f3fbbb3e8179f447f235d46
2020-10-21 11:49:54 +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 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 557c9f8cb8 move some key types from GSM_RR_Types to GSM_Types
This in turn means Osmocom_Gb_Types doesn't need to depend on
GSM_RR_Types anymore, which is particularly ugly as the latter
now depends on RLCMAC_*, creating a long chain of dependencies.

Change-Id: I8c8da7709695ff0023f71b3999291e2515b22e46
2020-09-13 10:18:41 +02:00
Alexander Couzens 9843b66952 Osmocom_Gb_Types: add a simple tr_NS_STATUS()
Change-Id: I0de6c483361a00a924a278a77151253450a0c1a2
2020-09-07 06:12:51 +02:00
Pau Espin c03eb12b58 pcu: Test Downlink UNIT_DATA messages from SGSN containing IMSI IE
osmo-pcu.git 0052051c07af63da98137c9f8e3b3119642eb587 introduced a bug
(fixed in 1d68cdff928f32941aff36c70e4543203c283d15) where no MS could
GMM attach to the network, but no test showed the issue.
This couple test verifies both correct behavior and also ensures wrong
IMSI is detected and reported.

Related: OS#4729
Change-Id: I5072d80b7ed9945a6083cdf3254efb8b8f119c54
2020-08-29 07:56:46 +00:00
Harald Welte a36b246462 Osmocom_Gb_Types: tr_BSSGP_PS_PAGING should use template arguments
Change-Id: I7d0110e6f26fd407e11b2c60d78f4cd16f0d45af
2020-06-18 11:28:42 +00:00
Pau Espin 1860bf8391 library/Osmocom_Gb_Types.ttcn: Fix typo presece->presence in function name
Change-Id: I50f1c23e83e9b87de09844226b110d2c48b7cfdb
2020-04-26 14:44:35 +00:00
Vadim Yanitskiy 7b2242157b PCU: also test GSGN originated PS/CS Paging containing TMSI
This additional couple of test cases reveals several bugs:

  1) the IUT encodes a erroneous RR Paging Request message
     containing P-TMSI, so TITAN fails to decode it;

  2) the IUT prints an invalid P-TMSI in its log output
     due to load of misaligned address (found by UBSan).

[1] I97fd5ffc15a4a58112d7c37c69b7ac42b0741a0e
[2] Icf8836f216793e342b239c8e6645aac1e82bf324

Change-Id: I7fbec5b2c5c3943a7413417b623f55c135c152d7
2020-03-26 16:27:50 +07:00
Pau Espin 2422d1fa82 pcu: Introduce TC_mt_ping_pong_with_dl_racap
Allows checking how pcu parses MS RA Capabilities coming from SGSN.

Change-Id: Iedd8ab278547471b72252743d93a0f9e11d7e787
2020-03-18 15:53:17 +01:00
Pau Espin 88bf537b35 pcu: Introduce tests for CS and PS paging from SGSN/Gb
CS Gb paging and PTP CS/PS paging implemented in osmo-pcu:
I9501e02e1d7f6944497e724dbccb9a19c3f5221f
I5c52b5af740460c48bb3ba858243b1d20e624268

Related: OS#3927, OS#2406
Change-Id: I90b5a792c1d91e38ea7b8c060ff0b459673df951
2019-12-23 14:46:07 +01:00
Alexander Couzens c7dddbd7d0 Ensure BcdMccMnc is encoded as 24.008 10.5.5.15
PCU is using BcdMccMnc as it's encoded as 24.008.
But SGSN code is using it as it would be byte by byte
sorted.

Fixes: OS#3878
Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206
2019-04-12 15:10:24 +00:00
Harald Welte 797ab3a91c pcu: Fix MCC/MNC handling: use 'F' between MCC and MNC in 2-digit case
Change-Id: Ifdb64c501095839e86894716769adb53e3c17382
2019-03-27 11:17:49 +00:00
Harald Welte 23989a64da Osmocom_Gb_Types: Add more templates for BSSGP SUSPEND/RESUME
Change-Id: Ife25401043d565e52a73206c562bbb68bcfdbafa
2019-03-27 11:17:49 +00:00
Harald Welte 72099557a5 PCU: Add test for SNS Change Weight procedure
Change-Id: Ia63865139f63969ccde010b01ddb8fb073209f3a
2019-02-26 11:28:28 +01:00
Harald Welte 630d0e6523 PCU: Add tests for SNS with separate signalling/data NS-VC, ADD, DEL
Change-Id: Ie1d14a901b354daa4e3796fe66e7390d87c7e778
Related: OS#3617
2019-02-26 11:28:28 +01:00
Harald Welte f4bf131eca Osocom_Gb_Types: Add send/receive templates for SNS-SIZE and SNS-CONFIG procedure
Change-Id: Iaa12c468a9e665d2050945cfc0a60dab4024071c
2019-02-18 20:25:00 +01:00
Harald Welte 387ab37dfd Osmocom_Gb_Types: Differentiate send (value) and receive templates
Change-Id: I90400c42d3dff0a1de0022320d76f10ac748a206
2019-02-18 20:25:00 +01:00