Commit Graph

2556 Commits

Author SHA1 Message Date
Harald Welte 8132008573 Always capture lo interface
The loopback interface should always be captured, as it includes
the 'ping' commands we use to detect the start of the packet capture.

Change-Id: Ic3aee59dd230141a5d182e9babf8d33d59144aa4
2020-12-12 16:28:30 +01:00
Pau Espin Pedrol 0bf74e560a pcu: Fix counter expectancies after LLC UI dummy frame fixes in PCU
Recent commit 7d0f9a0ec383fcfca934731bd6979b6be6629c90 in osmo-pcu.git
fixed situation where lots of unneeded LLC UI dummy frames where being
sent. As a result, osmo-pcu correctly counts less dl rlcmac payload
bytes being sent, so we must adjust our test expectancies.

Related: OS#4849
Change-Id: I01c34a0948094b17cc0d67e613cd9b756f78c372
2020-12-11 19:57:38 +00:00
Harald Welte ccee3a50c3 Accept running as root or setuid dumpcap
Change-Id: Id97fb22e0018739a07e46ecaf26463248554f276
2020-12-11 17:22:26 +01:00
Harald Welte 5b11d91db2 ttcn3-tcpdump-start: Fix path of setcap
if we test if /sbin/setcap exists, we als should execute it from that
path, as running from a normal user doesn't have /sbin included in $PATH

Change-Id: I5131f869f86e6d136e0485da5e3749abbfc951e3
2020-12-11 15:34:42 +01:00
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

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

Change-Id: I4fee89baa954736ae8298b63667297dd57d8ec4f
2020-12-11 11:00:08 +01:00
Harald Welte 9b461a94a3 sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port
For 12+ days, suspend/resume related SGSN + PCU TTCN3 tets have been failing.

It was the introduction of the BSSGP_CT:GLOBAL test port in
I40d973d80709f5d56f59247e8647b52754f09bc8 +
I805372f3024a0ec2491a24422e02c0bc6dc669d2 which caused the related PDUs
now to no longer show up where they used to.

Change-Id: I1977302fef4868dc1c330bc6f48f6a6608949393
Closes: OS#4902
2020-12-10 23:42:03 +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 483d314831 deps: Update AF_PACKET dependency to version with socket/bind race fix
Change-Id: Icd773273d3ff8ff6d36ce472b8bd2e8a9b1e2e19
2020-12-10 22:13:25 +01:00
Alexander Couzens 2373afc482 pcu: SNS: fix typo
Change-Id: Iedb6b3f38d87ea3ac29c4bcaaf50e771b0b8a750
2020-12-10 15:21:30 +00:00
Alexander Couzens 2a0ac80fd1 pcu: SNS: add TC_sns_add_existent
Try to add via SNS an already existent NSVC which should

Change-Id: I096bcbe38d82d08a150a2f8e56f6bc02353273a1
2020-12-10 15:21:30 +00:00
Alexander Couzens 1e21fd40a1 pcu: SNS: remove TODO expect FLOW-CONTROL BVC
It should not be expected in a new NSVC.

Change-Id: I142c87d496f08d603ab8e1e13c5a29ebe6596bb0
2020-12-10 15:21:30 +00:00
Alexander Couzens a8fb621aba pcu: TC_sns_add: fix wrong udp port in SNS ADD message
When sending the SNS ADD in the test case the ip/port to add must be different
from the current NSVCs.

Fixes: 90f1974fb0 ("NS_Emulation: Support multiple NS-VC within one NSE (NS-VCG)")

Change-Id: I9bbbf1431468a452df324a7559518496e3eb48e3
2020-12-10 15:21:30 +00: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 71449b0a13 bssgp: Introduce "GLOBAL" port for PTP BVC
There are some messages/procedures on a PTP BVC which are not related
to one specific TLLI, but affect the whole PTP BVC.  First and foremost
that is the FLOW-CONTROL-BVC. Let's check if the user is interested in
handling those internally (by connecting to the GLOBAL port).  If not,
fall back to acknowledging all incoing FC-BVC and ignoring all ACKs.

Related: OS#4891
Change-Id: Ib80a6a522dbcb33fd0e7bd31a73ef28fdc636f57
2020-12-09 15:31:30 +01:00
Harald Welte 27a70cc453 bssgp: rename tr_GLOBAL to tr_GLOBAL_SIG
... to indicate this is about the signaling BVC only.

Change-Id: I646db452c89842465902b5167c9c86de51df1241
2020-12-09 15:30:52 +01:00
Harald Welte 86bdcaa79d Osmocom_Gb_Types: Fix t_BVC_FC_BVC_ACK() TAG IE length
Change-Id: Ib9a09fea85110a4f0966c07d911e37234aa06391
2020-12-09 15:30:52 +01:00
Harald Welte ce10365dab gbproxy: Fix syntax error in
Follow-up fix to I96e8b6a1a69148f770476e87c920dc256c1d7379
Related: OS#4520

Change-Id: I2eb6ffb3d0dba1405692c0e885622936d65cf95a
2020-12-09 15:30:52 +01:00
Vadim Yanitskiy b9a7bbf537 BTS_Tests_OML: add new test case TC_ipa_rsl_connect_nack
Currently osmo-bts seems to be sending IPA RSL Connect ACK
unconditionally, even if the remote peer is not reachable.

Change-Id: Ibfa58f670401907801f610578dd9b4ebf155a83a
2020-12-08 19:28:06 +01:00
Vadim Yanitskiy 62b1e4812a bts/expected-results.xml: TC_sacch_chan_act_ho_sync should pass now
Change-Id: I872111dae761bda038d2e881ab5f4e6b7f52ec90
2020-12-08 17:10:45 +01:00
Vadim Yanitskiy d020249f17 bts/expected-results.xml: add missing SMSCB-over-SDCCH8 expectations
Change-Id: I903ede1c78e103d24a93f2e6b0e1acd136405099
2020-12-08 15:58:15 +01:00
Harald Welte 0083ea6b69 BSSGP_Emulation: Add RIM port to BSSGP_CT
This port is used for sending/receiving RIM related BSSGP messages. It
exists once per BSSGP_CT Component (i.e. once per NSE), as RIM is global
for the entire NSE.

Change-Id: I04511df5dffbfe19faabf22014acc72b7673b7d6
2020-12-08 08:30:20 +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 da9d9387f6 NS_Emulation: Tolerate late NS-BLOCK-ACK / NS-UNBLOCK-ACK
Particularly in case both sides initiate a BLOCK or UNBLOCK procedure
at almost the same time, it can happen thet we're already in BLOCKED
state and receive a late BLOCK-ACK or in UNBLOCKED state and receive a

Let's just silently discard them instaed of generating NS-STATUS which
may confuse the peer.

Change-Id: I2e5b934e1cf6c6cf982d5ab1dbb32e8920b91071
2020-12-07 15:55: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

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
Pau Espin 2e459d602e pcu: Verify LLC UI dummy frames are not appended at end of rlcmac DL block
LLC UI dummy frames are only to be sent alone in order to delay TBF
termination. Until recently (osmo-pcu.git
Ifae1a7b2b3dfad8df19585063088ba0df2749c8f), osmo-pcu was sending LLC UI
dummy frames instead of padding at RLCMAC layer, which made no sense.

Related: OS#4849
Change-Id: I7e0d9ed2475dbf989fbf932c8b83117ff5fb28fc
2020-12-07 13:29:13 +00: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

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
Vadim Yanitskiy 5351ccf85e BTS_Tests: make ts_LapdmAddr / ts_LAPDm_AB more friendly
Change-Id: I35f84ebd6cb884f3ab63d1c2b77d8ed61acd5c74
2020-12-03 13:40:12 +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 06f0949316 RSPRO_Server: Ignore any ID RESP messages from the client for now
More recent clients start to send ID RESP, which was not the case at the
time the TTCN3 test suite was written.

As we don't really want to test the IPA CCM behavior, but we want to
test the actual remsim functionality, we can simply ignore any such

Change-Id: Id557ea9c540bf96465e7f18da87719888dd7a318
2020-12-01 12:06:33 +00: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
Neels Hofmeyr 3eb9456f5a bsc: add tests with nonzero AMR start-mode
This test shows that in current osmo-bsc, the start-mode fails to
propagate to the MultiRate Config IE, the only start-mode so far has
always been zero.

Change-Id: I75515baf8cda04567cad8a93c5aa88361c2d259f
2020-12-01 11:54:08 +00:00
Pau Espin 1b9aa78ee0 pcu: Introduce test TC_mcs_max_dl
Change-Id: If6c58cc18b537c4a1354f1b8263db8321347fbd7
2020-11-30 18:56:16 +01:00
Neels Hofmeyr 454d792388 bsc: add TC_assignment_codec_amr_startmode_cruft
Make sure that when a 'start-mode auto' is set, that the previous start
mode setting does not linger in the unused bits.

- after I577ff590d7588fd7e3ee4846c7955ab8f84cf2b1, osmo-bsc sets its
  ICMI bit properly, but passes this test only because it *always* sends
  smod (start-mode) bits as zero.

- in I49691df01745a7c485bf165e897872c35fc4b147, the smod bits are
  properly sent on RSL, but this test shows that when ICMI becomes zero
  for 'start-mode auto', the smod bits will remain whatever start-mode
  was set in the previous osmo-bsc config. Instead, osmo-bsc should
  clear the smod bits for 'start-mode auto' so that its MultiRate Config
  does not vary depending on what was previously configured.

- in I1ec5bad0bce01cc425ee05ecf70c83ec662a226a, clearing smod is
  implemented and this test is expected to pass.

Change-Id: I151678f64e680f30f35b6bb2b0036d63efde9f2c
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 21863560a2 bsc: add tests for AMR 'start-mode auto'
These tests will fail until osmo-bsc

Related: OS#4868
Change-Id: Iec74b940009c8ec78a6da5c00615259e2edc1781
2020-11-30 15:59:14 +00:00
Neels Hofmeyr a6ab821704 bsc: set the AMR start-mode that the tests expect
osmo-bsc currently has a bug that fails to reflect the correct
start-mode in the AMR MultiRate config IE.

And it went unnoticed that the ttcn tests expect a MultiRate config of
ICMI = 1, even though the used configuration should yield ICMI = 0.
See mr_conf = '2804'O, where the '8' indicates ICMI = 1.

As a first fix of the ttcn3-bsc-tests, configure the BSC according to
the expected ICMI value and Start Mode, i.e. ICMI = 1 and StartMode = 0,
which is configured by 'amr tch-[fh] start-mode 1'. This should make
these tests pass as-is for both the current osmo-bsc as well as an
osmo-bsc where the bug is fixed, with minimal changes to the current
tests. See also OS#4868.

An upcoming patch will add tests for 'start-mode auto'.

Related: OS#4868
Change-Id: I4cff01c37d5c7e301e9a01f773b7e009a789519b
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 2a5670be4f add f_vty_cfg_bts(), f_vty_cfg_msc()
These allow passing N vty configurations on the bts / msc node without
requiring subsequent 'exit'.

As an example, use f_vty_cfg_msc() in BSC_Tests.ttcn AMR config.

Change-Id: I9f3e485f692acb3d2a7620e9b454b372651be78e
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 1a1f854ed2 add f_vty_config3(), to run N commands on a sub-node
f_vty_config2() makes it convenient to enter a specific vty node without
needing to send 'exit'/'end' explicitly. However, to pass multiple
commands on the same node, the VTY would enter and exit the node for
each call of f_vty_config2(). The new f_vty_config3() also allows
multiple commands to be run on that same node without intermediate

Change-Id: If969ac645aa82e5a36245d974de2a251633de111
2020-11-30 15:59:14 +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

Change-Id: Idab8bed06281468164006682aa6b4c2c3e236880
2020-11-30 13:33:06 +00:00