Commit Graph

2799 Commits

Author SHA1 Message Date
Harald Welte 424ec5211c SGSN: Some initial SNS tests for IP-SNS in OsmoSGSN
Change-Id: I821d998704756fa30278f41d0371051db9d3fc58
2021-04-01 21:27:33 +02:00
Harald Welte 7ef6d10145 ggsn: Fix TC_pdp4_act_deact_with_single_dns()
In TC_pdp4_act_deact_with_single_dns we activate, deactivate and then
re-activate a PDP context. Hoewver, we re-use the same variable and
don't reset the state in between.  This results in the second PDP CTX
activation to include an end-user-address (static IP allocation), which
OsmoGGSN doesn't implement.

Before osmo-ggsn Change-Id Iac8868438655fe4e5e07d167d7dbd6273dbb7678,
the test passed as osmo-ggsn simply ignored the requested static address.
After that change, we reject static addresses and hence the test starts
to fail.

Change-Id: I1b1869bc2cee39c8fddd8fa63f48bdaa6a65e462
Related: OS#5097
2021-04-01 21:27:33 +02:00
Harald Welte b5688f26ed gbproxy: Verify BVC FSM state during bring-up
This adds IUT fsm state instrospection via the CTRL interface.

docker-playground will need to set "mp_gbproxy_ip" in its configs.

Change-Id: I272e43b9be8ba53d8a815e8ab099c939f63413a7
2021-04-01 18:25:31 +02:00
Harald Welte 8396096c1c CTRL_Adapter: Add function to obtain FSM instance state
This can be useful to verify expectations about the state of FSMs
in the IUT.

Change-Id: I33afc2e73be06e23147b5ac0b0fd3b9003935444
2021-04-01 18:25:31 +02:00
Vadim Yanitskiy 94bbe99796 BTS_Tests: refactor and fix TC_pcu_socket_connect_multi
The expectations of this test case were wrong.  The IUT would first
accept() an additional connection and then close() it immediately.
Since there may be other messages, like TIME.ind and DATA.ind, the
'alt' statement would not match successful connection result, and
instead would unblock the flow due to timeout.

The titan.TestPorts.UNIX_DOMAIN_SOCKETasp had to be changed [1] to
send UD_connect_result with ERROR if recv() returns zero or a negative.

[1] https://github.com/eclipse/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/pull/4

Change-Id: I898b8b14515d79766b12d652ebb1ddf834e2863c
2021-04-01 15:34:39 +00:00
Harald Welte 572b0179ae Make f_{block,unblock}_ptp_bvc_from_pcu handle multiple SGSNs
Those tests predated SGSN pooling support and needed to update
their assumptions to also cover other SGSNs in the pool.

We could come up with more complex, auto-scaling mechanisms to handle
different numbers of SGSNs, but that would make the code quite
unreadable, as it means we cannot use interleave but have to dynamically
activate altsteps for counting.  I went for the simpler approach
instead.

Change-Id: I8c3ec4e00b78cff40ac72bc857161fa7abc352b0
Related: OS#4968
2021-03-30 13:25:29 +02:00
Harald Welte b1cc0b24d3 gbproxy: Generalize as_count_bvc_block() into as_count_bvc_sts()
... and while add it, add as_count_bvc_unblock() based on it.

Related: OS#4968
Change-Id: I33ceace527d6a0cd816fb4e042fdcffd8f0dd23f
2021-03-30 13:25:29 +02:00
Harald Welte c771bfbe36 NS_Emulation: Use endpoint list for SNS-CONFIG payload
We used to have no distinction between endpoints and NSVCs, meaning
that we could not have more than one NSVC per endpoint, which in turn
meant it was ok to iterate the list of NSVCs for generating the
endpoint lists in the SNS-CONFIG payload.

With Change-Id I05a50b966b8ce93497372ca403d40fd383dd35f7 we remove that
constraint and introduce an actual local IP endpoint list.  Let's use
that one for SNS-CONFIG.

Change-Id: Ifa91510430a017fa29592a3d5fa2a3697d29c9da
2021-03-29 22:58:49 +02:00
Harald Welte ad32071825 NS_Emulation: Use the "endpoint" mode of NS_Provider_IPL4
Thew newly-introduced "endpoint" mode of NS_Provider_IPL4 allows us
to have multiple NS-VC within one endpoint.  NS_CT takes care of
creating the NS_Provider_IPL4 components on-the-fly, and then
associating the per-NSVC components with it.

For the user nothing changes, other than that he can now configure
multiple NSVCs with identical local IP + port, which was not possible
before.

Change-Id: Id7360f17e528706e8145d33a14550789d50cded9
2021-03-29 22:58:46 +02:00
Harald Welte 4bef0ddf9b NS_Provider_IPL4: Implement new "endpoint" mode
This adds a new, optional "endpoint" mode to the IPL4 provider,
where we remove the constraint of "one NSVC per provider", which
in turn is a pre-requirement for real IP-SNS support with full
mesh of NS-VCs.

This code doesn't introduce any users of this "endpoint" mode yet.

Change-Id: I05a50b966b8ce93497372ca403d40fd383dd35f7
2021-03-29 22:58:26 +02:00
Pau Espin 73c5d37846 pcu: Adapt N3101_MAX verification expectations
There's some offset between Tx and Rx path, so we need to account for
differences counting and finding out USF blocks didn't arrive.

Change-Id: I868e7d24c8bdc9b85797f8fe4f9ee1bc5a3d1adb
2021-03-29 14:23:05 +02:00
Pau Espin 4ceb61c063 pcu: Avoid early TBF release due to N3101 in TC_multiplex_dl_gprs_egprs
Also change a bit expectations, since it can actually happen that DL
blocks for GPRS-only MS never signal USF for itself, which is
still fine.

Change-Id: Iedff87cedf55ab18b32bd0f159d1145901878203
2021-03-29 14:22:40 +02:00
Vadim Yanitskiy 216021a35e BTS_Tests: fix IPv4 matching in TC_pcu_socket_{nsvc_ipv4,two_nsvc}
This commit fixes a regression introduced in [1]

Change-Id: I107039f1ff44ae8c41d690f5f293ed136c17586b
Fixes: [1] Ia9f366ca1fdad700a90ca3367e43523f7bac39a1
2021-03-24 15:51:40 +01:00
Harald Welte 6a414c8001 RAW_NS: Ignore NS-UNITDATA while waiting for NS-ALIVE in oneshot mode
Change-Id: Id2738b055f860b4eee57d445944e0861b34151be
2021-03-24 00:57:29 +01:00
Vadim Yanitskiy ec9e981c74 BTS_Tests: do not connect to PCUIF socket if not used
The PCUIF connection involves a lot of frequent messages, such as
the TIME.ind and since recently DATA.ind with len=0.  As a result,
the test suite logs are getting unreadable due to lots of coding
warnings and port queueing notifications.

This change is aimed to improve the situation a bit, by establishing
the PCUIF connection only for those test cases which actually use it.

Side effects:

  * TC_pcu_socket_verify_info_ind becomes reliable, because the
    PCUIF establishment is done after the RSL bootstrapping;

  * TC_pcu_socket_connect_multi starts to fail, because it used
    to pass due to timeout, since not all messages are handled
    in the 'alt' statement.

Change-Id: I09ccb65ce94a41ffdad4e93da650c3f32d422af4
Related: OS#5083
2021-03-23 13:41:09 +00:00
Vadim Yanitskiy c1981b7a5b BTS_Tests: cosmetic: s/f_init_pcu_test/f_init_with_pcuif/
Change-Id: Ic95c46426ed3ac9ead645037059190fead181b31
2021-03-23 13:41:09 +00:00
Vadim Yanitskiy e2a50a88ac BTS_Tests: add a test case verifying coding of two NSVCs in INFO.ind
Change-Id: Id11094774d737a545a2cce389059d7e527219573
2021-03-23 13:41:09 +00:00
Vadim Yanitskiy 204fe621ed library/PCUIF_Types: use PADDING attribute for 'PCUIF_Message'
PCUIFv9 compatibility has been dropped in [1], so now we can tell
TITAN's RAW codec what kind of padding to expect in received
messages and to append to encoded messages.  This eliminates
thousands of warnings about unhandled tail octets.

Change-Id: Id5ab587f7984a91f3603efc5d427aa4cb4fa6757
Related: [1] Ia9f366ca1fdad700a90ca3367e43523f7bac39a1
Related: OS#5083
2021-03-23 13:41:09 +00:00
Vadim Yanitskiy 1da1fefb73 library/PCUIF_Types: get rid of version 9 compatibility glue
Change-Id: Ia9f366ca1fdad700a90ca3367e43523f7bac39a1
Related: OS#5083
2021-03-23 13:41:09 +00:00
Harald Welte 22deecc8ea RAW_NS: don't expect hard-coded number of NSVC/endpoints in SNS-SIZE
Change-Id: I5d567582db18be0f875e8e2ba380a04a1a838350
2021-03-23 13:14:21 +01:00
Harald Welte 093a69b3a6 pcu: sync configs with docker-playground
Change-Id: I41f6ebd63e5e551184f0863cd388c373ab0a1130
2021-03-23 13:14:21 +01:00
Alexander Couzens 6c723fb7b4 ns: SNS: add testcase to test change_weight retries
Change-Id: Ie8d976a81abe0bcff53bb74991d428dbf1fe314b
2021-03-20 16:41:42 +01:00
Alexander Couzens d5ac510648 ns: SNS: add bss change weight testcase
Do a normal SNS configuration. Afterwards the BSS will change
the weights of the endpoints

Change-Id: I691b9d26bf3eb8fa65aa02eba3efd0fd3869fc2a
2021-03-20 16:41:01 +01:00
Harald Welte 09e04ba648 sgsn: sync config files with those from docker-playground.git
Change-Id: Ice00a0a4d00629e30b4fec029353d590eba8877f
2021-03-20 15:41:36 +01:00
Harald Welte d5836dca12 sgsn: Avoid race condition in TC_suspend_rau()
In f_routing_area_update() we are sending a RAU Complete to the SGSN
and then immediately afterwards send a GTP-U from the simulated
GGSN to the SGSN.  That GTP might reach the SGSN faster than the
RAU Complete, resulting in a test failure.

Change-Id: Ic489e0857115cf24965e413a39918edc5a8f44f8
2021-03-20 15:40:00 +01:00
Vadim Yanitskiy 1317faa7fc bts/osmo-bts.cfg: enable GSMTAP Um frame logging
Change-Id: Icc5ffed6cda47c15ac703ef336ef502d2047cc2c
2021-03-19 13:09:52 +01:00
Vadim Yanitskiy 7c0ba54e41 bts/osmo-bts.cfg: use 'gsmtap-sapi enable-all'
Keep PDTCH/PTCCH disabled, it will blow up PCAPs otherwise.

Change-Id: Id1b523faf0d0ab6df00e46a40917c703b26d0e96
2021-03-19 13:09:52 +01:00
Vadim Yanitskiy 03f38ae080 bts/osmo-bts.cfg: remove deprecated 'uplink-power-target'
Change-Id: Ida5b1357d199e222b9ebd64e833ca21e6506a36c
2021-03-19 07:19:19 +00:00
Vadim Yanitskiy 4ffa56380e {bsc,bts}/osmo-bsc.cfg: remove deprecated parameters
Change-Id: I39fe349a9c1011c8ba3160d4f5f3744d30e9fe24
2021-03-19 07:19:19 +00:00
Oliver Smith 64d6cc446a Makefile: SUBDIRS: add ns
Make the list git-friendly while at it.

Related: SYS#5396
Change-Id: I36adc972ea724308bbe5423f1bacf280cef901b0
2021-03-17 18:44:42 +01:00
Pau Espin c62ebac3a3 pcuif: make variable const
Change-Id: I0450a49a4c9a8e0e1252d6561fb93f6fb4585748
2021-03-12 15:07:06 +01:00
Pau Espin ed9ca9719e pcu: Set up PCU TDMA clock by sending initial DATA.ind
In recent osmo-pcu commits, initial fn was changed to invalid value -1,
in order to be able to detect FN jumps. previously, the initial value
was set randomly to 0, which was wrong anyway because first FN received
from the BTS could be any other FN counted by the BTS at that time.

This makes some tests fail because they send RACH.ind + RTS.ind to
receive the Imm Assignment, and the Request reference in the Imm Assign
was calculated on the invalid unset FN "-1", hence it won't match test
expectancies.

In order to fix it, simply make sure the TDMA clock is initiated by
sending a DATA.ind to the PCU before tests start doing stuff
(f_init_raw() is blocked waiting for BTS_EV_SI13_NEGO).

Related: osmo-pcu.git Change-Id I29fb27981597edc69abb976049ba41aa840488cb
Related: OS#5020
Change-Id: I00c4dd9133ec9a236bf28fb8cb0afd0615791012
2021-03-12 12:59:30 +01:00
Pau Espin 873686f029 pcu: transmit PCUIF DATA.ind with len=0 when no UL data to transmit
PCUIF will be updated to always send DATA.ind for each expected block FN
on any activated PDCH slot, irrespective of whether valid data was
received or not, similarly to what's done already for TRXDv1 NOPE.ind in
TRXD and TCH channels in OsmoBTS. The aim at this change is to be able to
track TDMA clock in an accurate way without hops, and hence be able to
detect on time whether expected UL blocks (SF, RRBP poll) didn't arrive.

Older osmo-pcu versions can cope well with this change, they will simply
print an error upon ach data_len=0 messages received and submit a GSMTAP
block, then discard it, so tests still pass.
Nevertheless, a new module parameter is added to disable this new
behavior in order to avoid logs and pcap files ending up clogged with
uneeded information until a new osmo-pcu release appears.

Related: OS#5020
Change-Id: Ib4f97a9bcfa68230945effeb6412218faa64ec78
2021-03-12 11:44:42 +00:00
Harald Welte 5a8540f9c1 pcu: Fix PCU_Tests_SNS.TC_sns_so_bvc_reset_unknown_bvci
All BSS-originated BVC-Reset for PTP BVC must contain a Cell Identifier.
This test is not respecting that rule

libosmogb correctly detects this and discards the RESET, which is not
what is intended here:

20210305120722368 DLBSSGP ERROR BSSGP BVCI=1235 Rx RESET missing mandatory IE (gprs_bssgp.c:392)

Change-Id: I57ebfc50befc47d0690021d73b52c504f0df4f9a
Related: OS#3879
Fixes: Iea5519b453dd544c5a78b3b16ddb5132d20cf67c
2021-03-10 12:30:19 +00:00
Pau Espin f30fa1d24d pcu: Introduce test TC_n3101_max_t3169
This test currently fails to pass in master osmo-pcu (and latest) due to
T3169 not being implemented exactly as per specs (due to limitations in
detecting lost UL blocks with assigned USF).

Related: OS#5033
Change-Id: I56177850f084cdaf4fcac63ebdcdff9cef4e7a5d
2021-03-05 15:06:49 +01:00
Pau Espin 14ca7e3398 pcu: Introduce test TC_n3105_max_t3195
Related: OS#3928
Change-Id: I6f756c928509364fee14c552279f01b4e4f0e060
2021-03-05 15:04:50 +01:00
Pau Espin 84a8c3c3dd pcu: Introduce tests to validate X2301 and T3191
They are tested together since anyway in order to reach T3191 we need to
go through X2301 (IDLE TBF timeout).

Related: OS#3928
Change-Id: Ib6dfc5711b9c6f1fd404bce424bbf4b115fc930e
2021-03-05 15:04:47 +01:00
Pau Espin Pedrol 90fdfed829 pcu: Introduce test TC_dl_no_ack_retrans_imm_ass
Change-Id: I1c1d89f3de9ba158f802e7759ef78dc84f48218f
2021-03-04 12:43:25 +01:00
Pau Espin Pedrol ddd6c3f656 pcu: f_TC_mo_ping_pong_2phase_access(): Fix race condition
Sometimes the DL data may arrive too late to PCU and it may be requested
to tx before it arrives, hence the PCU will in that case schedule and
transmit a UL ACK/NACK instead of the expected DL data.

Change-Id: Iaee546e2021e86ca6da19ab73cc8d283a827a665
2021-03-03 14:38:53 +00:00
Pau Espin Pedrol fdbce84e7a pcu: f_TC_mo_ping_pong_2phase_access(): Drop sending TLLI after 2nd phase
There's no need to send the TLLI after 2nd phase access.

Change-Id: Id8230f8eebf0a3e1468b84f802c6704a19eb97d5
2021-03-03 14:38:53 +00:00
Alexander Couzens cbee32a9a7 ns: SNS: add first SNS test case
Do a successful IP-SNS configuration.

Change-Id: I822e3a440db492c91caa3a79acbfd4661852d021
2021-03-02 10:07:29 +01:00
Alexander Couzens e48d355650 ns: SNS: ensure all current testcase are only executed with IPACCESS or RESET_BLOCK dialect
All current test cases are for those 2 dialect. In preparation
of SNS test cases ensure those testcase have the correct dependency.

Change-Id: Ifda066553eabb0ace4aca12e60797c4950fcc498
2021-03-02 10:07:26 +01:00
Pau Espin 76de166a56 PCUIF: Fix naming of counters in InfoInd
Change-Id: Ieb26020e0f18169f19322963e23358b6ca254545
2021-03-01 17:42:45 +01:00
Vadim Yanitskiy 0df27dc669 remsim: add the guard timeout to all test cases
As can be seen [1], it happens quite often that a test case gets
stuck and runs forever.  Most of the existing test suites have
the guard timeout to prevent this.  Let's make use of it here too.

[1] https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-remsim-test-latest/190/
	Build has been executing for 1 day 23 hr!

Change-Id: I3897efd2a97c3e0d487057aa7bdc2967f3424dd8
2021-02-28 17:12:32 +01:00
Vadim Yanitskiy 7d30c57305 remsim: TC_connect_and_nothing() runs on test_CT
Change-Id: Ie94bf52e57a964b9f280c7626f354c5feee5c165
2021-02-28 16:46:13 +01:00
Vadim Yanitskiy 418e806df5 SGSN_Tests: add setverdict(pass) to TC_bssgp_rim_single_report()
Change-Id: If5295cc8eccda2d1b3baae7d2169fac5da2a085c
2021-02-28 16:27:12 +01:00
Vadim Yanitskiy 7bc13eae26 SGSN_Tests: fix coding style in TC_bssgp_rim_single_report
Change-Id: I667c1e8a94393e2b5afc6e2e3f7503b73198822c
2021-02-28 16:26:03 +01:00
Alexander Couzens 025bbc0b6d pcu: add TC_sns_so_bvc_reset_unknown_bvci
Do an SGSN originated reset of signalling BVCI,
then do a SGSN originated reset of an unknown BVCI.

PCU  -X SGSN: BVCI  0 BSSGP-RESET (ignores reset)
PCU <-  SGSN: BVCI  0 BSSGP-RESET
PCU  -> SGSN: BVCI  0 BSSGP-RESET-ACK (with cell information)
PCU  -X SGSN: BVCI 23 BSSGP-RESET (ignores reset, 23 is configured on PCU, 24 is not configured)
PCU <-  SGSN: BVCI 24 BSSGP-RESET (unconfigured BVCI)
PCU  -> SGSN: BVCI 24 BSSGP-STATUS Unknown BVCI

Related: OS#3879
Change-Id: Iea5519b453dd544c5a78b3b16ddb5132d20cf67c
2021-02-28 10:37:22 +00:00
Vadim Yanitskiy 1491c64114 bsc-nat: add 'Native_FunctionDefs.cc' to regen_makefile.sh
Some modules from library depend on these native functions.
Without them the compilation fails during linkage:

  Native_Functions.so: undefined reference to `Native__Functions::f__str__tolower(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__hntoa(OCTETSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__haddr(CHARSTRING const&)'
  BSSMAP_Templates.so: undefined reference to `Native__Functions::f__inet6__addr(CHARSTRING const&)'
  BSSMAP_Templates.so: undefined reference to `Native__Functions::f__inet__addr(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__str__toupper(CHARSTRING const&)'
  Native_Functions.so: undefined reference to `Native__Functions::f__inet__ntoa(OCTETSTRING const&)'
  collect2: error: ld returned 1 exit status
  make[1]: *** [BSCNAT_Tests] Error 1

Change-Id: I81227db58850375f0ce48e5c6e013381291a5904
2021-02-27 17:21:07 +01:00
Pau Espin eef4607203 BSSGP+pcu: Get rid of mp_tolerate_bvc_reset_cellid
Since we have new releases in -latest, we don't need this param since
it's never set to true.

Related: OS~5042
Change-Id: Ic496407fd2139b3a5221c30f1798797320cdee24
2021-02-26 13:39:45 +01:00