Commit Graph

3608 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy 1df1a8f824 library/L1CTL_PortType: allow sending L1ctlDlMessage via L1CTL_PT
We need to be able to send L1ctlDlMessage to the l1gprs_test [1],
a special program for testing the MS side GRR implementation.

Change-Id: I18e7585a8e93e3fafeda63b7325cfcc73e792abd
Related: [1] I36ceec4035b2ea593d47998f3f14f1415c606765
Related: OS#5500
2022-12-21 05:51:57 +07:00
Vadim Yanitskiy 60b6188211 library/L1CTL_Types: add send template for L1CTL_DATA_IND
We need to be able to send L1ctlDlMessage to the l1gprs_test [1],
a special program for testing the MS side GRR implementation.

Change-Id: Id163cb53afcbf803caf60a5b1a5768c67a9a2bf0
Related: [1] I36ceec4035b2ea593d47998f3f14f1415c606765
Related: OS#5500
2022-12-21 05:48:11 +07:00
Vadim Yanitskiy 0a3e31c1f7 library/L1CTL_Types: eliminate warning about missing 'h0h1' field
Change-Id: I73c86eea4708823e9c004a5b830793ce705dcb75
2022-12-21 05:43:42 +07:00
Vadim Yanitskiy 80726d8e8f fixup: ttcn3-tcpdump*.sh: Fix output of special chars
On ArchLinux /bin/sh is actually a symlink to bash, so bash is running
in limited mode and emulating the Bourne Shell.  The shell detection
logic added in [1] does not work correctly for me because the cmdline
would be 'sh' or '/bin/sh', not 'bash'.  This is what I am getting:

  \033[1;32m====== FooBar_Tests.TC_foo_bar pass ======\033[0m

Let's switch to printf, which does interpret the backslash escapes
as expected by default, regardless of the actual shell in use.

Also fix ttcn3-dumpcap-stop.sh, which was left untouched by [1].

Change-Id: Id28193a7ca00b5501a6852e5b4a5412fbaa5e063
Fixes: [1] bf45a5cff8
2022-12-20 15:05:55 +00:00
Vadim Yanitskiy 01d0a90b68 BSC_Tests: fix a race condition in TC_chan_rel_conn_fail
Change-Id: Ic8ee641c19f47442538eaba2b120736bec793c70
Fixes: OS#5823
2022-12-20 13:03:58 +00:00
arehbein 388decda30 Revert "WIP: ns: Add test for SNS Size NSEI IE"
Revert submission 30430

Reason for revert: I did not consciously merge these, maybe some misunderstanding of Gerrit UI elements. Although it really surprises me that merging could have happened that easily without me noticing
Reverted Changes:
I85c2dc201:WIP: ns: Add test for SNS Size Num. of IP Endpoint...
I3584b7b04:WIP: ns: Add test for SNS Size NSEI IE
Ic69c461cd:WIP: ns: Add test for SNS Size Num. of NSVCs IE

Change-Id: Ifab74bd8ae568a3099637fb53f5fe407f85952b6
2022-12-12 11:00:05 +00:00
arehbein f065016dc8 Revert "WIP: ns: Add test for SNS Size Num. of IP Endpoints IE"
Revert submission 30430

Reason for revert: I did not consciously merge these, maybe some misunderstanding of Gerrit UI elements. Although it really surprises me that merging could have happened that easily without me noticing
Reverted Changes:
I85c2dc201:WIP: ns: Add test for SNS Size Num. of IP Endpoint...
I3584b7b04:WIP: ns: Add test for SNS Size NSEI IE
Ic69c461cd:WIP: ns: Add test for SNS Size Num. of NSVCs IE

Change-Id: I2b963d8d547b7c97ba8499921e42c57bab4ffaee
2022-12-12 11:00:05 +00:00
arehbein 1d35200056 Revert "WIP: ns: Add test for SNS Size Num. of NSVCs IE"
Revert submission 30430

Reason for revert: I did not consciously merge these, maybe some misunderstanding of Gerrit UI elements. Although it really surprises me that merging could have happened that easily without me noticing
Reverted Changes:
I85c2dc201:WIP: ns: Add test for SNS Size Num. of IP Endpoint...
I3584b7b04:WIP: ns: Add test for SNS Size NSEI IE
Ic69c461cd:WIP: ns: Add test for SNS Size Num. of NSVCs IE

Change-Id: I838b9b608a939ff909efe24ce3c1fdbfb539939d
2022-12-12 11:00:05 +00:00
arehbein 928459a8ab WIP: ns: Add test for SNS Size Num. of NSVCs IE
Related: OS#5208
Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
2022-12-10 15:14:03 +01:00
arehbein 1b007f08b3 WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
Related: OS#5208
Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
2022-12-10 15:13:25 +01:00
arehbein 2a6726c547 WIP: ns: Add test for SNS Size NSEI IE
Related: OS#5208
Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
2022-12-10 15:11:36 +01:00
Pau Espin 00fec58871 pcu: TC_paging_cs_from_sgsn_*: Fix race condition between BSSGP tx and RLCMAC rx
It can happen that the RLCMAC req arrives at osmo-pcu before the
CS_PAGING we send to it over BSSGP, in which case osmo-pcu will schedule
an RLCMAC DL Dummy Block. Take into account this scenario to avoid
failing id it occurs.

Change-Id: I30da93835c7738aefcd84691d83f39759dd4b599
2022-12-02 14:57:44 +01:00
Pau Espin 3f2b5e41ea pcu: TC_mt_ping_pong*: Fix race condition waiting for first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state

Change-Id: Icc94eb0544226facddcd65be65a8a41bcfc662cc
2022-12-02 14:56:03 +01:00
Pau Espin 45b98aa0ee pcu: TC_dl_flow_more_blocks: Fix race condition waiting for first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state

Change-Id: I67483bc423567d1fc98eb912ece1cf5cda746119
2022-12-02 14:53:31 +01:00
Pau Espin e3e2bf6e78 pcu: Fix race condition in TC_cs_max_dl waiting for timer first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state.

Change-Id: If7121473a3580b40d3a658dc38b9bb1421196127
2022-12-02 14:53:28 +01:00
arehbein e66c1f8e5a ttcn3-tcpdump*.sh: Fix tcpdump procs not being killed
Also: Fix possibly empty files not being deleted.

Fixes: cf8c450ed5
Fixes: OS#5796
Change-Id: I4e17d8313755c36f130982c921abf69d78c98ae6
2022-11-28 22:52:52 +01:00
Neels Hofmeyr ef0b3e6bb4 upf: in PFCP Sess Est, use local F-TEID = CHOOSE
So far the test asked osmo-upf to use an actual IP address and TEID, but
normally it is sent with CHOOSE = 1 so that osmo-upf picks a new local
TEID and returns it with the proper local IP address in the response.

This is making the test more realistic, and also prepares for testing
Network Instance handling, where osmo-upf will need to return the proper
IP addresses for specific Network Instance names.

Change-Id: Iaba372cbb2e0cf0c5bee80b09d346f9bcb78bfbe
2022-11-28 13:48:15 +00:00
Neels Hofmeyr 021a953cac UPF_Tests.cfg: fix wrong mp_verify_gtp name
The proper name is mp_verify_gtp_actions.

jenkins is not affected because it uses another .cfg from
docker-playground.git.

Change-Id: Ia13407db795021a2c3e2923c08b63ad6cdd6b0f9
2022-11-28 13:48:15 +00:00
arehbein be074e1964 ttcn3-tcpdump-stop.sh: Don't use lsof
`lsof` isn't available in the docker image, use /proc fs instead to get
the shell type

Related: OS#5736
Change-Id: I38e132f49b0711d611d08b61c28b3092c991a191
2022-11-25 23:35:51 +01:00
arehbein bf45a5cff8 ttcn3-tcpdump*.sh: Fix output of special chars
Don't print '-e' option in non-bash shells.

Related: OS#5736
Change-Id: Idac0f902d2f5eb142a3f130409451c8f77b111f6
2022-11-25 23:35:36 +01:00
arehbein bc85a324be ttcn3-tcpdump*.sh: Log stderr separately to file
The old output is preserved, too, in order to ensure
compatibility with expectations regarding legacy behavior.

Related: OS#5736

Change-Id: Ia92ff32c8ce09ab7805c5509837ec88fa4b864c5
2022-11-25 23:26:06 +01:00
arehbein cf8c450ed5 ttcn3-tcpdump*.sh: Fix scripts hanging on sudo prompt
Related: OS#5736

Change-Id: I05687f9bc0bb87c6f1d5c42ba235dbb90a49aeb6
2022-11-25 16:22:00 +01:00
Vadim Yanitskiy 94e60c851c {sgsn,gbproxy}: do not link non-existent TCCConversion.hh
Change-Id: If1a3b0bac7438aa49faa905c8879d096248edfb7
2022-11-24 03:56:46 +07:00