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 -----
  • December
  • 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

  • 1 participants
  • 97203 discussions
[S] Change in libosmocore[master]: cbsp: cbsp_decode_cell_list(): validate the list length
by pespin 26 Nov '26

26 Nov '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/44178?usp=email ) Change subject: cbsp: cbsp_decode_cell_list(): validate the list length ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44178?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: I2d8fe20744715044ea4a54abb7cd0212246587fa Gerrit-Change-Number: 44178 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: Thu, 26 Nov 2026 19:03:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmocore[master]: tests/smscb_cbsp: add more decode test cases
by pespin 26 Nov '26

26 Nov '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/44176?usp=email ) Change subject: tests/smscb_cbsp: add more decode test cases ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44176?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: I70e40ac8cd8b6443fa4ef9246e45332c438a95b5 Gerrit-Change-Number: 44176 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: Thu, 26 Nov 2026 19:01:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libosmocore[master]: cbsp: cbsp_decode_cell_list(): do not reject empty cell list
by pespin 26 Nov '26

26 Nov '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/libosmocore/+/44177?usp=email ) Change subject: cbsp: cbsp_decode_cell_list(): do not reject empty cell list ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44177?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: If69ae9a90fe2e582c909386d6fe6f32f017591af Gerrit-Change-Number: 44177 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: Thu, 26 Nov 2026 19:00:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in libosmocore[master]: cbsp: cbsp_decode_cell_list(): tweak coding style
by fixeria 26 Nov '26

26 Nov '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44179?usp=email ) Change subject: cbsp: cbsp_decode_cell_list(): tweak coding style ...................................................................... cbsp: cbsp_decode_cell_list(): tweak coding style Change-Id: Icf9db71afe482c139cd07ca1a3df308af6877b4a --- M src/gsm/cbsp.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/44179/1 diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c index bdb7369..2198c02 100644 --- a/src/gsm/cbsp.c +++ b/src/gsm/cbsp.c @@ -513,7 +513,8 @@ if (buf == NULL) { osmo_cbsp_errstr = "cell list: missing mandatory IE"; return -ENOENT; - } else if (len < 1) { + } + if (len < 1) { osmo_cbsp_errstr = "cell list: too short"; return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44179?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Icf9db71afe482c139cd07ca1a3df308af6877b4a Gerrit-Change-Number: 44179 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in libosmocore[master]: cbsp: cbsp_decode_cell_list(): do not reject empty cell list
by fixeria 26 Nov '26

26 Nov '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44177?usp=email ) Change subject: cbsp: cbsp_decode_cell_list(): do not reject empty cell list ...................................................................... cbsp: cbsp_decode_cell_list(): do not reject empty cell list 190fd93f broke CBSP TCs in ttcn3-bsc-test. The testsuite sends an empty cell list with id_discr set to CELL_IDENT_BSS. Apparently, this is legal and osmo-bsc interprets this as "all served cells". Change-Id: If69ae9a90fe2e582c909386d6fe6f32f017591af Fixes: 190fd93f ("cbsp: cbsp_decode_cell_list(): fix endless loop iteration") Related: OS#7098 --- M src/gsm/cbsp.c M tests/smscb/cbsp_test.c M tests/smscb/cbsp_test.ok 3 files changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/44177/1 diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c index 18b8226..233cbf3 100644 --- a/src/gsm/cbsp.c +++ b/src/gsm/cbsp.c @@ -521,8 +521,10 @@ cl->id_discr = *cur++; cell_id_size = gsm0808_cell_id_size(cl->id_discr); - if (cell_id_size <= 0) { - osmo_cbsp_errstr = "cell list: unexpected cell_id_size"; + if (cell_id_size == 0) + return 0; /* empty list, nothing to parse */ + if (cell_id_size < 0) { + osmo_cbsp_errstr = "cell list: unexpected cell_id_discr"; return -EINVAL; } diff --git a/tests/smscb/cbsp_test.c b/tests/smscb/cbsp_test.c index 43b921c..f59dbc1 100644 --- a/tests/smscb/cbsp_test.c +++ b/tests/smscb/cbsp_test.c @@ -81,12 +81,13 @@ .hex_pdu = "0300002c0e003103417009000f0009f1070018003003012711c3510f04000f0009f1070017002a09f1070018002a1200", }, { - /* XXX: CELL_IDENT_BSS => empty cell list (fails) */ + /* CELL_IDENT_BSS => empty cell list */ .name = "CBSP RESET: Cell List (BSS)", .hex_pdu = "1000000404000106", }, { - /* XXX: CELL_IDENT_NO_CELL is not listed in 3GPP TS 48.049, 8.2.6 (fails) */ + /* CELL_IDENT_NO_CELL is not listed in 3GPP TS 48.049, 8.2.6, + * but we still parse it as an empty cell list */ .name = "CBSP RESET: Cell List (NO_CELL)", .hex_pdu = "1000000404000103", }, diff --git a/tests/smscb/cbsp_test.ok b/tests/smscb/cbsp_test.ok index f869d71..bbc1ff0 100644 --- a/tests/smscb/cbsp_test.ok +++ b/tests/smscb/cbsp_test.ok @@ -4,13 +4,13 @@ TC[0] osmo_cbsp_decode() result: pass TC[1] 'CBSP RESET: Cell List (BSS)' TC[1] PDU: 1000000404000106 -TC[1] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[1] osmo_cbsp_decode() result: pass TC[2] 'CBSP RESET: Cell List (NO_CELL)' TC[2] PDU: 1000000404000103 -TC[2] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[2] osmo_cbsp_decode() result: pass TC[3] 'CBSP RESET: Cell List (NO_CELL) with trailing bytes' TC[3] PDU: 1000000404000303ffff -TC[3] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[3] osmo_cbsp_decode() result: pass TC[4] 'CBSP RESET: Cell List (LAC, short)' TC[4] PDU: 1000000404000205ff TC[4] osmo_cbsp_decode() result: cell list: error decoding cell_id_union @@ -22,5 +22,5 @@ TC[6] osmo_cbsp_decode() result: error TC[7] 'CBSP RESET: Cell List (unknown discriminator)' TC[7] PDU: 100000040400010f -TC[7] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[7] osmo_cbsp_decode() result: cell list: unexpected cell_id_discr === test_decode end === -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44177?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: If69ae9a90fe2e582c909386d6fe6f32f017591af Gerrit-Change-Number: 44177 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in libosmocore[master]: tests/smscb_cbsp: add more decode test cases
by fixeria 26 Nov '26

26 Nov '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44176?usp=email ) Change subject: tests/smscb_cbsp: add more decode test cases ...................................................................... tests/smscb_cbsp: add more decode test cases Some test cases are currently failing/passing unexpectedly. This will be addressed in follow-up patches. Change-Id: I70e40ac8cd8b6443fa4ef9246e45332c438a95b5 Related: OS#7097, OS#7098 --- M tests/smscb/cbsp_test.c M tests/smscb/cbsp_test.ok 2 files changed, 88 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/44176/1 diff --git a/tests/smscb/cbsp_test.c b/tests/smscb/cbsp_test.c index 2dbdded..43b921c 100644 --- a/tests/smscb/cbsp_test.c +++ b/tests/smscb/cbsp_test.c @@ -26,6 +26,14 @@ #include <osmocom/gsm/protocol/gsm_48_049.h> #include <osmocom/gsm/cbsp.h> +struct test_case { + const char *name; + const char *hex_pdu; + bool exp_failure; +}; + +static const struct test_case test_case_list[] = { + { /* CBSP WRITE-REPLACE FAILURE Message Type: WRITE-REPLACE FAILURE (3) @@ -69,8 +77,45 @@ Information Element Identifier: Channel Indicator (18) Channel Indicator: basic channel (0x00) */ -static const char write_repl_fail_with_failure_list[] = - "0300002c0e003103417009000f0009f1070018003003012711c3510f04000f0009f1070017002a09f1070018002a1200"; + .name = "CBSP WRITE-REPLACE FAILURE", + .hex_pdu = "0300002c0e003103417009000f0009f1070018003003012711c3510f04000f0009f1070017002a09f1070018002a1200", + }, + { + /* XXX: CELL_IDENT_BSS => empty cell list (fails) */ + .name = "CBSP RESET: Cell List (BSS)", + .hex_pdu = "1000000404000106", + }, + { + /* XXX: CELL_IDENT_NO_CELL is not listed in 3GPP TS 48.049, 8.2.6 (fails) */ + .name = "CBSP RESET: Cell List (NO_CELL)", + .hex_pdu = "1000000404000103", + }, + { + /* same as the previos one, but with trailing bytes (ignored) */ + .name = "CBSP RESET: Cell List (NO_CELL) with trailing bytes", + .hex_pdu = "1000000404000303ffff", + }, + { + /* CELL_IDENT_LAC with short LAC => failure */ + .name = "CBSP RESET: Cell List (LAC, short)", + .hex_pdu = "1000000404000205ff", + }, + { + /* XXX: CELL_IDENT_LAC with missing LAC => expected failure (passes) */ + .name = "CBSP RESET: Cell List (LAC, missing)", + .hex_pdu = "1000000404000105", + }, + { + /* CELL_IDENT_LAC with malformed length => failure */ + .name = "CBSP RESET: Cell List (malformed TLV)", + .hex_pdu = "100000040400ff05", + }, + { + /* unknown cell identification discriminator => failure */ + .name = "CBSP RESET: Cell List (unknown discriminator)", + .hex_pdu = "100000040400010f", + }, +}; static struct msgb *msgb_from_hex(unsigned int size, const char *hex) { @@ -88,14 +133,25 @@ printf("=== %s start ===\n", __func__); - msg = msgb_from_hex(sizeof(write_repl_fail_with_failure_list), - write_repl_fail_with_failure_list); + for (unsigned int i = 0; i < ARRAY_SIZE(test_case_list); i++) { + const struct test_case *tc = &test_case_list[i]; + const char *verdict; - cbsp_dec = osmo_cbsp_decode(NULL, msg); - OSMO_ASSERT(cbsp_dec); + printf("TC[%u] '%s'\n", i, tc->name); + printf("TC[%u] PDU: %s\n", i, tc->hex_pdu); - talloc_free(cbsp_dec); - msgb_free(msg); + msg = msgb_from_hex(strlen(tc->hex_pdu), tc->hex_pdu); + + cbsp_dec = osmo_cbsp_decode(NULL, msg); + if (cbsp_dec != NULL) + verdict = "pass"; + else /* osmo_cbsp_errstr may be unset (NULL) */ + verdict = osmo_cbsp_errstr ? : "error"; + printf("TC[%u] osmo_cbsp_decode() result: %s\n", i, verdict); + + talloc_free(cbsp_dec); + msgb_free(msg); + } printf("=== %s end ===\n", __func__); } diff --git a/tests/smscb/cbsp_test.ok b/tests/smscb/cbsp_test.ok index a837de5..f869d71 100644 --- a/tests/smscb/cbsp_test.ok +++ b/tests/smscb/cbsp_test.ok @@ -1,2 +1,26 @@ === test_decode start === +TC[0] 'CBSP WRITE-REPLACE FAILURE' +TC[0] PDU: 0300002c0e003103417009000f0009f1070018003003012711c3510f04000f0009f1070017002a09f1070018002a1200 +TC[0] osmo_cbsp_decode() result: pass +TC[1] 'CBSP RESET: Cell List (BSS)' +TC[1] PDU: 1000000404000106 +TC[1] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[2] 'CBSP RESET: Cell List (NO_CELL)' +TC[2] PDU: 1000000404000103 +TC[2] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[3] 'CBSP RESET: Cell List (NO_CELL) with trailing bytes' +TC[3] PDU: 1000000404000303ffff +TC[3] osmo_cbsp_decode() result: cell list: unexpected cell_id_size +TC[4] 'CBSP RESET: Cell List (LAC, short)' +TC[4] PDU: 1000000404000205ff +TC[4] osmo_cbsp_decode() result: cell list: error decoding cell_id_union +TC[5] 'CBSP RESET: Cell List (LAC, missing)' +TC[5] PDU: 1000000404000105 +TC[5] osmo_cbsp_decode() result: pass +TC[6] 'CBSP RESET: Cell List (malformed TLV)' +TC[6] PDU: 100000040400ff05 +TC[6] osmo_cbsp_decode() result: error +TC[7] 'CBSP RESET: Cell List (unknown discriminator)' +TC[7] PDU: 100000040400010f +TC[7] osmo_cbsp_decode() result: cell list: unexpected cell_id_size === test_decode end === -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44176?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I70e40ac8cd8b6443fa4ef9246e45332c438a95b5 Gerrit-Change-Number: 44176 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in libosmocore[master]: cbsp: cbsp_decode_cell_list(): validate the list length
by fixeria 26 Nov '26

26 Nov '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44178?usp=email ) Change subject: cbsp: cbsp_decode_cell_list(): validate the list length ...................................................................... cbsp: cbsp_decode_cell_list(): validate the list length Change-Id: I2d8fe20744715044ea4a54abb7cd0212246587fa Related: OS#7098 --- M src/gsm/cbsp.c M tests/smscb/cbsp_test.c M tests/smscb/cbsp_test.ok 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/44178/1 diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c index 233cbf3..bdb7369 100644 --- a/src/gsm/cbsp.c +++ b/src/gsm/cbsp.c @@ -528,6 +528,12 @@ return -EINVAL; } + /* remaining len must be a multiple of cell_id_size */ + if ((len - 1) == 0 || (len - 1) % cell_id_size) { + osmo_cbsp_errstr = "cell list: malformed/empty"; + return -EINVAL; + } + while (cur < buf + len) { struct osmo_cbsp_cell_ent *ent = talloc_zero(ctx, struct osmo_cbsp_cell_ent); unsigned int len_remain = len - (cur - buf); diff --git a/tests/smscb/cbsp_test.c b/tests/smscb/cbsp_test.c index f59dbc1..7ed5121 100644 --- a/tests/smscb/cbsp_test.c +++ b/tests/smscb/cbsp_test.c @@ -102,7 +102,7 @@ .hex_pdu = "1000000404000205ff", }, { - /* XXX: CELL_IDENT_LAC with missing LAC => expected failure (passes) */ + /* CELL_IDENT_LAC with missing LAC => failure */ .name = "CBSP RESET: Cell List (LAC, missing)", .hex_pdu = "1000000404000105", }, diff --git a/tests/smscb/cbsp_test.ok b/tests/smscb/cbsp_test.ok index bbc1ff0..df09370 100644 --- a/tests/smscb/cbsp_test.ok +++ b/tests/smscb/cbsp_test.ok @@ -13,10 +13,10 @@ TC[3] osmo_cbsp_decode() result: pass TC[4] 'CBSP RESET: Cell List (LAC, short)' TC[4] PDU: 1000000404000205ff -TC[4] osmo_cbsp_decode() result: cell list: error decoding cell_id_union +TC[4] osmo_cbsp_decode() result: cell list: malformed/empty TC[5] 'CBSP RESET: Cell List (LAC, missing)' TC[5] PDU: 1000000404000105 -TC[5] osmo_cbsp_decode() result: pass +TC[5] osmo_cbsp_decode() result: cell list: malformed/empty TC[6] 'CBSP RESET: Cell List (malformed TLV)' TC[6] PDU: 100000040400ff05 TC[6] osmo_cbsp_decode() result: error -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44178?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2d8fe20744715044ea4a54abb7cd0212246587fa Gerrit-Change-Number: 44178 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: testenv: show unexpected respawns at the end
by osmith 26 Nov '26

26 Nov '26
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email ) Change subject: testenv: show unexpected respawns at the end ...................................................................... testenv: show unexpected respawns at the end Split respawn.sh in respawn-expected.sh and respawn-unexpected.sh and adjust its users. Let the respawn-unexpected.sh script write each respawn to a new end.log file, which gets displayed at the end of testenv runs, if it exists. Example: [testenv] 1 warning found in end.log: [testenv] > Unexpected respawn of "osmo-bts-trx" during test "BTS_Tests_VAMOS.TC_vamos_chan_act_vhh" This allows us to quickly see if a program was respawned unexpectedly, while still respawning it in order to not abort the testsuite or have all following tests fail. Change-Id: Ia0650344b6df428e27de9e011676e884d27bfde0 --- M _testenv/README.md R _testenv/data/scripts/respawn-expected.sh A _testenv/data/scripts/respawn-unexpected.sh M _testenv/testenv.py M _testenv/testenv/daemons.py M _testenv/testenv/testdir.py M bsc/osmo_bts_omldummy.sh M bts/testenv_generic.cfg M bts/testenv_hopping.cfg M pcu/testenv_generic.cfg M pcu/testenv_sns.cfg 11 files changed, 99 insertions(+), 8 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve diff --git a/_testenv/README.md b/_testenv/README.md index 4f53724..42dfce2 100644 --- a/_testenv/README.md +++ b/_testenv/README.md @@ -241,7 +241,7 @@ The user's `PATH` environment variable is prefixed with the following paths: * The directory of the testsuite. * The directory for binaries built from source. - * The directory `_testenv/data/scripts` (which has e.g. `respawn.sh`). + * The directory `_testenv/data/scripts` (which has e.g. `respawn-expected.sh`). * The directory `_testenv/data/scripts/qemu`. * `PWD`: @@ -249,15 +249,30 @@ log dir. For example: ``` -/tmp/logs +/tmp/logs # TESTENV_TESTDIR +├── end.log # TESTENV_END_LOG ├── ggsn # Executables from [ggsn] section run in this dir │   ├── ggsn.log │   └── osmo-ggsn.cfg └── testsuite # Executables from [testsuite] run in this dir + ├── .current_test # The current test name is in this file ├── Common.cfg ├── GGSN_Tests.cfg └── GGSN_Tests.default ``` + If a testsuite has multiple configurations (`./testenv.py run -c`), then + `TESTENV_TESTDIR` ends in the name of the current configuration and is next + to `end.log`. For example: +``` +/tmp/logs +├── end.log # TESTENV_END_LOG is here for all configurations +├── generic # TESTENV_TESTDIR while running the generic config +│ ├── bsc +│ ├── bts +│ └── testsuite +├── hopping # TESTENV_TESTDIR while running the hopping config +└── oml # TESTENV_TESTDIR while running the oml config +``` * `TESTENV_INSTALL_DIR`: The directory into which the SUT binaries and other files are installed. It @@ -306,6 +321,16 @@ running podman. This is used in `_testenv/data/scripts/require_ulimit_r.sh` to display a hint for setting the rtprio limit for this user. +* `TESTENV_TESTDIR`: + (Set for `program=` of test components only.) This directory contains logs + and configurations for the current configuration. See `PWD` above for + examples. + +* `TESTENV_END_LOG`: + (Set for `program=` of test components only.) Path to an `end.log` file, to + which warnings can be written that will be displayed at the end of the + testenv run. This is used by `respawn-unexpected.sh`. + ## Eclipse-titan versions It is possible to change the eclipse-titan version that is used to build and diff --git a/_testenv/data/scripts/respawn.sh b/_testenv/data/scripts/respawn-expected.sh similarity index 100% rename from _testenv/data/scripts/respawn.sh rename to _testenv/data/scripts/respawn-expected.sh diff --git a/_testenv/data/scripts/respawn-unexpected.sh b/_testenv/data/scripts/respawn-unexpected.sh new file mode 100755 index 0000000..27949db --- /dev/null +++ b/_testenv/data/scripts/respawn-unexpected.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Restart a given test component while the testsuite is running. Unlike +# respawn-expected.sh we don't expect this to happen but need to keep going +# anyway. We log that this happens to $TESTENV_END_LOG, which then gets +# displayed at the end of the testenv run. + +trap "kill 0" EXIT + +SLEEP_BEFORE_RESPAWN=${SLEEP_BEFORE_RESPAWN:-0} + +i=0 +max_i=500 +while [ $i -lt $max_i ]; do + echo "respawn: $i: starting: $*" + $* & + LAST_PID=$! + wait $LAST_PID + LAST_STATUS=$? + echo "respawn: $i: stopped pid $LAST_PID with status $LAST_STATUS" + + CURRENT_TEST="$(cat "$TESTENV_TESTDIR"/testsuite/.current_test)" + if [ -n "$CURRENT_TEST" ]; then + echo "Unexpected respawn of \"$*\" during test \"$CURRENT_TEST\"" >>"$TESTENV_END_LOG" + else + echo "Unexpected respawn of \"$*\"" >>"$TESTENV_END_LOG" + fi + + if [ $LAST_STATUS -ge 128 ]; then + echo "respawn: process was terminated abnormally, not respawning" + exit $LAST_STATUS + fi + if [ $SLEEP_BEFORE_RESPAWN -gt 0 ]; then + echo "respawn: sleeping $SLEEP_BEFORE_RESPAWN seconds..." + sleep $SLEEP_BEFORE_RESPAWN + fi + i=$(expr $i + 1) +done +echo "respawn: exiting after $max_i runs" diff --git a/_testenv/testenv.py b/_testenv/testenv.py index 695a857..ec64a73 100755 --- a/_testenv/testenv.py +++ b/_testenv/testenv.py @@ -135,11 +135,30 @@ clean() +def show_end_log(): + if getattr(testenv.args, "action", None) != "run": + return + + end_log = testenv.testdir.testdir_topdir_end_log + if not end_log or not os.path.exists(end_log): + return + + with open(end_log) as e: + lines = e.readlines() + + warnings = "warning" if len(lines) == 1 else "warnings" + logging.warning(f"{len(lines)} {warnings} found in end.log:") + for line in lines: + logging.warning(f"> {line.rstrip()}") + + try: main() + show_end_log() except testenv.NoTraceException as e: logging.error(e) testenv.podman.stop() + show_end_log() sys.exit(2) except KeyboardInterrupt: print() # new line @@ -147,7 +166,9 @@ if test: logging.critical(f"^C during {test}") testenv.podman.stop() + show_end_log() sys.exit(3) except: testenv.podman.stop() + show_end_log() raise diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py index 3ee1e6d..aa8d4c0 100644 --- a/_testenv/testenv/daemons.py +++ b/_testenv/testenv/daemons.py @@ -55,7 +55,10 @@ pipe = f">{shlex.quote(log)} 2>&1" cmd = ["sh", "-c", f"ulimit -c unlimited; {program} {pipe}"] - env = {} + env = { + "TESTENV_END_LOG": testenv.testdir.testdir_topdir_end_log, + "TESTENV_TESTDIR": testenv.testdir.testdir, + } if testenv.args.io_uring: env["LIBOSMO_IO_BACKEND"] = "IO_URING" diff --git a/_testenv/testenv/testdir.py b/_testenv/testenv/testdir.py index 927ce69..a980f09 100644 --- a/_testenv/testenv/testdir.py +++ b/_testenv/testenv/testdir.py @@ -18,12 +18,14 @@ # current configuration. testdir = None testdir_topdir = None +testdir_topdir_end_log = None prefix = None clean_scripts = {} def init(): global testdir_topdir + global testdir_topdir_end_log global prefix prefix = f"testenv-{testenv.args.testsuite}-" @@ -50,6 +52,8 @@ testenv.cmd.run(["rm", "/tmp/logs"], no_podman=True) testenv.cmd.run(["ln", "-sf", testdir_topdir, "/tmp/logs"], no_podman=True) + testdir_topdir_end_log = os.path.join(testdir_topdir, "end.log") + def prepare(cfg_name, cfg, loop_count): global testdir diff --git a/bsc/osmo_bts_omldummy.sh b/bsc/osmo_bts_omldummy.sh index 611f750..8c707af 100755 --- a/bsc/osmo_bts_omldummy.sh +++ b/bsc/osmo_bts_omldummy.sh @@ -17,7 +17,7 @@ ;; esac -respawn.sh \ +respawn-expected.sh \ osmo-bts-omldummy \ "$BTS_FEATURES" \ "127.0.0.1" \ diff --git a/bts/testenv_generic.cfg b/bts/testenv_generic.cfg index 4807d7f..a8c4bef 100644 --- a/bts/testenv_generic.cfg +++ b/bts/testenv_generic.cfg @@ -22,7 +22,7 @@ [bts] prepare=require_ulimit_r.sh 30 -program=respawn.sh osmo-bts-trx +program=respawn-unexpected.sh osmo-bts-trx make=osmo-bts package=osmo-bts copy=osmo-bts.cfg diff --git a/bts/testenv_hopping.cfg b/bts/testenv_hopping.cfg index a7fba70..5c2d4dd 100644 --- a/bts/testenv_hopping.cfg +++ b/bts/testenv_hopping.cfg @@ -25,7 +25,7 @@ [bts] prepare=require_ulimit_r.sh 30 -program=respawn.sh osmo-bts-trx +program=respawn-unexpected.sh osmo-bts-trx make=osmo-bts package=osmo-bts copy=osmo-bts.cfg diff --git a/pcu/testenv_generic.cfg b/pcu/testenv_generic.cfg index 7d506cf..32f56d8 100644 --- a/pcu/testenv_generic.cfg +++ b/pcu/testenv_generic.cfg @@ -3,7 +3,7 @@ config=PCU_Tests.cfg [pcu] -program=respawn.sh osmo-pcu +program=respawn-expected.sh osmo-pcu make=osmo-pcu package=osmo-pcu copy=osmo-pcu.cfg diff --git a/pcu/testenv_sns.cfg b/pcu/testenv_sns.cfg index 0bf4e13..54c377f 100644 --- a/pcu/testenv_sns.cfg +++ b/pcu/testenv_sns.cfg @@ -3,7 +3,7 @@ config=PCU_Tests_SNS.cfg [pcu] -program=respawn.sh osmo-pcu -c osmo-pcu-sns.cfg +program=respawn-expected.sh osmo-pcu -c osmo-pcu-sns.cfg make=osmo-pcu package=osmo-pcu copy=osmo-pcu-sns.cfg -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia0650344b6df428e27de9e011676e884d27bfde0 Gerrit-Change-Number: 44175 Gerrit-PatchSet: 1 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
[M] Change in osmo-ttcn3-hacks[master]: testenv: show unexpected respawns at the end
by fixeria 26 Nov '26

26 Nov '26
Attention is currently required from: osmith. fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email ) Change subject: testenv: show unexpected respawns at the end ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia0650344b6df428e27de9e011676e884d27bfde0 Gerrit-Change-Number: 44175 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 26 Nov 2026 12:00:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: testenv: show unexpected respawns at the end
by pespin 26 Nov '26

26 Nov '26
Attention is currently required from: fixeria, osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email ) Change subject: testenv: show unexpected respawns at the end ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44175?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia0650344b6df428e27de9e011676e884d27bfde0 Gerrit-Change-Number: 44175 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 26 Nov 2026 11:31:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • ...
  • 9721
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.