Commit Graph

17 Commits

Author SHA1 Message Date
arehbein 04d35cda72 stream_test: Fix memleaks
- Clean up all allocations, introduce clean memory management to entire
   test

Related: OS#6222

Change-Id: Ica25fcd71e8bf8946def3ea7ce320354ea6edb3a
2023-10-18 03:55:38 +02:00
arehbein 0aa9a5f783 stream_test: Improve mem mgmt, fix connection mgmt
- Use tall_test as root context everywhere, don't create any other contexts
 - change .*_(cli|srv)_run_client() signature by adding talloc context as parameter
 - Open and Close server link inside test_recon()

Related: OS#6222
Change-Id: I9ef02ed113bc049ae430b93d0eb69641e2ee809b
2023-10-18 03:55:33 +02:00
arehbein 106b63907a stream: Add and use helper function osmo_ipa_push_headers()
Related OS#5753, OS#5751

Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529
2023-10-09 12:49:36 +00:00
arehbein 64d9b5487a stream (test): Fix Coverity CID 323456
Fix Coverity CID 323456 ("Control flow issues  (NO_EFFECT)") by removing
'greater than 0'-check on unsigned integer-type variable.

Change-Id: I2efb28feae4d4fa7516702f01026af09aa3777ac
2023-10-05 18:44:19 +02:00
arehbein bc496b1db0 stream: Add client-side (segmentation) support for IPA
With this commit, IPA segmentation is taken care of by setting the
segmentation callback provided by libosmo-netif.

The ipa-stream-server example needs to prepend IPA headers now because
those are stripped by the segm. cb on both sides.

Depends: libosmocore.git I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f

Related: OS#5753, OS#5751
Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6
2023-10-02 13:40:01 +00:00
arehbein 82e1ae260f stream_test: Disable nagling
Disable nagling to make kernel packet processing time more predictable

Change-Id: I7e8f6851df28e006fcb714673b97cf7b6be367bf
2023-10-02 13:40:01 +00:00
Pau Espin 23f7d850a3 stream_test: Avoid leaking osmo_stream_srv_link
Change-Id: I43b7327893c220447492d2c36c87b187a414cbdb
2023-09-04 16:48:46 +02:00
arehbein aede010687 stream test: Fix test output check
A previous commit added additional logging information, necessitating changes to
the test code as well as to the output check.

Related:OS#5753

Change-Id: Ib8f01c3651c13814c212328946415094da39d6a8
2023-08-25 17:43:49 +02:00
arehbein f990b307bd stream: Add server-side (segmentation) support for IPA
With this commit, IPA segmentation can be taken care of by setting
the segmentation callback osmo_ipa_segmentation_cb().

Depends: libosmocore.git I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f

Related: OS#5753, OS#5751
Change-Id: I6c91ff385cb5f36ab6b6c96d0e44997995d0d24c
2023-08-25 13:26:46 +00:00
Pau Espin b04f0384ee stream: Print socket info as part of the logging context
Since the local port is logged now in stream_test, it must be set to
a specific value in order to have deterministic log output being
validated.

Change-Id: I17ef699dab72c1b613708070d22e9f040b0fe069
2023-06-20 13:48:25 +02:00
Pau Espin 64c241be5d stream: Allow setting name printed during logging
Depends: libosmocore.git Change-Id If2772a3ccaa98616e0189862a49ab0243435e343
Change-Id: I539a0d29d11348efe702f971965a55cf56db5c59
2023-06-20 09:05:24 +00:00
Pau Espin 3e659ce22d tests: Replace deprecated API log_set_print_filename
Change-Id: Id44722fa42fc94af7d55b8b984657a8535e66a9f
2021-02-19 13:08:50 +01:00
Pau Espin b1ddb98e8b tests: Explicitly drop category from log
Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Ia4bcf8dc441ad26cffc3aec5b374fbdca4a03841
Related: OS#5034
2021-02-19 12:57:44 +01:00
Pau Espin 8c7d62f6d2 stream_test: Log fake time
It allows easy verification that timing is correct and makes it easier
to debug time related race conditions.

Change-Id: I86eb1d7a8096011fd273f067255eb8d6484be65c
2019-09-19 15:42:24 +02:00
Pau Espin b6f9125141 stream_test: Use fake time
By using fake own-controlled time we get two benefits:
* Test doesn't take 9 seconds to run anymore
* More fine-grade control of different events happening (and associated
race conditions).

Change-Id: I16b2884b289bfe40dfb8d743dce01bb4c208d117
2019-09-19 15:16:02 +02:00
Max b3e34435b3 Deprecate osmo_stream_cli_open2()
This supposed to be variant of osmo_stream_cli_open() with explicit
control over reconnection logic but it's plain broken: doxygen docs
contradict the code, actual reconnection logic is affected by timeout
parameter directly which is set in different function.

It seems like we haven't been affected by this so far because we always
use it in auto-reconnection mode which is triggered by default due to
positive reconnection timeout value (5 sec) automatically used in the
absense of explicitly set timeout.

Looking at commit history, this function already been source of
confusion in the past. Instead of trying to fix this mess, let's just
deprecate it entirely and properly document use of
osmo_stream_cli_set_reconnect_timeout() to control reconnection logic.

The only known user is libosmo-sccp which won't use it as of
0a93a683f3cb8e5977eb4a666ab207db6e7d7af9 commit.

Change-Id: Id988ed0274b363db049f59cbf6a193727c8c3c8a
2019-03-19 13:40:55 +00:00
Max fe3527da2a Add stream client/server test
Previously stream client and server code were only used in examples
which means regressions could be easily introduced unnoticed until they
trigger bugs in external code which relies on osmo_stream_*()

Fix this by adding basic client-server interaction tests with and
without reconnection.

Change-Id: I336f79970982ed8e1d73b73d54fa4c27ba8bce8e
2019-02-07 13:44:30 +01:00