Commit Graph

62 Commits

Author SHA1 Message Date
Harald Welte 7c29536975 gbproxy: Properly capture HDLC/FR traffic in addition to ethernet
We cannot use "-i all" but must list each interface separately,
which is only supported by dumpcap.  We also must write pcapng
files.

Change-Id: Id412af3bb6bcad5e0f2cf40a6dc497d7e4f3d948
2020-12-11 15:32:08 +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 ce10365dab gbproxy: Fix syntax error in GBProxy_Tests.fr.cfg
Follow-up fix to I96e8b6a1a69148f770476e87c920dc256c1d7379
Related: OS#4520

Change-Id: I2eb6ffb3d0dba1405692c0e885622936d65cf95a
2020-12-09 15:30:52 +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 545c357b43 gbproxy: Change osmo-gbproxy.cfg so it works on libosmocore master
Change-Id: Ie1ab32ee40ff68ef3243439280244ba7668cf1dc
2020-12-07 13:05:35 +00: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 f0310fc42f gbproxy: Add test suite cfg and osmo-gbproxy.cfg for FR testing
Change-Id: I1faae88c82e8d54b4d4af88e9a9236877c913752
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
Harald Welte 60a8ec7a4f gbproxy: Add TC_bvc_reset_ptp_from_{bss,sgsn}
This tests BSS-originated and SGSN-originated BVC-RESET procedure of a PTP BVC.

Change-Id: Ie0a4899b6e793e3d69f117f350c5a2542fc4d402
2020-11-27 19:18:23 +01:00
Harald Welte 3c90515272 BSSGP_Emulation: Send BssgpResetIndication when PTP BVC are being reset
This notifies the user via the MGMT port about the fact that an inbound
BVC-RESET procedure just happened.

Change-Id: I54d0d5e0e06a330a90dfb1da06062d65022efe81
2020-11-27 19:16:58 +01:00
Harald Welte 239aa50e8c gbproxy: Add TC_bvc_{block,unblock}_ptp()
Test the blocking and unblocking procedure, indirectly via the BSSGP
emulation sending us the related primitives on both PCU and SGSN side.

Change-Id: Ia2fe867435678cbde44cac2addcaddd174507446
2020-11-26 20:57:54 +01:00
Harald Welte 3807ed1286 gbproxy: Port TC_{suspend,resume} to new GLOBAL port
With the previous commit, we change the processing of the SUSPEND/RESUME
related PDUs and handle them now via a new per-NSE "GLOBAL" port.

Change-Id: I805372f3024a0ec2491a24422e02c0bc6dc669d2
2020-11-25 17:14:25 +01:00
Harald Welte 7462a59ed9 gbproxy: Add paging for all situations of unknown identity
CS-PAGING and PS-PAGING for unknown RAC, LAC and BVCI on either PTP or SIG BVC.

Change-Id: I9874d54939daa28201b82139c9d8e3022432e621
2020-11-25 17:14:24 +01:00
Daniel Willmann 91a8e25b57 gbproxy: Add test for FLUSH_LL
Change-Id: I05667295e7fe945de6ed03716ff5ac930d54ac77
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 4798fd7d65 Support signalling BVC to send/receive messages
Change-Id: Icbe9f918d16efd01ede4e060f8af53a5e2c9253f
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Harald Welte 0e18824f3b gpborxy: Implement variety of paging tests for PS-PAGING and CS-PAGING
Change-Id: Ida44b62dfdb9c4ce2755de63d51a9907d34f247f
2020-11-23 14:51:38 +01:00
Harald Welte f8ef028c9f gbproxy: Add test for load sharing function in SGSN->PCU direction
Related: SYS#5209
Change-Id: Ide733d7659ff7f341bedc61fc90947f74d7c4ac3
2020-11-21 22:52:55 +01:00
Daniel Willmann 087a33d5d4 gbproxy: Add test for BSSGP resume procedure
Change-Id: I7e724b97ebfde4ed5824515065fbedca8bcf4c64
Related: SYS#5210
2020-11-20 15:08:35 +00:00
Daniel Willmann fa67f49798 gbproxy: Add test for the suspend procedure
Change-Id: Ib64c1711f7983940aa41e1b570c90015fe236e5b
Related: SYS#5210
2020-11-20 15:08:35 +00:00
Daniel Willmann 54833f2481 gbproxy: Use a different IMSI suffix per TC
Change-Id: I9a234cd6e61cfed8c9502708314c478f9a561d58
2020-11-20 15:08:35 +00:00
Daniel Willmann 165d6617b4 gbproxy: Add test for Radio Status procedure
This message is only passed through by gbproxy

Change-Id: I277ba3dace936400a78670925c7c8bdf401f90f6
Related: SYS#5210
2020-11-20 15:08:35 +00:00
Daniel Willmann 443fc57fc7 gbproxy: Reset nsvc to SGSN before each test
Change-Id: Ibf9c75b4066b1aad5fbbe2f35087a3f9f1a39743
Related: SYS#5002
Depends: I83b9cd7381c25da0e8aa847038a2d422c8dd63cf (libosmocore)
2020-11-19 14:29:59 +01:00
Harald Welte 0c45da1f2d gbproxy: /bin/sh cannot do "FILES+=", use /bin/bash
This fixes an ugly copile failure depending on which shell
provides /bin/sh on the given system:

AF_PACKET_PortType.so: undefined reference to `typeinfo for AF__PACKET__PortType::AF__PACKET__PT_PROVIDER'
AF_PACKET_PortType.so: undefined reference to `AF__PACKET__PortType::AF__PACKET__PT_PROVIDER::AF__PACKET__PT_PROVIDER(char const*)'
AF_PACKET_PortType.so: undefined  [0m [91mreference to `AF__PACKET__PortType::AF__PACKET__PT_PROVIDER::set_parameter(char const*, char const [0m [91m*)'
AF_PACKET_PortType.so: undefined reference to `AF__PACKET__PortType::AF__PACKET__PT_PROVIDER::outgoing_send(AF__PACKET__PortTypes::AF__PACKET__Unitdata const&)' [0m [91m
AF_PACKET_PortType.so: undefined reference to `AF__PACKET__PortType::AF__PACKET__PT_PROVIDER::user_map(char [0m [91m const*, Map_Params& [0m [91m)' [0m [91m
AF_PACKET_PortType.so:  [0m [91mundefined reference to [0m [91m `AF__PACKET__PortType:: [0m [91mAF__PACKET__PT_PROVIDER::user_unmap(char const*, Map_Params&)'
AF_PACKET_PortType.so: undefined reference to ` [0m [91mAF__PACKET__PortType::AF__PACKET__PT_PROVIDER:: [0m [91m~AF__PACKET__PT_PROVIDER()' [0m [91m
AF_PACKET_PortType.so [0m [91m: undefined reference  [0m [91mto ` [0m [91mAF__PACKET__PortType::AF__PACKET__PT_PROVIDER::Handle_Fd_Event(int, bool, bool, bool) [0m [91m'
AF_PACKET_PortType.so:  [0m [91mundefined  [0m [91mreference to [0m [91m `AF__PACKET__PortType: [0m [91m:AF__PACKET__PT_PROVIDER::user_start()'

Change-Id: I71352f5fa538c3ba599b11c2bb1fec2952ddbf80
2020-11-18 12:36:42 +01:00
Harald Welte d280127e0e gbproxy: Wait longer for BVC unblocking at start-up
When using NS_Provider_FR, the FR links need some more seconds to come
up than the NS_Provider_IP.

Change-Id: Idf80cf6119b67393fe5cbc0c93f5715daddcae0a
2020-11-17 20:14:15 +01:00
Harald Welte 3dd21b3307 gbproxy: Allow dynamic connect/disconnect of ConnHdlr at runtime
We want to move a virtual subscriber between BVC with one NSE,
but also to other NSE/PCU at runtime.  The number of BVC and NSE
may be large in a given test config, and we really don't need
hundreds of test ports per component;  Instead, reconnect the
test ports to whichever BVC we want at runtime.

Change-Id: I56b088b582f2d070547ee24f2d7a175d84fb5861
2020-11-17 20:13:20 +01:00
Harald Welte 5cb8016707 gbproxy: call f_client_register() only on connected ports
Change-Id: I845d566172918e1948db0579fa846e0972e532c3
2020-11-17 20:13:18 +01:00
Harald Welte 67dc8c2bd3 gbproxy: Remove NUM_BVC_PER_NSE constant and constant-sized array
Let's use a 'record of' with indefinite length in order to be able to
dynamically adjust the number of BSSGP_BVC_CT references based on how
many BVCs we have configured.

Change-Id: Id4aa20ff0b553cb8a1f5a67faa1e7b237fb254b8
2020-11-17 18:35:53 +01:00
Harald Welte 16357a970a gbproxy: Remove array of three cell IDs
The hard-coded array of three cell identifiers in the ConnHdlr
configuration doesn't really reflect situations with a different
number of PCUs than three, and a different count of BVCs than one
per NSE.

Let's pass the entire PCU configuration as parameter into every
ConnHdlr.  This way, the ConnHdlr can learn whatever cell identities
there mgiht be in whatever number of BVCs of each NSE.

Change-Id: I0bb22be612b8aa256c9ee115ee44ea849c4225e1
2020-11-17 18:35:53 +01:00
Harald Welte ea1ba59134 gbproxy: Fix SGSN side initialization for more than one SGSN
Change-Id: I4c64bf02a805a959626f6915d9dd72aa7622b24a
2020-11-17 18:35:53 +01:00
Harald Welte 2f282527c2 gbproxy: Include support for NS over Frame Relay
Change-Id: I5ba84b9eebf7c330f7ff55f5e99c6fd5972c7123
2020-11-17 17:42:23 +01:00
Daniel Willmann ace3ece7be gbproxy: Add test for RA Capability Update procedure
Change-Id: I023b3d24a31d117f05c7327b08e9f8f930720944
Related: SYS#5210
2020-11-16 20:32:20 +01:00
Harald Welte 22ef5d92d9 gbproxy: Generalize pcu2sgsn / sgsn2pcu transmission
This reduces code duplication between ConnHdlr test functions

Change-Id: Ic13fa745178ffddf8e35fc5203ad8d824e8f338c
2020-11-16 20:32:20 +01:00