Commit Graph

83 Commits

Author SHA1 Message Date
Harald Welte d05a4a99a4 gbproxy: Move different network elements to different IPs
* SGSN0: 127.0.0.10
* SGSN1: 127.0.0.11
* PCU0:  127.0.1.1
* PCU1:  127.0.2.1
* PCU3:  127.0.3.1

Change-Id: I1762bfc237e679ee21d0446596f2c4f56f735a9d
2021-01-18 19:55:03 +01:00
Daniel Willmann 2a33067570 gbproxy: Use g_parse.sgsn_idx for paging
The ConnHdlr test stores the sgsn_idx in g_pars. Use that in the paging
tests to the correct SGSN pages the MS.
This commit fixes what 4332044c missed and is required for the ptp paging
reject test to pass.

Change-Id: Id85ffa57af943ae98c0f022b261ec24d557c236d
Related: OS#4951
2021-01-18 18:01:25 +00: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 3148a9618f gbproxy: Add tests for RADIO-STATUS with TMSI and IMSI instead of TLLI
Change-Id: Ib3b052a12227a8f55cf063e5168b56f97b9a8f9b
Related: OS#4954
Related: OS#4951
2021-01-17 17:39:29 +01:00
Harald Welte 25a04b1565 gbproxy: Print log line for every ConnHdlr we start
Change-Id: I43e0ffb1b8be4f85a55ab1ed24fcf9d3b60a4d60
2021-01-17 17:39:29 +01:00
Harald Welte f86f1859f9 gbproxy: Add suite of RIM tests
They all fail with current gbproxy master as it doesn't yet implement
routing of RIM messages.

Related: OS#4896
Change-Id: I0fec6fd4a5a6559f596b9006ae437323da6f05d7
2021-01-17 17:39:29 +01:00
Daniel Willmann 4332044c95 gbproxy: Use g_parse.sgsn_idx for paging
The ConnHdlr test stores the sgsn_idx in g_pars. Use that in the paging
tests to the correct SGSN pages the MS.
This is required for the paging reject test to pass.

Change-Id: I34cfc047b36cd6c139a78a7f171a9a99cc974a79
Related: OS#4951
2021-01-17 16:39:03 +00:00
Daniel Willmann 193e1a091a gbproxy: Use provided sgsn_idx in f_send_paging_ps_exp_multi()
Change-Id: I89ca4232e71d98936adfc521312b92cba7ef867f
Related: OS#4951
2021-01-17 16:39:03 +00:00
Harald Welte d6f8981401 gbproxy: Add testcase for MS-REGISTRATION ENQUIRY
The test case fails with current master, as osmo-gbproxy doesn't handle
this yet.

Change-Id: I158dfa729315a9678a7fbb33ed465b73dfc9ec4b
2021-01-16 22:54:29 +01:00
Harald Welte 7595d5682b gbproxy: Test cases for DUMMY-PAGING-PS
The test case fails with current master, as osmo-gbproxy doesn't handle
this yet.

Change-Id: Ie67f36502d18e9a62373973b09e758a7d0d0f3a5
2021-01-16 22:54:29 +01:00
Harald Welte cf20007b26 gbproxy: Add test case for PAGING-PS-REJECT
The test fail with current osmo-gbproxy master, as the related
implementation is missing.

Related: OS#4951
Change-Id: I19a36dfef8f33f278a54b938a5daccce08de6fe0
2021-01-16 22:54:29 +01:00
Harald Welte b5a04aae64 gbproxy: Test PS-PAGING by IMSI (without P-TMSI)
Related: OS#4951
Change-Id: I1bdc09712790d4b69df147ed9c7bea15c48e8dea
2021-01-16 22:54:29 +01:00
Harald Welte 207166c28c gbproxy: Allow creating ConnHdlr without a P-TMSI
This will be useful for testing paging cases where no P-TMSI is allocated.

Change-Id: Icd780c750c77e723e545ed5a5b52ef26e442b4f2
2021-01-16 22:54:29 +01:00
Harald Welte b33fb59b49 gbproxy: Unregister IMSI from BSSGP before termination of ConnHdlr
Otherwise we may run into problems where the BSSGP_Emulation still
has references to longer existing components in its ClientTable.

Change-Id: Iee54e93e6ae1b3e40f502d5ba2499e9eb03bf203
2021-01-16 22:54:29 +01:00
Harald Welte 2ecbca8080 gbproxy: Don't pass global (component) variables as function arguments
The point of global (component) variables is that we don't have to pass
them around as extra function arguments everywhere.  So don't do it.

Change-Id: I0754d5db7e797a51be3a0b601b0533de80bc246d
2021-01-16 22:54:29 +01:00
Harald Welte 09a1ce4d23 gbproxy: Execute TC_load_sharing_dl() for each SGSN in pool
Change-Id: I4ad822d3bbf5eb6181f6811c3b2267a50bb533a4
Related: OS#4951
2021-01-16 22:54:23 +01:00
Harald Welte c5f486b97e gbproxy: Execute each ConnHdlr test on each NRI of each SGSN configured
This helps us to get proper test coverage for SGSN pool situations.

Change-Id: Ie22d3fd786ff8fefe919ecc3a96f974675057e29
Related: OS#4951
2021-01-16 22:50:58 +01:00
Harald Welte c5c3373a1d gbproxy: Test suspend + resume for each NRI on each SGSN
The test now tests with 10 TLLIs of each configured NRI of each configured SGSN.

Change-Id: Iccd649165acd99b3d2d1ecc8fba7015fa27f57ec
2021-01-16 22:50:58 +01:00
Harald Welte 99ed50731a gbproxy: Use correct NRI in suspend/resume
We cannot choose a random TLLI anymore, as this will obviously end up
at a random SGSN, and not the one we're targeting.

Change-Id: I665eda9e04cbf505f55abc9bcd414d6cbd6a36dd
2021-01-16 22:50:58 +01:00
Harald Welte 009637505f gbproxy: Refactor f_TC_{suspend,resume}
Move the entire body inside the loop to a separate function.  This
will be useful when adding pooling support next.

Change-Id: Ia0f9d9128754c2196ab026623f1b6a254a958d2f
2021-01-16 22:50:58 +01:00
Harald Welte 77218d0990 gbproxy: Start to allocate NRIs to SGSNs
We change the osmo-gbproxy.cfg to use NRI 3 for SGSN-0 (NSEI 101) and
NRI 4 for SGSN-1 (NSEI 102).

We also add the capability to GBProxy_Tests to allocate P-TMSI with
a specific NRI and default to the first NRI of SGSN-0 so all tests
written still for a single-SGSN-non-pool scenario pass without any
modification.

Related: OS#4472, SYS#5002
Change-Id: I15f78dca5ac31a1c71f086d3e92a70e900eae250
2021-01-16 22:50:57 +01:00
Harald Welte 5fb0174dbe gbproxy: Fix TC_fc_bvc() with more than one SGSN
The altstep was missing the "repeat" at the end, causing it to abort
early and reporting a test failure which actually didn't exist.

Change-Id: I0ec9aa06fa9ec25b2047c1e795e28eeefd6bc7d2
2021-01-16 22:50:21 +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
Harald Welte b978ed6af5 gbproxy: Configure a Second SGSN
This adds the required code changes and minimal configuration to both
osmo-gbproxy.cfg and GBProxy_Tests to have osmo-gbproxy connect to two
SGSNs.

No NRI mappings are configured and hence the second SGSN isn't really
used for anything except for bringing the NS-VCs and BVCs up.

Related: OS#4472, SYS#5002
Change-Id: Ib70f7c1a29f089957f882df0e9b05ee526224611
2021-01-16 22:50:09 +01:00
Daniel Willmann 491af2a33e Fix race during shutdown
To avoid a dynamic test case error we need to prevent messages arriving on
unconnected ports. Waiting some time before stopping components ensures that
any messages "in flight" will be delivered to the port before the component
is shutdown and disconnected.

It would be far nicer to mark a testresult "final" and ignore such
errors on shutdown, but I don't think it's possible in TTCN3.

This fixes TC_fc_bvc on my laptop which consistently failed with a DTE
before.

Change-Id: I98928f24745125642225681d13bf2e78691e9747
Related: SYS#5115, OS#4518
2021-01-11 14:20:55 +00:00
Daniel Willmann ef7015f321 gbproxy: Fix TC_bvc_reset_sig_from_sgsn
The port receive operation only considers the first message in the
queue. We need to drain unrelated status/reset messages, such as those
from PTP BVCs, otherwise the test never completes and times out.

Change-Id: I1f2c76ae9bdc0267bfca60536e321fe88530803c
Related: SYS#5115 OS#4518
2021-01-11 02:41:20 +00:00
Daniel Willmann 4c534bbf18 Fix suspend/resume tests
Ensure that a suspend/resume was sent before sending the *_(N)ACK. In
reality these can only happen together and our TLLI cache removes
the entries after it sees the corresponding (N)ACK so it will not
forward the second message.

Change-Id: Ie0fd81edb748d3c638e42c4418ca514095c55861
Related: SYS#4865, OS#4472
2021-01-11 02:33:03 +00:00
Harald Welte 6929e329f3 gbproxy: Be mover verbose about BVC-UNBLOCK failure at start-up
Change-Id: Ic849e1f932de21a443cd0274e02e0f2ccd423515
2020-12-12 16:28:30 +01:00
Harald Welte dc805c00eb gbproxy: Fix log messages in timeout situations
Printing an unbound 'rx' variable when nothing was received due to
timeout is somehow not really useful.  Print what we expected to
receive.

Change-Id: I4fee89baa954736ae8298b63667297dd57d8ec4f
2020-12-11 11:00:08 +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 299aa48c64 gbproxy: Test case for BVC flow control procedure
Related: OS#4891
Change-Id: I6daa5848bd59b42f152de783bfdc602d1f2da861
2020-12-09 15:31:55 +01:00
Harald Welte b9f0fdc177 gbproxy: properly shutdown at the end of the test
Destroying at least most of the components in an orderly fashion avoids
at least most of the race conditions during test shutdown.

Change-Id: I2aa4ef8a70c1139893c9621f5a6b6007b221c13d
2020-12-09 15:31:55 +01:00
Harald Welte 425d376387 gbproxy: Introduce global guard timer in test_CT
We did have a guard time in each ConnHdlr, but not in the MTC (test_CT).

However, we do have tests that don't use any ConnHdlr, and those were so
far ran without a guard timeout. Fix that.

Change-Id: Iee90fc26a151c692d3c6f3eb6ad80f528f8d939f
2020-12-09 15:31:55 +01:00
Harald Welte 158becf9cb gbproxy: Rename PCU port to PCU_PTP; SGSN port to SGSN_PTP
This way it's more obvious that it refers to the PTP BVC, like we
already use PCU_SIG and SGSN_SIG for the signaling BVCs.

Change-Id: Ie8d327b0c6fae0e7963cc5907ab0bc94e97c67f3
2020-12-09 15:31:55 +01:00
Harald Welte 4f91c3b65a gbproxy: cosmetic: More comments / section headers
Change-Id: I26162cd37908d60761182edd50c3aa8389486b7c
2020-12-09 15:31:55 +01:00
Harald Welte f6e59b06d5 gbproxy: Enable TC_load_sharing_dl based on modulepar; set that in FR test
Change-Id: I96e8b6a1a69148f770476e87c920dc256c1d7379
Related: OS#4520
2020-12-08 08:30:20 +01:00
Harald Welte b2647f7135 gbproxy: Fix as_count_bvc_block()
we must continue to wait for more BVC-BLOCK after receiving the first one

Change-Id: I4664899414869fe373d31bc72f6c1dcfbcc9071c
2020-12-07 14:12:16 +00:00
Daniel Willmann d4fb73cd1c gbproxy: Fix cs paging tests
In commit 2c9300fd28 I only changed the TC_paging_ps_* tests and forgot
cs.

Change-Id: I625e0a0f01eaa951c7d91f8ced3edf0cac91bf74
Related: SYS#5226
2020-12-07 14:33:07 +01:00
Daniel Willmann 1a85971746 gbproxy: Fail on timeout in f_send_paging_xs_exp_one_bss
These functions would not set a verdict in case no message was ever
received. This patch ensures that a timeout while waiting for a paging
message actually fails the test.

Change-Id: If71db2d37d67d02c5d9550202128ee3470762964
Related: SYS#5002
2020-12-07 14:33:07 +01:00
Daniel Willmann 2c9300fd28 gbproxy: Improve NSEI/... numbering and improve paging test coverage
With this setup we can and do now test:
* Paging a LAI on BVC0 is sent once per matching NSE
* Paging a LAI on BVC0 is sent to multiple different matching NSE
* Paging a RA ID on BVC0 is sent once per matching NSE
* Paging a RA ID on BVC0 is sent to multiple different matching NSE

Change-Id: I698a932b3dc78c776e9350283109463bcdc40e6b
Related: SYS#5226
2020-12-07 13:05:22 +00:00
Daniel Willmann f259021a24 gbproxy: Make TC_bvc_reset_sig_from_bss() actually pass
If we hit none of the failures in the test case it means the test was
passed.

Change-Id: I6fe00558b346174f05f36703fe630796fb04a71e
Related: SYS#5002
2020-12-07 13:04:41 +00:00
Daniel Willmann ad93c05e72 gbproxy: Reset gbproxy bvc as well as ns state
We need to ensure that before each test the gbproxy does not have any
state. Move the vty commands into loops that run before we init either
SGSN or PCU Gb. This ensures that we don't send some spurious block or
other message at the start of the test.

Related: SYS#5002
Change-Id: Iaedfadf94f716b190495a807c28785be0078addc
2020-12-07 13:04:34 +00:00
Harald Welte 95339434cd gbproxy: Make sure all BssgpCfg have a valid create_cb
We cannot specify create_cb function references from the config file,
so let's patch them into the data structure at start-up.

Change-Id: Idac9e97dde62b61d0423fdde16e3bd700d5287c0
2020-12-02 19:10:03 +01:00
Harald Welte 951e6a9539 gbproxy: Use "force-unconifgured" als on BSS-side NSEs
Any NSE should be unconfigured at start up of the test case in order
to avoid any state leakage from previous test executions into the
newly-started test case.

Change-Id: I1dd491d5bce17b4602f1e26b42df003f1627714a
2020-12-02 19:10:03 +01:00
Harald Welte 0d5fceb146 gbproxy: Test for sizes up to 1600 bytes, not just 1024 bytes
The NS specs state up to 1600 bytes "gross NS size" must be supported,
at least by the underlying FR layer. Let's test up to that.  Let's
also speed things up by using 4-byte size increments, and print
the size of the current message.

Change-Id: I76358323e79cfc3d0e9c979c716b7a552f3b8e3b
2020-12-01 11:57:26 +00:00
Harald Welte 8b326412a4 gbproxy: Fix log messages in timeout situations
Printing an unbound 'rx' variable when nothing was received due to
timeout is somehow not really useful.  Print what we expected to
receive.

Change-Id: Idab8bed06281468164006682aa6b4c2c3e236880
2020-11-30 13:33:06 +00: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
Harald Welte 16786e9364 gbproxy: Add TC_bvc_reset_sig_from_{sgsn,pcu}
These test cases check if gbproxy behaves as expected when it comes to
dealing with BVC-RESET on the signaling BVC.  The tests are not passing
due to limitations of gbproxy.  So it's not clear if the tests are 100%
correct until gbproxy is fixed.

Change-Id: Iedfe72f539ad3a0653b6ee7a050bf36ae386e88e
2020-11-27 19:18:28 +01:00