lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

July 2026

  • 1 participants
  • 869 discussions
[M] Change in ...osmo-python-tests[master]: README: update
by osmith 28 Jul '26

28 Jul '26
osmith has submitted this change. ( https://gerrit.osmocom.org/c/python/osmo-python-tests/+/43101?usp=email ) Change subject: README: update ...................................................................... README: update * Convert to markdown * Add a short summary on top * Modernize installation instructions * Change the example from deprecated openbsc and deprecated osmodumpdoc.py to libosmocore's osmo-ns-dummy and osmotestconfig.py * Remove mention of twisted_ipa.py, as it was removed in 5d0fac9d Change-Id: I13c6327ca210e29cde3f9bb75c93c892682a5a28 --- D README A README.md 2 files changed, 89 insertions(+), 47 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/README b/README deleted file mode 100644 index 3b59257..0000000 --- a/README +++ /dev/null @@ -1,47 +0,0 @@ -Building/installation: - - sudo python3 setup.py install - -If you prefer to have it cleanly removable, install checkinstall and run - - sudo checkinstall python setup.py install - -Alternatively, just run - - pip3 install --user -e ./ - -depending on your python version. - -Use: -There are currently following scripts in this package: -osmotestconfig.py - test that apps start/write with example configs -osmo_trap2cgi.py - implementation of CGI <-> Ctrl proxy implemented on top of asyncio and aiohttp -osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa -osmo_interact_vty.py - pipe stdin/stdout to a VTY session -osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port -osmo_verify_transcript_vty.py - VTY testing by VTY session screen dumps -osmo_verify_transcript_ctrl.py - CTRL testing by CTRL session script files -twisted_ipa.py - implementation of IPA and Ctrl protocols on top of Twisted framework -osmodumpdoc.py - dump documentation, superseded by osmo_interact_vty.py -X -osmotestvty.py - test vty operations, superseded by osmo_verify_transcript_vty.py - -Some of these scripts import a project-specific osmoappdesc.py, -which provides information about the available apps, configs, vty ports, etc. -and is provided by other source trees (like osmo-bsc.git, osmo-msc.git, ...) - -Run the scripts with osmoappdesc.py in the current directory (preferred) -or with -p <the directory containing osmoappdesc.py>. -Remember that osmoappdesc.py may contain relative paths. - -Example: -After install osmodumpdoc for openbsc's apps can be run by: -cd <your_source_dir>/openbsc/openbsc && osmodumpdoc.py - -Libraries: -osmopy/osmoutil.py - code that's shared between the scripts -osmopy/osmo_ipa.py - generic implementation of IPA and Ctrl protocols in python -osmopy/trap_helper.py - generic Trap class and related helpers used by soap.py and ctrl2cgi.py -osmopy/osmo_interact/{vty,ctrl}.py - general interactions with VTY and CTRL ports -osmopy/obscvty.py - connect to a vty, superseded by osmo_interact/vty - -obscvty.py may be of general use. osmoutil.py probably isn't. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5d9959 --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# osmo-python-tests + +Various scripts that are mostly used for interacting with VTY/CTRL interfaces +of Osmocom programs. + +## Installation + +### Python user install directory + +While discouraged by the python developers, the easiest way to make +osmo-python-tests always available for your user is installing to +`~/.local/lib/python3.*/site-packages/osmopy`: + +``` +$ pip3 install --user --break-system-packages . +``` + +### Virtual environment + +If you prefer to have osmo-python-tests clearly separated, install to a venv: + +``` +$ python3 -m venv ~/.osmocom-venv +$ source ~/.osmocom-venv/bin/activate +$ pip3 install . +``` + +Keep in mind that you must run the source line again whenever you need to use +osmo-python-tests. + +### Osmocom binary packages + +If you run a Debian-based Linux distribution, you can alternatively enable the +[Osmocom binary repository](https://osmocom.org/projects/cellular-infrastructure/wiki/Binar… +and do a system-wide installation: + +``` +# apt install osmo-python-tests +``` + +## Usage + +There are currently following scripts in this package: + +* `osmotestconfig.py` - test that apps start/write with example configs +* `osmo_trap2cgi.py` - implementation of CGI <-> Ctrl proxy implemented on top of asyncio and aiohttp +* `osmo_rate_ctr2csv.py` - rate counter dumper on top of osmo\_ipa +* `osmo_interact_vty.py` - pipe stdin/stdout to a VTY session +* `osmo_interact_ctrl.py` - pipe stdin/stdout to a CTRL port +* `osmo_verify_transcript_vty.py` - VTY testing by VTY session screen dumps +* `osmo_verify_transcript_ctrl.py` - CTRL testing by CTRL session script files +* `osmodumpdoc.py` - dump documentation, superseded by `osmo_interact_vty.py -X` +* `osmotestvty.py` - test vty operations, superseded by `osmo_verify_transcript_vty.py` + +Some of these scripts import a project-specific `osmoappdesc.py`, which +provides information about the available apps, configs, vty ports, etc. and is +provided by other source trees (like osmo-bsc.git, osmo-msc.git, ...). + +Run the scripts with `osmoappdesc.py` in the current directory (preferred) or +with `-p <the directory containing osmoappdesc.py>`. Remember that +`osmoappdesc.py` may contain relative paths. + +### Example + +Build osmo-ns-dummy from libosmocore: + +``` +$ cd libosmocore +$ autoreconf -fi +$ ./configure +$ make +``` + +Enter the directory with `osmoappdesc.py` and run a test script: + +``` +$ cd tests/gb +$ osmotestconfig.py -w . +``` + +## Libraries + +* `osmopy/osmoutil.py` - code that's shared between the scripts +* `osmopy/osmo_ipa.py` - generic implementation of IPA and Ctrl protocols in python +* `osmopy/trap_helper.py` - generic Trap class and related helpers used by `soap.py` and `ctrl2cgi.py` +* `osmopy/osmo_interact/{vty,ctrl}.py` - general interactions with VTY and CTRL ports +* `osmopy/obscvty.py` - connect to a vty, superseded by `osmo_interact/vty.py` + +`obscvty.py` may be of general use. `osmoutil.py` probably isn't. -- To view, visit https://gerrit.osmocom.org/c/python/osmo-python-tests/+/43101?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Change-Id: I13c6327ca210e29cde3f9bb75c93c892682a5a28 Gerrit-Change-Number: 43101 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: deps: Update nas.git to rebased branch on top of v1.2.1
by pespin 28 Jul '26

28 Jul '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43118?usp=email ) Change subject: deps: Update nas.git to rebased branch on top of v1.2.1 ...................................................................... deps: Update nas.git to rebased branch on top of v1.2.1 We have a forked repo of ETSI's nas.git on our osmocom gitea, which contains an extra fix for upstream (currently waiting to be merged [1]) and one patch implementing C++ helpers to fit our own environment, which needs to be kept downstream. There has been quite a lot of development in upstream lately (TTF_T059), with eg. old NGAP.git code being put inside nas.git (we are still using our own copy of NGAP inside osmo-ttcn3-hacks/library/, but that may change in the future). A new branch rebased on top of upstream's master (v1.2.1) has been pushed to our forked repo, so use it here to already align better with upstream, easing further work and contributions in the future. [1] https://forge.etsi.org/rep/int/5g-core/nas/-/merge_requests/18 Related: SYS#7073 Change-Id: I731c37324de93fe2bf35dac7e64304fc5057ee5f --- M deps/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/18/43118/1 diff --git a/deps/Makefile b/deps/Makefile index 86366c2..b3533a8 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -72,7 +72,7 @@ # Use tag names from 'git describe --tags' or commit hashes. This way we get # exact commits of deps when doing regression testing. -nas_commit= c8fb0b1dd96f45fbfdc93ffc73ffb3ca6ced47cc +nas_commit= 971761debf1bbd71bc238e750f0baeb3ff9ce964 titan.Libraries.TCCUsefulFunctions_commit= R.35.B-6-gb3687da titan.ProtocolEmulations.M3UA_commit= a70095b9113b23d2ea2405a5775befec18dd0fe0 titan.ProtocolEmulations.SCCP_commit= c6d299781558b53b4487a42f39a557aabb81c1d7 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43118?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I731c37324de93fe2bf35dac7e64304fc5057ee5f Gerrit-Change-Number: 43118 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in onomondo-ipa[master]: V1.2: Add new fields to ProfileInfo list
by Jenkins Builder 28 Jul '26

28 Jul '26
Attention is currently required from: dexter, jolly. Jenkins Builder has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/onomondo-ipa/+/43032?usp=email ) Change subject: V1.2: Add new fields to ProfileInfo list ...................................................................... Patch Set 2: (3 comments) File src/ipa/libipa/es10c_get_prfle_info.c: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/onomondo-ipa/+/43032/comment/32017f7c_55462c10… : PS2, Line 78: if (conv_req && conv_req->fallback_attribute_removed) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/onomondo-ipa/+/43032/comment/9e0b7dba_050ff48b… : PS2, Line 109: struct ipa_es10c_get_prfle_info_req *conv_get_prfle_info_req(const struct ipa_es10c_get_prfle_info_req *req) { open brace '{' following function definitions go on the next line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/onomondo-ipa/+/43032/comment/ccfe0cce_58bee6c2… : PS2, Line 110: uint8_t default_tags[] = { 0x5A, 0x4F, 0x9F, 0x70, 0x91, 0x92, 0x95, 0x9F,0x7B, 0x9F,0x26, 0x9F,0x67 }; space required after that ',' (ctx:VxV) -- To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43032?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: onomondo-ipa Gerrit-Branch: master Gerrit-Change-Id: I6667dba8dd84817cfee69daa1c44b98239fa171c Gerrit-Change-Number: 43032 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 28 Jul 2026 09:59:03 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmo-trx[master]: Transceiver52M: implement TRXDv2 support
by Jenkins Builder 28 Jul '26

28 Jul '26
Jenkins Builder has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-trx/+/43116?usp=email ) Change subject: Transceiver52M: implement TRXDv2 support ...................................................................... Patch Set 1: (4 comments) File Transceiver52M/Transceiver.h: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43116/comment/3168b329_ffe7d06e?usp… : PS1, Line 221: bool sendBurstInd(size_t chan, const struct osmo_trxd_burst_ind *bi); please, no spaces at the start of a line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43116/comment/7aa4195a_da92d712?usp… : PS1, Line 225: bool queueBurstIndBatched(size_t chan, const struct osmo_trxd_burst_ind *bi); please, no spaces at the start of a line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43116/comment/f3746ce6_452cad47?usp… : PS1, Line 228: bool flushBurstIndBatch(size_t chan); please, no spaces at the start of a line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43116/comment/5c4edfc1_ad7d3f8c?usp… : PS1, Line 231: bool handleBurstReq(size_t chan, const struct osmo_trxd_burst_req *br); please, no spaces at the start of a line -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43116?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ie6a33e3980b3ca4ab05a3d4221d5a8ba0132233d Gerrit-Change-Number: 43116 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 28 Jul 2026 09:58:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[L] Change in osmo-trx[master]: Transceiver52M: migrate to libosmo-trx
by Jenkins Builder 28 Jul '26

28 Jul '26
Jenkins Builder has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-trx/+/43115?usp=email ) Change subject: Transceiver52M: migrate to libosmo-trx ...................................................................... Patch Set 1: (3 comments) File Transceiver52M/Transceiver.h: Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43115/comment/c74716c4_91c4a0fc?usp… : PS1, Line 158: char data[OSMO_TRXC_MSG_BUF_SIZE]; please, no spaces at the start of a line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43115/comment/4cbdf3fb_874a2f21?usp… : PS1, Line 209: int pullRadioVector(size_t chan, struct osmo_trxd_burst_ind *ind); please, no spaces at the start of a line Robot Comment from checkpatch (run ID ): https://gerrit.osmocom.org/c/osmo-trx/+/43115/comment/69b5e759_5266ceea?usp… : PS1, Line 271: void logRxBurst(size_t chan, const struct osmo_trxd_burst_ind *bi); please, no spaces at the start of a line -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43115?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I458ec85c56e2101d073c8c35f11c147191c4ea0c Gerrit-Change-Number: 43115 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 28 Jul 2026 09:57:13 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue
by pespin 28 Jul '26

28 Jul '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email ) Change subject: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: You probably need to set some sort of shutdown FSM or logic which only does the osmo_iofd_free() after receiving the flush_cb (see again the osmo-pcap reference I shared). -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4e09e91e472a4441977a2c199c07c2cb8005632f Gerrit-Change-Number: 43102 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 28 Jul 2026 09:49:47 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue
by pespin 28 Jul '26

28 Jul '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email ) Change subject: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue ...................................................................... Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4e09e91e472a4441977a2c199c07c2cb8005632f Gerrit-Change-Number: 43102 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 28 Jul 2026 09:47:12 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in onomondo-ipa[master]: V1.2: Add new fields to ProfileInfo list
by jolly 28 Jul '26

28 Jul '26
Attention is currently required from: dexter, jolly. Hello Jenkins Builder, dexter, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43032?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by dexter, Verified-1 by Jenkins Builder Change subject: V1.2: Add new fields to ProfileInfo list ...................................................................... V1.2: Add new fields to ProfileInfo list Add new tags for ecallIndication, fallbackAttribute and fallbackAllowed. They new are not supported by non IoT eUICC. The IoT eUICC emulation will remove the unsupported tags from the ProfileInfoListRequest and later adds the requested fields to the ProfileInfoListResponse with the value 'false'. Reference SGP.32 Section 2.11.1.1.3 Related: SYS#8101 Change-Id: I6667dba8dd84817cfee69daa1c44b98239fa171c --- M asn1/SGP32Definitions.asn M src/ipa/libasn/CMakeLists.txt A src/ipa/libasn/SGP32-ProfileInfo.c A src/ipa/libasn/SGP32-ProfileInfo.h M src/ipa/libasn/SGP32-ProfileInfoListResponse.c M src/ipa/libasn/SGP32-ProfileInfoListResponse.h M src/ipa/libipa/es10c_get_prfle_info.c M src/ipa/libipa/es10c_get_prfle_info.h 8 files changed, 666 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/32/43032/2 -- To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43032?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: onomondo-ipa Gerrit-Branch: master Gerrit-Change-Id: I6667dba8dd84817cfee69daa1c44b98239fa171c Gerrit-Change-Number: 43032 Gerrit-PatchSet: 2 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue
by pespin 28 Jul '26

28 Jul '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email ) Change subject: osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Without even looking at the changes and only reading the commit description, I believe this approach is incorrect. Since you cannot anyway guarantee that all remaining data will be written synchronously, and in order to guarantee it you'd need to potentially block, this is not fesabile/appropriate. You need to instead account for the bytes submitted to the iofd, and then calculate how many bytes are enqueued and not yet written through tracking written bytes in the write_cb. See how it's done in osmo-pcap.git ./src/osmo_pcap_wr_file.c local_iofd_write_cb() -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43102?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I4e09e91e472a4441977a2c199c07c2cb8005632f Gerrit-Change-Number: 43102 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 28 Jul 2026 09:46:18 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmo-trx[master]: libosmo-trx/client: add optional limit for retransmissions
by fixeria 28 Jul '26

28 Jul '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43109?usp=email ) Change subject: libosmo-trx/client: add optional limit for retransmissions ...................................................................... libosmo-trx/client: add optional limit for retransmissions The client used to retransmit an unacknowledged command forever, like osmo-bts-trx does. trxcon, however, gives up after 3 retransmission attempts, concluding that the transceiver is offline. Add a new API function osmo_trxc_client_set_max_retrans() enabling this behavior: once a command has been retransmitted the given number of times without a response, the client escalates to the fatal_error call-back (with rsp == NULL) and freezes the command queue. The default (0) retains the old behavior (no limit). This is a preparation for porting trxcon to libosmo-trx. Change-Id: Ib90a032b38c69ae26023e726992d3f5f7e502fcf --- M libosmo-trx/include/osmocom/trx/trxc_client.h M libosmo-trx/src/trxc_client.c M tests/libosmo-trx/trxc_client_test.c M tests/libosmo-trx/trxc_client_test.err M tests/libosmo-trx/trxc_client_test.ok 5 files changed, 111 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/09/43109/1 diff --git a/libosmo-trx/include/osmocom/trx/trxc_client.h b/libosmo-trx/include/osmocom/trx/trxc_client.h index 7984b93..a182f40 100644 --- a/libosmo-trx/include/osmocom/trx/trxc_client.h +++ b/libosmo-trx/include/osmocom/trx/trxc_client.h @@ -48,6 +48,7 @@ int osmo_trxc_client_set_name(struct osmo_trxc_client *client, const char *fmt, ...); void osmo_trxc_client_set_log_cat(struct osmo_trxc_client *client, int log_cat); void osmo_trxc_client_set_retrans(struct osmo_trxc_client *client, unsigned int sec); +void osmo_trxc_client_set_max_retrans(struct osmo_trxc_client *client, unsigned int n); /*! escalate to the fatal_error call-back on NACK */ #define OSMO_TRXC_F_CRITICAL (1 << 0) diff --git a/libosmo-trx/src/trxc_client.c b/libosmo-trx/src/trxc_client.c index 39b2a43..f9c393b 100644 --- a/libosmo-trx/src/trxc_client.c +++ b/libosmo-trx/src/trxc_client.c @@ -44,11 +44,15 @@ /*! Default retransmit timeout (in seconds) */ #define TRXC_CLIENT_RETRANS_SEC 2 +static int trxc_client_fatal(struct osmo_trxc_client *client, + const struct osmo_trxc_msg *rsp); + /*! A single command in the queue */ struct trxc_cmd_entry { struct llist_head list; struct osmo_trxc_msg msg; /* type == OSMO_TRXC_MT_CMD */ uint32_t flags; /* OSMO_TRXC_F_* */ + unsigned int n_retrans; /* number of retransmissions so far */ osmo_trxc_client_rsp_cb *rsp_cb; void *cb_data; }; @@ -58,6 +62,7 @@ char *name; /* log prefix */ int log_cat; /* logging category (default DLGLOBAL) */ unsigned int retrans_sec; /* retransmit timeout */ + unsigned int max_retrans; /* maximum number of retransmissions (0 = no limit) */ struct llist_head cmd_queue; /* list of struct trxc_cmd_entry */ struct trxc_cmd_entry *last_acked; @@ -113,6 +118,15 @@ LOGCL(client, LOGL_NOTICE, "No response from transceiver for '" CMD_NAME_FMT "'\n", CMD_NAME_ARGS(e)); + if (client->max_retrans != 0 && e->n_retrans >= client->max_retrans) { + LOGCL(client, LOGL_FATAL, "Giving up on '" CMD_NAME_FMT "' after %u " + "retransmissions, transceiver offline?\n", + CMD_NAME_ARGS(e), e->n_retrans); + trxc_client_fatal(client, NULL); + return; /* keep the command queue frozen, do not re-arm the timer */ + } + + e->n_retrans++; trxc_client_send_next(client); } @@ -192,6 +206,16 @@ client->retrans_sec = sec; } +/*! Set the maximum number of retransmissions of a command (default: 0). + * Once a command has been retransmitted the given number of times without + * a response, the engine gives up and escalates to the fatal_error + * call-back (with rsp == NULL); the command queue remains frozen. + * The special value 0 means no limit: retransmit indefinitely. */ +void osmo_trxc_client_set_max_retrans(struct osmo_trxc_client *client, unsigned int n) +{ + client->max_retrans = n; +} + /*! Enqueue a new command for transmission. * * The new command is added to the end of the queue; there's at most one @@ -398,6 +422,9 @@ * implement a fallback (see the SETFORMAT negotiation). */ } + /* the transceiver is responsive (again) */ + e->n_retrans = 0; + client->in_rx = true; if (e->rsp_cb != NULL) rc = e->rsp_cb(client, &rsp, e->cb_data); diff --git a/tests/libosmo-trx/trxc_client_test.c b/tests/libosmo-trx/trxc_client_test.c index e042e10..eb9930d 100644 --- a/tests/libosmo-trx/trxc_client_test.c +++ b/tests/libosmo-trx/trxc_client_test.c @@ -164,6 +164,39 @@ osmo_trxc_client_free(client); } +static void test_max_retrans(void) +{ + struct osmo_trxc_client *client = client_alloc(); + + printf("=== %s ===\n", __func__); + + /* give up after 3 retransmissions (like trxcon does) */ + osmo_trxc_client_set_max_retrans(client, 3); + + osmo_trxc_client_poweron(client, &rsp_cb, "poweron"); + /* no response: 3 retransmissions, then fatal_error escalation */ + for (unsigned int i = 0; i < 5; i++) + fake_time_passes(2); + + osmo_trxc_client_free(client); + + /* a response resets the retransmission counter */ + client = client_alloc(); + osmo_trxc_client_set_max_retrans(client, 3); + + osmo_trxc_client_poweron(client, &rsp_cb, "poweron"); + fake_time_passes(2); + fake_time_passes(2); + rx_rsp(client, "RSP POWERON 0"); + osmo_trxc_client_rxtune(client, 890000, &rsp_cb, "rxtune"); + /* the previous 2 retransmissions shall not count for RXTUNE */ + fake_time_passes(2); + fake_time_passes(2); + rx_rsp(client, "RSP RXTUNE 0 890000"); + + osmo_trxc_client_free(client); +} + static int rsp_retry_cb(struct osmo_trxc_client *client, const struct osmo_trxc_msg *rsp, void *cb_data) { @@ -307,6 +340,7 @@ test_queueing(); test_dup_rsp(); test_retrans(); + test_max_retrans(); test_rsp_cb_retry(); test_fatal_error(); test_negotiate_format(); diff --git a/tests/libosmo-trx/trxc_client_test.err b/tests/libosmo-trx/trxc_client_test.err index e280bf1..115a9de 100644 --- a/tests/libosmo-trx/trxc_client_test.err +++ b/tests/libosmo-trx/trxc_client_test.err @@ -27,6 +27,30 @@ DLGLOBAL INFO phy0.trx0: Rx 'RSP POWERON 0' DLGLOBAL INFO phy0.trx0: Enqueueing 'CMD POWERON' DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL FATAL phy0.trx0: Giving up on 'CMD POWERON' after 3 retransmissions, transceiver offline? +DLGLOBAL INFO phy0.trx0: Enqueueing 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' +DLGLOBAL INFO phy0.trx0: Rx 'RSP POWERON 0' +DLGLOBAL INFO phy0.trx0: Enqueueing 'CMD RXTUNE 890000' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD RXTUNE 890000' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD RXTUNE 890000' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD RXTUNE 890000' +DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD RXTUNE 890000' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD RXTUNE 890000' +DLGLOBAL INFO phy0.trx0: Rx 'RSP RXTUNE 0 890000' +DLGLOBAL INFO phy0.trx0: Enqueueing 'CMD POWERON' +DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' DLGLOBAL INFO phy0.trx0: Rx 'RSP POWERON 1' DLGLOBAL NOTICE phy0.trx0: No response from transceiver for 'CMD POWERON' DLGLOBAL DEBUG phy0.trx0: Tx 'CMD POWERON' diff --git a/tests/libosmo-trx/trxc_client_test.ok b/tests/libosmo-trx/trxc_client_test.ok index 5e908ce..0c0d09d 100644 --- a/tests/libosmo-trx/trxc_client_test.ok +++ b/tests/libosmo-trx/trxc_client_test.ok @@ -28,6 +28,31 @@ rx_rsp: 'RSP POWERON 0' rsp_cb(poweron): 'RSP POWERON 0' (time passes: 10 s) +=== test_max_retrans === +tx_msg: 'CMD POWERON' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +(time passes: 2 s) +fatal_error: '(null)' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +(time passes: 2 s) +tx_msg: 'CMD POWERON' +rx_rsp: 'RSP POWERON 0' +rsp_cb(poweron): 'RSP POWERON 0' +tx_msg: 'CMD RXTUNE 890000' +(time passes: 2 s) +tx_msg: 'CMD RXTUNE 890000' +(time passes: 2 s) +tx_msg: 'CMD RXTUNE 890000' +rx_rsp: 'RSP RXTUNE 0 890000' +rsp_cb(rxtune): 'RSP RXTUNE 0 890000' === test_rsp_cb_retry === tx_msg: 'CMD POWERON' rx_rsp: 'RSP POWERON 1' -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43109?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ib90a032b38c69ae26023e726992d3f5f7e502fcf Gerrit-Change-Number: 43109 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • ...
  • 87
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.