Commit Graph

3578 Commits

Author SHA1 Message Date
Eric Wild c01eada147 tcpdump capture script: check permissions to fix running in a netns
This might be all caps (=ep), or a list of all caps.

Change-Id: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d
2022-05-24 08:32:52 +00:00
Eric Wild 85cc161c0d msc tests: fix test so they don't depend on previous test runs
The test currently implicitly check the vlr state left by preceding tests.

Change-Id: Iebaecd28a426b15baf4729f40b46dd33da79cbae
2022-05-24 08:32:45 +00:00
Pau Espin 2fde1efd8e pgw: Validate charging reported values
Change-Id: I5024abc672bf92d41027c4c78d2925d0537bb470
2022-05-23 11:38:05 +02:00
Pau Espin 8fa2284189 ggsn: Validate charging reported values
Change-Id: I497309bb0b30c61bdb00e0c08f18294ecd4dd485
2022-05-23 11:35:37 +02:00
Pau Espin 733369ab20 cosmetic: ggsn: document and clean up section in GT_CT
Change-Id: I8bafb546d5d8b819cb0962b50049005ff2b85cb4
2022-05-20 18:39:55 +02:00
Pau Espin d6b51330ab ggsn: TC_act_deact_retrans_duplicate: Fix case where initial seq_nr is 65535
Change-Id: I2a7a399cf962311aaf7270260cb2e4e00e5a676a
2022-05-19 17:48:49 +02:00
Pau Espin 82a7f7033a ggsn: Fix seq_nr overflow
As seen running a test:
GTP_Templates.ttcn:87 Dynamic test case error: The first argument of function int2oct(), which is 65536, does not fit in 2 octets.

Change-Id: Icbaf42879bade6f5b4e39144ec123bc1b3f893f8
2022-05-19 17:41:40 +02:00
Pau Espin e343a88756 pgw: Improve checks around Gy messages
Change-Id: Ica3ca4cf72113d66e74dcff9f838e39cc5d63468
2022-05-19 14:13:10 +02:00
Pau Espin a2af578a1a ggsn: Improve checks around Gy messages
Change-Id: I702796f2f941b78da904faa2ffdba4185333bc0d
2022-05-19 14:13:07 +02:00
Pau Espin 837ed5092f DIAMETER_Templates: Drop unused param
Change-Id: Ic806f7d23f6e3b23365f4d45874b0bc3b3ec91d1
2022-05-18 20:14:41 +02:00
Pau Espin b8cd34a248 library/DIAMETER: Rename template to follow naming style
Change-Id: I1c7cfbea25a2da99813aa3c4f8a5760c4185ee26
2022-05-18 20:14:30 +02:00
Pau Espin d25095f7ce ggsn: Properly encode MISDN IE in GTP
ISDN-AddressString contains an initial byte at the start.
We didn't care so far because we were not yet checking the content of
msisdn, so the usual first '12'O byte was being considered as a header.

Let's store it in GTP format as before, but let's pass it as a
charstring when initializing the PdpContext, so that the human-style is
visible in the test for easy visualization/comparison (It will be
verified in a follow-up patch in Gy Diameter interface).

Change-Id: Ie1b65707d4b08f2201572e1fa44a1f9f985eb096
2022-05-18 20:01:44 +02:00
Pau Espin 35e308a26c DIAMETER_Types_ttcn: Generate types for TS 32.299 (Gy)
Change-Id: I8413781a28362816a1f93790951c125defbbaf6b
2022-05-18 12:09:58 +00:00
Pau Espin c24a18c594 Add script to regen library/DIAMETER_Types.ttcn
This way we have a reproducible way to generate the same
library/DIAMETER_Types.ttcn file.

Change-Id: Ie6fdb8003a0faf25a5bf4027b672da73f788988e
2022-05-18 12:09:58 +00:00
Harald Welte ee4d70c025 RAN_Emulation: f_ran_unregister_imsi complement for f_ran_register_imsi
We have a function to register an IMSI but we're missing a function
to unregister it from RAN_Emulation.  This will cause resource leaks
and eventually an overflow of the ImsiTable.  We don't notice this yet
as we don't have long enough running tests in the test suite yet.

Change-Id: I1f5d86c999d4495d661166f98183dfbc48f05f47
2022-05-17 19:48:15 +02:00
Harald Welte 130110c895 GSUP: add f_unregister_imsi() to unregister an imsi/connhdlr
Change-Id: I13f6784533fe0e1f42d9595f028861d4645ec1a9
2022-05-17 19:48:15 +02:00
Harald Welte 17f3208195 GSUP: Add function to unregister expect; clarify naming
Change-Id: I4f2eb3c2b48c8626eb2da633579a874d089be73a
2022-05-17 19:48:15 +02:00
Pau Espin 535ca2658b ggsn: Append MS TimeZone IE to CreatePDPCtxReq
TS 29.060 states that it shall be included for primary PDP context
activation if the information is available, so let's add it by default.

Change-Id: I8c7e491a07cadfe09403504a82d34e412673a531
2022-05-16 17:11:08 +02:00
Pau Espin 38968e9ba9 ggsn: Append IMEISV IE to CreatePdpCtxReq
Change-Id: I00975328e94afd116e59c88fd96c5b0154810a1e
2022-05-13 17:41:15 +02:00
Pau Espin 0e127870fb ggsn: Append ChargingCharacteristics IE to CreatePdpCtxReq
This IE is conditionally added if the HLR provides it to the SGSN.
Let's add it by default so that we test code paths where GGSN parses it.

Related: SYS#5925
Change-Id: Ia0f74041d2107afeaa36b94e33474370b7b07c0e
2022-05-13 11:54:27 +02:00
Neels Hofmeyr 07ea7f26be msc: add test for OS#5532: crash from CM Serv Rej
Reproduce the assertion trigger crashing osmo-msc reported in OS#5532,
i.e. a CM Service Request that contains a mismatching Mobile Identity.

Causes osmo-msc to crash with an assertion, so run it last.
Fix of the crash: I6c735b79b67108bcaadada3f01c7046e262f939b

Related: OS#5532
Depends: I6c735b79b67108bcaadada3f01c7046e262f939b (osmo-msc)
Change-Id: I3f84d00f456aaee578787059d7010c25efcdcf56
2022-05-05 01:45:57 +02:00
Pau Espin 7d39f9ea94 pgw: Send MSISDN in GTPv2C CreateSessionRequest
Change-Id: I71bcad944f40aa78357f2d11f54d139103ca3e24
2022-05-04 10:09:09 +00:00
Harald Welte 7c083af2d2 remsim: server: TC_connect_{client,bankd}_duplicate
Add two new tests for the remsim-server, which simulate what happens
if a client or bankd with identical ID connects twice.  We expect
the second connection to get rejected at RSPRO level, and to be closed.

Change-Id: I29023f6b5ba430338c77bf01508c81bd6d8c99fa
Ralated: OS#5527
2022-05-04 10:08:44 +00:00
Pau Espin 2fe8895baf ggsn: Use larger MSISDN number
Change-Id: I8a1eeb48efdddaa4f5466cdbe72545523ce31cb8
2022-05-04 10:08:12 +00:00
Pau Espin d3339a78f8 bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq
First, page only on BTS0, not all the BTS. This simplifies the test and
also makes the subscriber be refcounted only on BTS0.
Then, drop the OML connection after receiving all the expected paging
requests; it will make the BSC flush the paging queue and hence avoid
TTCN3 checks erroring due to dangling subscriber talloc contexts.

Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f
2022-05-03 12:57:08 +00:00
Vadim Yanitskiy 866afc2c61 BTS_Tests: add TC_ipa_crcx_ack_addr reproducing OS#5242
Change-Id: Ic85904c967238555a6243a3df2d9225b957d5a5c
Related: OS#5242
2022-05-03 12:52:58 +00:00
Vadim Yanitskiy 0dd96e9391 BTS_Tests: workaround addr='0.0.0.0' in f_rtpem_activate()
If a CRXC message contains optional remote IP and port IEs, the
CRCX ACK received from the BTS is expected to contain its listen
address and port.   In some cases osmo-bts may indicate nonsense
addr='0.0.0.0', and indeed the RTP_Emulation component is not gonna
like this.  This makes both BTS_Tests.TC_speech_rtp_tch[fh] test
cases fail whenever executed in Docker:

  Connection refused (unexpected)

Let's work this around by sending the remote IP and port IEs in
additional MDCX message and omitting them in CRCX.  This mimics
osmo-bsc's behavior and makes both test cases pass.

Change-Id: I03453e72f62819989dfe6aa12d8bd889fced1046
Related: OS#5242
2022-05-03 12:52:58 +00:00
Vadim Yanitskiy 1567bac64c library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX
Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f
Related: OS#5242
2022-05-03 12:52:58 +00:00
Pau Espin 189bf1b8c1 bsc: Introduce test TC_paging_450req_no_paging_load_ind
Change-Id: I787cba895f1cb6c5bfef95259bcf69b4291a9237
2022-05-02 20:43:48 +02:00
Harald Welte c81236c08f cbc: Expect CBC to include Channel Indicator IE in CBSP KILL
This should be present for all KILL relating to CBS.

Change-Id: Id9f280158a0370134ec4a4ca9a977d884670b27e
Related: SYS#5906, OS#5540, OS#5541
2022-05-01 15:58:04 +00:00
Vadim Yanitskiy 7b4b464f91 bts/osmo-bts.cfg: reduce OML logging verbosity, degrade to notice
Average size of osmo-bts.log after running ttcn3-bts-test is ~178 MB,
and more than 52% (!) of it is the OML logging messages.  Other than
making the logfile bigger, bursts of OML messages make it really hard
to follow the output of osmo-bts when running tests natively.

Change-Id: Ib5346a3ca42917169e195f905472ccea7579e5eb
2022-04-30 02:38:07 +03:00
Pau Espin f01f305e31 bsc: Avoid sending CCCH Load Ind (paging) when RSL C0 becomes up
The paging CCCH Load Ind should only be sent when the BTS is over the
threshold, which is not the case when it starts up.
The BSC should underststand that the BTS under threshold and be able to
send paging requests.

Change-Id: I19a97e97ec96ba8ea2e28b1be8ac3b706b43e1b7
2022-04-29 12:22:33 +00:00
Harald Welte 4a788a0812 bsc: Increase test coverage for CBSP emergency broadcasts
This adds new tests:
* TC_cbsp_emerg_write_bts_cgi_noreplace
* TC_cbsp_emerg_write_bts_cgi_replace
* TC_cbsp_emerg_write_bts_cgi_kill

All of the above relate to improved / fixed handling of emergency
broadcasts in some corner cases.

Related: SYS#5906
Related: OS#5539, OS#5540
Change-Id: Ic0f0b3d620f3ca73bab3d45997d0c1b9433ac1f7
2022-04-27 18:39:56 +02:00
Harald Welte 8bb2944c2f bsc: CBSP code refcator: Add f_exp_rsl_etws()
This function reduces code duplication between CBSP tests.

Change-Id: I69bedd43bc88bc619b80bf9038da901bbff9f04b
2022-04-27 18:39:56 +02:00
Harald Welte 1222f52b43 bsc: Fix TC_cbsp_write_then_kill expectations
A more clear reading of TS 48.049 is that the KILL COMPLETE should
*only* contain a Cell List IE if it relates to an Emergency message;
only the Number of Broadcasts Completed IE indicates successful
cells.

osmo-bsc fixes this in I9a43d386da01f085663d231a555b8b5acc99faca

Change-Id: Ia50e50f9812d9934d35d32b25e1079240df04a82
Related: SYS#5906
2022-04-27 18:39:55 +02:00
Harald Welte d686941aa8 CBSP: tr_CBSP_REPLACE_CBS_COMPL: num_compl_list is optional
The list might be empty because either there were no broadcasts
completed in case of a CBS message, or because it was an emergency
message where this IE is never used.

Change-Id: I2b24ac7e5857bdd50a821399b3c383cea9d408ad
2022-04-27 18:39:26 +02:00
Pau Espin ef7ef632da bsc: TC_paging_500req: Validate initial transmissions have higher prio
After osmo-bsc Change-Id I1ae6d97152c458247bc538233b97c2d245196359,
initial requests are prioritized over retransmits.
Before that feature was in place, when sending 500 requests in this test
to the BSC, it could happen that the paging scheduler triggered (every
500ms) before all the 500 requests were received at the BSC. As a
result, the scheduler would put some requests to the end of the queue
after sending an initial request for it towards the BTS. If later more
requests where received from TTCN3, they'd be put at the end, after the
retransmissions.
As a result, the emulated BTS would in general receive retranmits for
the first bunch of requests before receiving the initial transmit of the
later requests.
Ths is no longer the case since the osmo-bsc is prioritizing now the
initial requests. Hence, we'll only start receiving retransmits after
all the new paging requests are received.

Depends: osmo-bsc.git I1ae6d97152c458247bc538233b97c2d245196359
Change-Id: I5876f828b43e1e51bd892ce3c9a4dbed6b53f066
2022-04-26 10:12:17 +00:00
Neels Hofmeyr de564b1f57 bsc: TC_emerg_premption: check BSSMAP Clear Req cause
On the first TCH, establish Layer 3 so that the BSC will issue a Clear
Request at all.

Verify the cause value of the Clear Request.

Tear down the established Layer 3: clean up for the leak check.

Related: OS#5535
Depends: I20108f7b4769400b89b7b0d65c8dab883bf87c46 (osmo-bsc)
Change-Id: Ib13be73119cfc96712f32899c02e655e1751d547
2022-04-25 21:19:22 +00:00
Neels Hofmeyr ace698cdee bsc: TC_emerg_premption: test RR rel cause
Related: OS#5534
Depends: I0423621d15ace11a53ae1653e5e7f5cb93605edb (osmo-bsc)
Change-Id: I47e919edc25a8427f49d654f97f05e46a89da16d
2022-04-25 21:19:22 +00:00
Neels Hofmeyr 32ef591fee bsc: TC_emerg_premption: clarify chan_nr
Rename chan_nr to first_tch, and more clearly show that the TCH that is
released gets assigned to the emergency call.

Related: OS#5534
Change-Id: I0c540d76eedfd4115b410921bf5a0b6c2d00b5c2
2022-04-25 21:19:22 +00:00
Pau Espin 431f3460dd pgw: Add TC_gy_charging_cc_time
Related: SYS#5276
Change-Id: Ie4e567f62bbbdba276e6b3221111c8d9f82cde14
2022-04-25 09:21:45 +00:00
Pau Espin 09b9bad21e bsc: Introduce test TC_paging_500req
Related: SYS#5922
Change-Id: I4f7185939c20804deef92f476ed19248ba885f29
2022-04-22 17:38:02 +02:00
Pau Espin 251d0646e0 pgw: Initial Gy support
Related: SYS#5276
Change-Id: I04cf78cb4bc73de59f803c01208a7ef9056cb14f
2022-04-22 11:06:12 +02:00
Pau Espin 8b3123fe5f pgw: Support having several DIAMETER_ConnHdlr per PGW_Session_CT
A new intermediate component DIAMETER_ConnHdlr_CT is added which extends
the required DIAMETER_ConnHdlr by the DIAMETER_Emulation, and forwards
it to the PGW_Session_CT. This way, the PGW_Session_CT, which usually
runs the test code, will have access to GTP2, Gx and Gy messages for the
session.

Initial Gy support for PGW_Tests is added in follow-up patch.

Change-Id: I28f1ac0a013e479058f28a6feff6901b33f6c247
2022-04-20 18:34:33 +02:00
Pau Espin cb1e8278f9 ggsn: Fix TC_addr_pool_exhaustion not answering Gy CCR termination
Change-Id: If126840001b1e10d3dee86d678e624a0584337e8
2022-04-20 14:43:43 +02:00
Harald Welte 3912895260 bsc: Expect number-of-broadcadsts-completed-list in CBSP KILL COMPLETE
When responding to a CBSP KILL with a CBSP KILL COMPLETE, make sure
we include the optional "Number of Broadcasts Completed List" IE
in order to inform the CBC about how many times the just-killed
message had been broadcast before it was killed.

It seems some CBCs expect this IE to be present, while 3GPP TS 48.049
lists it as optional.  osmo-bsc is including this IE as of Change-Id
I47aebd613dfc6dd9261ea9019a51aff0cd6470d8

This change updates the test suite to expect this IE to be included.

Change-Id: I5b56676c93479ec7b32cff66c9738fff7d0228cf
Related: SYS#5906
2022-04-15 04:54:10 +00:00
Vadim Yanitskiy 5ac8f31b38 bsc/osmo-bsc.cfg: explicitly set AMR link adaptation parameters
The default AMR link adaptation parameters have been changed in
the recent osmo-bsc, so set the old expected default explicitly.

Change-Id: I320d91a35bc50bdfe87c0384035a10b8672ef23c
Related: osmo-bsc.git Ic5f8d55d250976d8d4c9cae2d89480fd52326717
Related: SYS#5917
2022-04-14 22:51:47 +03:00
Harald Welte 67881aef23 Avoid generating zero-length packets
I used the construct like f_rnd_octstring(f_rnd_int(100)) in a number
of places to generate random-length packets with randomized length.

The problem I didn't realize is that f_rnd_int() of course can also
return '0', which would generate zero-length packets.  This may be
permitted in some protocols, but it leads to problems e.g. when trying
to send a UDP packet of zero length (which the kernel will not do).

So let's introduce
* f_rnd_int_nonzero() for returning non-zero randomized integers
* f_rnd_octstring_rnd_len() for returning a random-length random payload
  octet string
* replace all f_rnd_octstring(f_rnd_int()) call sites with the new
  function.

Change-Id: I818a113ff8d2a2f7cab2ec7d9c8661607c6331d6
Closes: OS#5528
2022-04-12 22:52:47 +02:00
Pau Espin 12c4aa8bb7 GTPv2_Emulation: Increase reset_all_stats timeout
Release of 256 tuns + threads takes quite a reasonable amount of time.
Let's increase the timeout since reset_all_state can take around 10
seconds sometimes.

Related: OS#5523
Change-Id: Ie01e07bd698cb5c386f757f4ec315f4892ad61cb
2022-04-12 09:44:52 +00:00
Neels Hofmeyr 2677b87978 bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
Deactivate as_Media() once the handover is completed, so that it does
not fail on the expected MGCP DLCX from release.

Fix fallout seen in these tests:
SCCPlite
 BSC_Tests.TC_ho_into_this_bsc
 BSC_Tests.TC_ho_into_this_bsc_a5_0
 BSC_Tests.TC_ho_into_this_bsc_a5_1
 BSC_Tests.TC_ho_into_this_bsc_a5_3
 BSC_Tests.TC_ho_into_this_bsc_a5_4
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3
 BSC_Tests.TC_srvcc_eutran_to_geran
 BSC_Tests.TC_srvcc_eutran_to_geran_a5_3
 BSC_Tests.TC_srvcc_eutran_to_geran_src_sai
 BSC_Tests.TC_srvcc_eutran_to_geran_forbid_fast_return
 BSC_Tests.TC_ho_into_this_bsc_sccp_cr_without_bssap

All of these tests use f_ho_into_this_bsc().

(It is not clear to me why only the SCCPlite tests show the fallout, the
AoIP should be similarly affected, but isn't.)

The failures were introduced by recent merge of
I0633f60f09d58802f6be0238ef41a632d93a4327, which made as_Media()
stricter by failing on early DLCX.

Related: SYS#5916
Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
2022-04-12 01:53:00 +02:00