Commit Graph

3631 Commits

Author SHA1 Message Date
Vadim Yanitskiy 8a15b45ea1 PCU_Tests: fix TC_nacc_outbound_pkt_cell_chg_notif_dup
The TC_nacc_outbound_pkt_cell_chg_notif_dup is currently failing
because in [1] we changed the default hard-coded MCC/MNC values in
ts_BssgpCellIdDstAddr_default, however these it's still using
hardcoded MCC=023/MNC=43.  I overlooked this in [2].

Let's split up the f_handle_nacc_rac_ci_query() into four functions:

* f_ctrl_rx_nacc_rac_ci_req() / f_ctrl_tx_nacc_rac_ci_rsp(),
* f_pcuif_rx_nacc_rac_ci_req() / f_pcuif_tx_nacc_rac_ci_rsp(),

and use them in TC_nacc_outbound_pkt_cell_chg_notif_dup.  Also
employ them in TC_nacc_outbound_pkt_cell_chg_notif_twice.

Change-Id: I3e84f55eedd278fb239600d6a0465bd34fd8cd0b
Related: [1] 03f74d4132
Fixes: [2] 7295661af5
Related: OS#5901
2023-02-13 11:43:02 +00:00
Vadim Yanitskiy d8aa5e8a6e PCU_Tests: fix TC_nacc_outbound_si_resolve_timeout
This patch fixes TC_nacc_outbound_si_resolve_timeout, which is still
using old hard-coded MCC/MNC values.  The altstep does the same, but
relies on the updated values from ts_BssgpCellIdDstAddr_default.

Change-Id: I9f6dbe97e9a494a4e8fdb441a70999d3040f6cfd
Related: OS#5901
2023-02-13 11:43:02 +00:00
Vadim Yanitskiy 76c8b29489 PCU_Tests: remove unnecessary valueof() in NACC TCs
A string literal is already a value, valueof() is for templates.

Change-Id: I86970bb422ad1693829fd20ecf5ee34ef77f30af
2023-02-13 11:43:02 +00:00
Philipp Maier 465115e777 MGCP_Test: reject empty fmtp strings
When setting up an RTP flow the fmtp string is checked using isvalue(),
however this does not guard against empty fmtp strings. Rejecting empty
strings is especially useful in situations where the caller wants to
signal using "" that no fmtp string is present.

Change-Id: I2641a52a3b271681f4f2e424c34be12e125092d6
Related: OS#5688
2023-02-13 09:59:32 +00:00
Vadim Yanitskiy 03f74d4132 PCU_Tests: use real values for c_BssgpCell{Mcc,Mnc}
There is no such country/operator with MCC=023/MNC=43.  Wireshark
complains about that when looking at the BSSGP messahes:

  Mobile Country Code (MCC): Unknown (23)
  Mobile Network Code (MNC): Unknown (43)

This may look confusing, let's better use some real country/operator:

  Mobile Country Code (MCC): Central African Rep. (623)
  Mobile Network Code (MNC): Celca (Socatel) (03)

Change-Id: Idc22128657d10893aa5c6d8ec80538a764de5c42
Related: OS#5901
2023-02-10 20:53:10 +07:00
Vadim Yanitskiy 7295661af5 PCU_Tests: define ts_BssgpCellIdDstAddr_default
Define hard-coded default Destination Cell ID in one place.

Change-Id: I8f400ba52d4d32447e0b4a640a2f4b73699937c8
Related: OS#5901
2023-02-10 20:53:10 +07:00
Vadim Yanitskiy 88b87a49e0 PCU_Tests: improve coding style, use f_build_BcdMccMnc()
Change-Id: Ia7066c6f36678650ada61c1633977b824777194d
Related: OS#5901
2023-02-10 20:53:09 +07:00
Vadim Yanitskiy 08c90219db library/GSM_Types: add {enc,dec}_BcdMccMnc() functions
Change-Id: Id501ea146eb596085c204a51387f1b92300d1285
Related: SYS#5602, OS#5901
2023-02-10 20:53:09 +07:00
Vadim Yanitskiy 8cc1f72289 library/GSM_Types: rename f_{enc->build}_BcdMccMnc[_int]()
The enc_* functions usually return an octetstring.  However, both
f_enc_BcdMccMnc[_int]() return a sub-type of hexstring (BcdMccMnc),
so let's rename them to avoid confusion.

A follow-up patch adds the actual encoding function for BcdMccMnc.

Change-Id: I0332fe7396310da49910e89571f7181fb1604182
2023-02-10 13:46:04 +00:00
Vadim Yanitskiy 25cd0dc4c8 Revert "library/GSM_Types: fix encoding of BcdMccMnc (3 octets)"
This is a partial revert of e9858efb90.

I was confused by weird MCC/MNC values in the Destination RAI generated
by the NACC testcases from the PCU_Tests.ttcn.  As I figured out, these
values are not from the INFO.ind, but some hard-coded literals:

* SRC RAI: MCC=262/MNC=42/LAC=13135/RAC=0 (from ts_PCUIF_INFO_default);
* DST RAI: MCC=023/MNC=43/LAC=00423/RAC=2 (resolved by test itself);

so actually they're not incorrect: they're sent by the testsuite itself
in response to the Neighbor Address Resolution Request, and then
expected to be received in the Destination RAI from the PCU.

Another important point is that TITAN produces different results when:

a) converting BcdMccMnc to bytes using the hex2oct() function,
b) converting BcdMccMnc to bytes using the RAW encoder.

The key difference is that TITAN does swap nibbles in each byte when
using the RAW encoder, but does not when using the hex2oct() function.

Use the proper hexorder (low-to-high) in f_enc_BcdMccMnc().
Add a selftest to make sure we're encoding the input properly.

This change makes the NACC testcases pass again.

Change-Id: I6f497b97c4f1e270803e01530be8355beea740bb
Related: SYS#5602
Fixes: OS#5901
2023-02-10 13:46:04 +00:00
Vadim Yanitskiy 8a7437b09b pcu/osmo-pcu.cfg: use the PCUIF for neighbor resolution
This config is out of sync with the one in docker-playground.git.
The 'neighbor resolution' param makes osmo-pcu use the CTRL interface.

Change-Id: I8d59096644afd5a5278bc7bb1335670edad72576
Related: OS#5901
2023-02-10 13:46:04 +00:00
Alexander Couzens 89b4eff243 BSC_Tests: add OML tests for bts_setup_ramp
The current BSC_Tests are using osmo-bts-omldummy to keep OML out of the test context.
Add a new test file and component for OML tests.

Change-Id: I0934ea26db359b0a6649c613f01de134a3a372ee
2023-02-10 11:46:51 +00:00
Pau Espin 4e43183151 Update UIT version expectancies after Osmocom CNI release 202302
Change-Id: Iec06390a1de9391ab573e66f9bd3421f4a627c6d
2023-02-08 12:49:37 +01:00
Vadim Yanitskiy e9858efb90 library/GSM_Types: fix encoding of BcdMccMnc (3 octets)
In [1] I copied the hexstring concatenation statement for the 3-digit
MNC from the original function f_enc_BcdMccMnc(), which was renamed
to f_enc_BcdMccMnc_int().  Unfortunately, this statement (originally
introduced in commit [2]) is incorrect.

In our implementation a pair of MCC and MNC is encoded as follows:

  | MCC digit 1 | MCC digit 2 |  octet 1
  | MNC digit 3 | MCC digit 3 |  octet 2
  | MNC digit 1 | MNC digit 2 |  octet 3

Additionally, in the case of a 2-digit MNC, the original variant
of f_enc_BcdMccMnc() (before [1]) would swap MCC and MCC in the
2nd octet, generating even more unpredictable results.

According to 3GPP TS 24.008, Figure 10.5.13, the correct coding is:

  | MCC digit 2 | MCC digit 1 |  octet 1
  | MNC digit 3 | MCC digit 3 |  octet 2
  | MNC digit 2 | MNC digit 1 |  octet 3

So far the only user of this API is the PCU_Tests module.  Looking
at the PCAPs of testcases invoking this function, Wireshark indeed
shows weird MCC/MNC values (expected 262/42):

  Routing area identification: 23-43-423-2
    Mobile Country Code (MCC): Unknown (23)
    Mobile Network Code (MNC): Unknown (43)
    Location Area Code (LAC): 0x01a7 (423)
    Routing Area Code (RAC): 0x02 (2)

Change-Id: Ifa3083fdd6307b56baa1ef3ac85a3e7a2efab728
Related: [1] 7a92d5fbc0
Fixes: [2] 0637ba0728
2023-02-08 04:54:22 +07:00
Vadim Yanitskiy 7a92d5fbc0 library/GSM_Types: rework f_enc_BcdMccMnc: split and rename
* Rename f_enc_BcdMccMnc() -> f_enc_BcdMccMnc_int()
* Add f_enc_BcdMccMnc() accepting a pair of GsmMcc/GsmMnc

Change-Id: I033cce8f975f61ef2216de9f34f2ca418d71dc0b
Related: SYS#5602
2023-02-08 00:31:18 +07:00
Vadim Yanitskiy 59ef8e573a library/DIAMETER_Templates: make MCC/MNC configurable in AIR/ULR
Change-Id: I688931fac04e0d1ec525f8e0255e366b7dee9edf
Related: SYS#5602
2023-02-07 23:38:38 +07:00
Vadim Yanitskiy af0b6a2bf8 library/DIAMETER_Templates: fix incorrect default MCC/MNC
3GPP TS 29.272, section 7.3.9 clearly states: "if MNC is 2 digits
long, bits 5 to 8 of octet 2 are coded as 1111".  Octet 2, not 3.

  Visited-PLMN-Id: 11111f
  Mobile Country Code (MCC): Unknown (111)
  Mobile Network Code (MNC): Unknown (1511)
      [Expert Info (Warning/Malformed): MNC contains non-decimal digits]
          [MNC contains non-decimal digits]
          [Severity level: Warning]
          [Group: Malformed]

Change-Id: I8d76cb1569ca989a18d657f9923874c908985e0a
Related: SYS#5602
2023-02-07 23:35:52 +07:00
Neels Hofmeyr 72a8d62dd3 hnbgw: add HNBGWVTY to ConnHdlr
Change-Id: Ic325fd5eb5134529012856c08336633c1413284d
2023-02-01 15:38:36 +00:00
Harald Welte 40b1e00b3d DIAMETER_Templates: Fix 3GPP Spec number
It's 3GPP TS 29.272, not 29.262.

Change-Id: I33d437593a13a92151e33e86534e2189b541b5ea
2023-01-30 18:52:09 +00:00
Neels Hofmeyr 6a423f4f67 hnbgw: drop duplicate import
Change-Id: Ib24ecca40679fd80be2555ada208121d730c1904
2023-01-26 13:57:35 +01:00
Oliver Smith 871f45a54e mgw: new test TC_two_crcx_mdcx_and_rtp_clearmode
Add a test that uses SDP CLEARMODE towards the MGW. The SDP parameters
generated by the test look as expected when compared to RFC 4040
section 5.

Related: OS#4395
Related: https://www.rfc-editor.org/rfc/rfc4040#section-5
Change-Id: I89c5dfdcd728ab3b50e77c5062f07e1b802b1f01
2023-01-24 17:50:29 +01:00
Oliver Smith 3cfa2cce75 mgw: f_tc_two_crcx_mdcx_and_rtp: add arguments
Add arguments for codec_name and payload_type.

Related: OS#4395
Change-Id: I94d1628470db49c53eda64c29bc0716bcb339798
2023-01-24 16:46:59 +01:00
Philipp Maier e5af8a3576 MGCP_Test: ensure PT translation works when converting AMR bwe/oa
The tests that test the conversion from AMR octet-aligned to AMR
bandwith-efficient use the same payload type number on both ends. This
does match the reality. Typically the BSS uses 96 as payload type
internally, while 3gpp specifies a payload type of 112 on the link
between BSS and CN. To reflect those conditions in the test as well,
lets use 96 on one RTP end and 112 on the other.

This also increses the test coverage as we now test if PT translation
and bwe/oa conversion work together.

Change-Id: Id734b6954098130bba02f8cdf1b06e0080c3e915
Related: OS#5461
2023-01-19 13:45:42 +00:00
Neels Hofmeyr cf4935afca upf: test Session Mod, test Network Instance
Add tests and enhance the upf test suite to be closer to real world
usage:

- properly verify the F-TEIDs chosen by osmo-upf.

- add tests with two-step session creation, i.e. with a Session
  Establishment followed by Session Modification indicating the remote
  F-TEID to use on the core side, as is the usual case.

- Add module parameters for network instances to use in the test;
  dynamically configure osmo-upf's "netinst" config via VTY.

- pass Network Instance in Create PDR, verify that osmo-upf returns the
  matching GTP IP addresses in Created PDR.

Related: SYS#6192 SYS#5599
Change-Id: I440466f1cc9689391869ac2579a4497ef6008adb
2023-01-17 19:46:05 +00:00
Neels Hofmeyr c9e709bdce PFCP: add support for Network Instance IE
Related: SYS#6192
Change-Id: Iba8d423cd91e73ea40139a5b58c4e22f1a741dc1
2023-01-17 19:46:05 +00:00
Neels Hofmeyr 6defa01a28 PFCP_Templates: add Session Modification templates
Related: SYS#6192 SYS#5599
Change-Id: Id9ca1eff44a4759d25b31f34ededfcc6074517d5
2023-01-17 19:46:05 +00:00
Neels Hofmeyr 1e31146d11 upf/PFCP: do not imply f_inet_addr()
PFCP_Templates.ttcn is not the place to do the conversion between string
and OCT4.

When I wanted to use an OCT4 address in some ts_PFCP_* template, it
dawned on me that it is stupid to convert the OCT4 to a string, just so
that the ts_PFCP_* template converts it back to OCT4.

Related: SYS#6192 SYS#5599
Change-Id: Ib068831787f4256f70a2189a5f36ca1ea1f40c9e
2023-01-17 19:46:05 +00:00
Neels Hofmeyr 4a9015ffe3 upf: tweak f_ruleset_add_GTP_decaps
Improve function doc.

Always use F-TEID = CHOOSE.

Related: SYS#6192 SYS#5599
Change-Id: Ic88075001c1a7c3bd724ff8d618cef1dbd7423b7
2023-01-17 19:46:05 +00:00
Neels Hofmeyr b1dc8266b2 upf: rename tc_session_est to tc_session_est_tunend
The other use case, tunmap, needs some space next to tunend, too. tunmap
tests will be added soon.

Related: SYS#6192 SYS#5599
Change-Id: If4a4534aa237e6ff1acb6d50e3738dd4dd6e9dfa
2023-01-17 19:46:05 +00:00
Pau Espin 6b869f49d1 bsc: Fix regression in TC_assignment_emerg_setup_deny_bts
A recent commit introduced a regression which made
TC_assignment_emerg_setup_deny_bts fail.

The problematic commit (see hash below) set "pars.ra :=
f_rnd_ra_emerg()" in the helper function, which made the BSC early
reject the CHAN RQD with ImmAssRej in the case the BTS policy forbids
emergency calls.
In that scenario, rejection can be done early because there's no need to
wait to find out which MSC it is aimed at.
This scenario, however, is already being validated by test TC_chan_rqd_emerg_deny.

The scenario TC_assignment_emerg_setup_deny_bts was testing is actually
one where CHAN RQD doesn't contain reason="emergency call", which means
BTS doesn't early reject it, but only knows about it being an emergency
call when a CC Emergency Setup is sent to it, time at which it releases
the call.

Hence, this commit sets back pars.ra = f_rnd_ra_emerg() only on the ..._deny_msc
testcase, since it's the only test really needing it.

Fixes: 14076d3b72
Related: OS#5849
Change-Id: I8d342e5938f6293ae45ee399796417651768af5d
2023-01-17 13:22:23 +01:00
Daniel Willmann bc612766ea Rename TC_tx_power_start_ramp_down_bcch
Ramping down power if the oml link is lost was removed in osmo-bts.
Instead TC_tx_power_down_bcch checks that the rx power received is not
> 0 after dropping the oml link.

Change-Id: I463679d9678b95b7d3a5ace711c6ce17b3b24689
Depends: Ida1d7bbf094958b9142af306dbf84206729a609e (osmo-bts.git)
Related: SYS#6237
2023-01-12 11:44:11 +01:00
Vadim Yanitskiy 3cc065b252 fix BSC_Tests_LCLS: do not use t_def_TestHdlrPars directly
As stated in the comment near the t_def_TestHdlrPars definition,
valueof() shall not be used for getting a value of this template.
The f_gen_test_hdlr_pars() function should be used instead.

All LCLS testcases violated this, and started to fail since
recently after patch [1] has been merged:

  "MSC_ConnectionHandler.ttcn:820 : Either imsi or imei must be set!"
      BSC_Tests_LCLS.ttcn:743 BSC_Tests_LCLS control part
      BSC_Tests_LCLS.ttcn:262 TC_lcls_gcr_only testcase

Use f_gen_test_hdlr_pars() as suggested.

Change-Id: I69ab8699b0be80b12e2df590d9170a743a00d035
Fixes: [1] b27653c6b6
2023-01-06 21:42:38 +07:00
Pau Espin 14076d3b72 bsc: TC_assignment_emerg_setup_allow(_imei): Test full voice establishment
Extend tests to also test the data plane setup.

Related: OS#5849
Change-Id: I9f39f861398669a8eb1da242595de584725e5b83
2023-01-03 17:55:43 +01:00
Pau Espin 39bd33c72c bsc: Move BSSAP handling of emergency call to helper function
Change-Id: I3a88efeae6710ba005496067ecb0c8f4035404ab
2023-01-03 17:05:27 +01:00
Pau Espin 3560979cf8 cosmetic: bsc: Fix typos in comments
Change-Id: I87f351fe2ab69120a3af8d6674f2738ef2d57a3a
2023-01-03 16:56:59 +01:00
Pau Espin 1809bcee83 bsc: Use f_rnd_ra_emerg() instead of hardcoded value
Change-Id: Id10d71868dc8ef427e0353ee4b7e51d5bebc6255
2023-01-03 16:54:41 +01:00
Pau Espin b27653c6b6 bsc: Introduce test TC_assignment_emerg_setup_allow_imei
Related: OS#5849
Change-Id: I5a95cb0cd6903801db8cfcc1542bd6147461eebe
2023-01-03 14:33:17 +01:00
Pau Espin 07657aedc1 bsc: Introduce test TC_paging_imsi_nochan_ci_resp_invalid_mi
Related: SYS#6280
Change-Id: Id0d069f00bc77be33ca61ce469bea8079ae9bd16
2023-01-03 13:13:02 +01:00
Pau Espin e8a51010d7 bsc: TC_paging_resp_unsol: Avoid encoding l3 twice
Change-Id: I4c5ea6272325671e47a91124a7efe0321c9f3a02
2023-01-03 13:13:02 +01:00
Pau Espin cc77b49fe7 bsc: Submit valid l3 payload
OsmoBSC does some minimal parsing of l3 content to select MSC target,
match paging response to paging request, etc.
Since tests right now use potentially invalid data, osmo-bsc is not
rejecting conns providing invalid l3 content.

This commit makes sure TTCN3 tests pass valid l3 payloads to osmo-bsc,
so that they keep working once osmo-bsc starts rejecting invalid IEs it
parses.

Related: SYS#6280
Change-Id: I6e99ac39f32c9a981420b73f8d7d1568d2fa1c54
2023-01-03 13:13:02 +01:00
Pau Espin aa9034c32d library/L3_Templates: ts_LU_REQ(): Define fields as template (value)
Change-Id: I192eb6f191ea43aee71ff3537ced539fc0b72bf2
2023-01-02 18:56:24 +01:00
Pau Espin a6fbfe31b5 cosmetic: library/L3_Templates: Fix trailing whitespace
Change-Id: I9c27b9a2b9dc4dbabd5c2db3a63fbec4768ca4ea
2023-01-02 18:55:50 +01:00
Pau Espin 57aa1c71c1 bsc: Use c_l3_payload instead of random octetstring as l3 payload
OsmoBSC does some minimal parsing of l3 content to select MSC target,
match paging response to paging request, etc.
Since tests right now use potentially invalid data, osmo-bsc is not
rejecting conns providing invalid l3 content.

This commit is another step towards passing proper l3 data to osmo-bsc
in TTCN3 tests.

Related: SYS#6280
Change-Id: I012dbdc673ff98a6647280ce3d0245abff86cfa4
2023-01-02 18:42:02 +01:00
Pau Espin 695ada5f72 bsc: Move hardcoded octetstring to single constant field
This makes it easier changing it to be a valid l3 payload in the future.

Related: SYS#6280
Change-Id: I888bcc42d4b68bac4c12dfbbf3c74e1734318699
2023-01-02 18:41:59 +01:00
Vadim Yanitskiy 289056cf9b BTS_Tests: fix "Timeout waiting for L1CTL_FBSB_CONF"
Since [1] was merged, sending the L1CTL_DM_REL_REQ message alone
is not enough to be able to tune back to BCCH.  We also need to
send L1CTL_RESET_REQ, so the trxcon's state is reset properly.

This patch fixes the following testcases:

* TC_sacch_chan_act_ho_async,
* TC_sacch_chan_act_ho_sync,
* TC_conn_fail_crit.

Change-Id: I07192e8a3127f8d9557a4b8aac3ca002f511a1d5
Related: [1] I5bbe6ca4cc6299f9faf343822c992a6872a45081 (osmocom-bb.git)
2022-12-27 09:45:52 +00:00
Vadim Yanitskiy 02ad191b39 start-testsuite.sh: allow redefining TITAN_LIBRARY_PATH from env
I am not using Debian, so I always have to edit this file in order
to be able to run the testsuites.  Keep using default paths for
Debian, but allow redefining the TITAN_LIBRARY_PATH variable.

Change-Id: I3778a52697a182dbac39de6c18a053832ef78d93
2022-12-27 09:45:52 +00:00
Alexander Couzens 054f13e70b osmo-bts: add simple run_fake_trx.sh
Most BTS_Tests require to run fake_trx. Add a simple
run_fake_trx.sh script when running these test without
docker.

Change-Id: Ie3a68931bd52f55570409bb35962cebbfd58d168
2022-12-25 14:08:51 +00:00
Vadim Yanitskiy 7954510534 library/RLCMAC_Templates: add ts_RLCMAC_DL_DUMMY_CTRL
Change-Id: I6c2f3677151f6c4bb013e1515f43942ffc24969f
Related: OS#5500
2022-12-21 05:59:46 +07:00
Vadim Yanitskiy 71be129c31 library/RLCMAC_Templates: add ts_PTCCHDownlinkMsg
Change-Id: Ia47a5c6a5b27b41a5339f1e8ce60405b01de0a1f
Related: OS#5500
2022-12-21 05:59:21 +07:00
Vadim Yanitskiy 92c5d61ca3 library: move tr_PTCCHDownlinkMsg to the proper module
Change-Id: I9d5967142f2fbb1125434e99d7dd2557264d71c3
Related: OS#5500
2022-12-21 05:57:25 +07:00