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

October 2025

  • 1 participants
  • 631 discussions
[M] Change in ...osmo-s1gw[master]: [REST] osmo-s1gw-cli.py: implement eNB/E-RAB list sorting
by fixeria 08 Oct '25

08 Oct '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41172?usp=email ) Change subject: [REST] osmo-s1gw-cli.py: implement eNB/E-RAB list sorting ...................................................................... [REST] osmo-s1gw-cli.py: implement eNB/E-RAB list sorting Change-Id: Iee7a922479fff7c2038f50325b5f6dfe39c16969 Related: SYS#7066 --- M contrib/osmo-s1gw-cli.py M doc/osmo-s1gw-cli.md 2 files changed, 79 insertions(+), 18 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index ac4b1c6..b51a667 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -244,8 +244,11 @@ '# E-RABs': item.get('erab_count'), } - def enb_list_print(self, items: list[dict]) -> None: - ''' Print a list of eNBs in tabular form ''' + def enb_list_print(self, items: list[dict], + sort_by: str = 'handle', + reverse: bool = False) -> None: + ''' Print a sorted list of eNBs in tabular form ''' + items.sort(key=lambda item: item.get(sort_by), reverse=reverse) self.poutput(tabulate.tabulate(map(self.enb_list_item, items), headers='keys', tablefmt=self.tablefmt)) @@ -255,11 +258,31 @@ headers=['Parameter', 'Value'], tablefmt=self.tablefmt)) + @staticmethod + def add_sort_group(parser, + default: str, + choices: set[str]) -> None: + ''' Add argparse group with sorting params ''' + sort_group = parser.add_argument_group('Sorting options') + sort_group.add_argument('-S', '--sort-by', + type=str, + default=default, + choices=choices, + help='Sort by (default: %(default)s)') + sort_group.add_argument('--reverse', + action='store_true', + help='Reverse order (default: %(default)s)') + + enb_list_parser = cmd2.Cmd2ArgumentParser() + add_sort_group(enb_list_parser, default='handle', + choices=('handle', 'pid', 'state', 'genb_id', 'uptime')) + + @cmd2.with_argparser(enb_list_parser) @cmd2.with_category(CAT_ENB) def do_enb_list(self, opts) -> None: ''' Get a list of eNB connections ''' data = self.iface.enb_list() - self.enb_list_print(data) + self.enb_list_print(data, opts.sort_by, opts.reverse) @staticmethod def gen_enb_id(opts) -> str: @@ -341,8 +364,12 @@ 'U2A F-TEID': f_teid(item.get('f_teid_u2a')) if 'f_teid_u2a' in item else None, } - def erab_list_print(self, items: list[dict], full: bool) -> None: - ''' Print a list of E-RABs in tabular form ''' + def erab_list_print(self, items: list[dict], + full: bool = False, + sort_by: str = 'pid', + reverse: bool = False) -> None: + ''' Print a sorted list of E-RABs in tabular form ''' + items.sort(key=lambda item: item.get(sort_by), reverse=reverse) func = self.erab_list_item_full if full else self.erab_list_item self.poutput(tabulate.tabulate(map(func, items), headers='keys', tablefmt=self.tablefmt)) @@ -357,6 +384,8 @@ enb_erab_list_parser.add_argument('-f', '--full', action='store_true', help='Print full table (more columns)') + add_sort_group(enb_erab_list_parser, default='pid', + choices=('pid', 'state', 'mme_ue_id', 'erab_id')) add_enb_id_group(enb_erab_list_parser) @cmd2.with_argparser(enb_erab_list_parser) @@ -365,19 +394,21 @@ ''' Get E-RAB list for a specific eNB ''' enb_id = self.gen_enb_id(opts) data = self.iface.enb_erab_list(enb_id) - self.erab_list_print(data, opts.full) + self.erab_list_print(data, opts.full, opts.sort_by, opts.reverse) erab_list_parser = cmd2.Cmd2ArgumentParser() erab_list_parser.add_argument('-f', '--full', action='store_true', help='Print full table (more columns)') + add_sort_group(erab_list_parser, default='pid', + choices=('pid', 'state', 'mme_ue_id', 'erab_id')) @cmd2.with_argparser(erab_list_parser) @cmd2.with_category(CAT_ERAB) def do_erab_list(self, opts) -> None: ''' Get E-RAB list for all eNBs ''' data = self.iface.erab_list() - self.erab_list_print(data, opts.full) + self.erab_list_print(data, opts.full, opts.sort_by, opts.reverse) erab_info_parser = cmd2.Cmd2ArgumentParser() erab_info_parser.add_argument('-P', '--pid', diff --git a/doc/osmo-s1gw-cli.md b/doc/osmo-s1gw-cli.md index db29852..2e99e7e 100644 --- a/doc/osmo-s1gw-cli.md +++ b/doc/osmo-s1gw-cli.md @@ -156,6 +156,23 @@ Get a list of eNB connections. ``` +Usage: enb_list [-h] + [-S {handle, pid, state, genb_id, uptime}] [--reverse] + +Get a list of eNB connections + +optional arguments: + -h, --help show this help message and exit + +Sorting options: + -S, --sort-by {handle, pid, state, genb_id, uptime} + Sort by (default: handle) + --reverse Reverse order (default: False) +``` + +Example: getting a list of eNBs (by default, sorted by handle). + +``` OsmoS1GW# enb_list | eNB handle | PID | Global-eNB-ID | State | eNB addr:port (aid) | MME addr:port (aid) | Uptime (s) | # E-RABs | |--------------|-----------|-----------------|---------|-------------------------|-------------------------|--------------|------------| @@ -242,20 +259,27 @@ Get E-RAB list for a specific eNB. ``` -Usage: enb_erab_list [-h] [-f] (-H HANDLE | -P PID | -G GENBID | --enb-sctp-aid AID | --mme-sctp-aid AID) +Usage: enb_erab_list [-h] [-f] + [-S {pid, state, mme_ue_id, erab_id}] [--reverse] + (-H HANDLE | -P PID | -G GENBID | --enb-sctp-aid AID | --mme-sctp-aid AID) Get E-RAB list for a specific eNB optional arguments: - -h, --help show this help message and exit - -f, --full Print full table (more columns) + -h, --help show this help message and exit + -f, --full Print full table (more columns) + +Sorting options: + -S, --sort-by {pid, state, mme_ue_id, erab_id} + Sort by (default: pid) + --reverse Reverse order (default: False) eNB ID: - -H, --handle HANDLE eNB handle (example: 0) - -P, --pid PID eNB process ID (example: 0.33.1) - -G, --genbid GENBID Global-eNB-ID (example: 262-42-1337) - --enb-sctp-aid AID eNB association identifier (example: 42) - --mme-sctp-aid AID MME association identifier (example: 42) + -H, --handle HANDLE eNB handle (example: 0) + -P, --pid PID eNB process ID (example: 0.33.1) + -G, --genbid GENBID Global-eNB-ID (example: 262-42-1337) + --enb-sctp-aid AID eNB association identifier (example: 42) + --mme-sctp-aid AID MME association identifier (example: 42) ``` Example: Obtaining E-RAB list for an eNB with the given Global-eNB-ID. @@ -264,8 +288,8 @@ OsmoS1GW# enb_erab_list -G 001-01-0 | PID | MME-UE-S1AP-ID | E-RAB-ID | State | |-----------|------------------|------------|------------| -| <0.708.0> | 4242 | 1 | erab_setup | | <0.707.0> | 4242 | 0 | erab_setup | +| <0.708.0> | 4242 | 1 | erab_setup | | <0.709.0> | 4242 | 2 | erab_setup | ``` @@ -275,12 +299,18 @@ ``` Usage: erab_list [-h] [-f] + [-S {pid, state, mme_ue_id, erab_id}] [--reverse] Get E-RAB list for all eNBs optional arguments: - -h, --help show this help message and exit - -f, --full Print full table (more columns) + -h, --help show this help message and exit + -f, --full Print full table (more columns) + +Sorting options: + -S, --sort-by {pid, state, mme_ue_id, erab_id} + Sort by (default: pid) + --reverse Reverse order (default: False) ``` The output format is the same as produced by the `enb_erab_list` command. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41172?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Iee7a922479fff7c2038f50325b5f6dfe39c16969 Gerrit-Change-Number: 41172 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: [REST] osmo-s1gw-cli.py: implement eNB/E-RAB list sorting
by fixeria 08 Oct '25

08 Oct '25
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41172?usp=email ) Change subject: [REST] osmo-s1gw-cli.py: implement eNB/E-RAB list sorting ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41172?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Iee7a922479fff7c2038f50325b5f6dfe39c16969 Gerrit-Change-Number: 41172 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Oct 2025 12:06:27 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in ...osmo-s1gw[master]: [REST] Implement {Enb,Erab}Delete
by fixeria 08 Oct '25

08 Oct '25
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41105?usp=email ) Change subject: [REST] Implement {Enb,Erab}Delete ...................................................................... Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41105?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I3576814f44d87551fdac6236ddbec6215ba07455 Gerrit-Change-Number: 41105 Gerrit-PatchSet: 10 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Oct 2025 12:06:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ci[master]: jobs/master-builds: rtl-sdr: add jenkins-notifications
by osmith 08 Oct '25

08 Oct '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/41200?usp=email ) Change subject: jobs/master-builds: rtl-sdr: add jenkins-notifications ...................................................................... jobs/master-builds: rtl-sdr: add jenkins-notifications Send mails about failures to the jenkins-notifications mailing list, so they don't go unnoticed. Change-Id: I9b783181a467a76bc2d11149baf433581c91bd06 --- M jobs/master-builds.yml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index dbdfe51..fec014e 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -609,7 +609,7 @@ - rtl-sdr: repos_url: '{gitea_url}/sdr/{repos}' - email: laforge(a)gnumonks.org steve(a)steve-m.de + email: jenkins-notifications(a)lists.osmocom.org laforge(a)gnumonks.org steve(a)steve-m.de - pysim: concurrent: false -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41200?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I9b783181a467a76bc2d11149baf433581c91bd06 Gerrit-Change-Number: 41200 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: ttcn3-tcpdump-start: fix default TTCN3_PCAP_PATH
by osmith 08 Oct '25

08 Oct '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41204?usp=email ) Change subject: ttcn3-tcpdump-start: fix default TTCN3_PCAP_PATH ...................................................................... ttcn3-tcpdump-start: fix default TTCN3_PCAP_PATH Fix that manually running testsuites (as described in README.md) would unsucessfully attempt to start dumpcap for 10s before running each test: NOTE: unable to use dumpcap due to missing permissions in /tmp Warning: Named pipe already exists: /tmp/cmderr sudo -n /usr/bin/tcpdump -U -s 1520 -n -i any -w "/tmp/smdpp_Tests.TC_rsp_complete_flow.pcap" >/tmp/smdpp_Tests.TC_rsp_complete_flow.pcap.stdout 2>/tmp/cmderr & Waiting for packet dumper to start... 0 Waiting for packet dumper to start... 1 Waiting for packet dumper to start... 2 Waiting for packet dumper to start... 3 Waiting for packet dumper to start... 4 Waiting for packet dumper to start... 5 Waiting for packet dumper to start... 6 Waiting for packet dumper to start... 7 Waiting for packet dumper to start... 8 Waiting for packet dumper to start... 9 Packet dumper didn't start filling pcap file after 10 seconds!!! This happens because /tmp is owned by root and not by the user running ttcn3-tcpdump-start. Put the pcaps in /tmp/pcap by default instead of /tmp and create this directory as the current user if it does not exist. This also prevents cluttering /tmp. Note that this is only relevant when manually running the testsuites and not setting TTCN3_PCAP_PATH, e.g. testenv sets this variable already. Change-Id: I1eb80d7f9e8dd491387e4d1da9b4ac6ac5cb7dc5 --- M ttcn3-dumpcap-start.sh M ttcn3-tcpdump-start.sh 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/ttcn3-dumpcap-start.sh b/ttcn3-dumpcap-start.sh index ddd4eb4..4bdd3ec 100755 --- a/ttcn3-dumpcap-start.sh +++ b/ttcn3-dumpcap-start.sh @@ -19,7 +19,8 @@ date if [ "z$TTCN3_PCAP_PATH" = "z" ]; then - TTCN3_PCAP_PATH=/tmp + TTCN3_PCAP_PATH=/tmp/pcap + mkdir -p "$TTCN3_PCAP_PATH" fi kill_rm_pidfile $PIDFILE_NETCAT diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 2c2f8c5..4b5244c 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -24,7 +24,8 @@ date if [ "z$TTCN3_PCAP_PATH" = "z" ]; then - TTCN3_PCAP_PATH=/tmp + TTCN3_PCAP_PATH=/tmp/pcap + mkdir -p "$TTCN3_PCAP_PATH" fi kill_rm_pidfile $PIDFILE_NETCAT -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41204?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: I1eb80d7f9e8dd491387e4d1da9b4ac6ac5cb7dc5 Gerrit-Change-Number: 41204 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: ttcn3-tcpdump-start: fix default TTCN3_PCAP_PATH
by osmith 08 Oct '25

08 Oct '25
Attention is currently required from: dexter, jolly. osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41204?usp=email ) Change subject: ttcn3-tcpdump-start: fix default TTCN3_PCAP_PATH ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41204?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: I1eb80d7f9e8dd491387e4d1da9b4ac6ac5cb7dc5 Gerrit-Change-Number: 41204 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Oct 2025 12:03:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: track eNB connection, fail immediately on loss
by laforge 08 Oct '25

08 Oct '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41169?usp=email ) Change subject: s1gw: track eNB connection, fail immediately on loss ...................................................................... s1gw: track eNB connection, fail immediately on loss Change-Id: I34a3d30270f1236908643b60fc8abe590a780b89 --- M s1gw/S1GW_ConnHdlr.ttcn M s1gw/S1GW_Tests.ttcn 2 files changed, 29 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn index 4e47544..94c6d78 100644 --- a/s1gw/S1GW_ConnHdlr.ttcn +++ b/s1gw/S1GW_ConnHdlr.ttcn @@ -45,6 +45,7 @@ var ConnHdlrPars g_pars; port S1AP_CODEC_PT S1AP_ENB; var ConnectionId g_s1ap_conn_id := -1; + var default conn_track := null; }; type record of ConnHdlr ConnHdlrList; @@ -92,6 +93,25 @@ fn.apply(id); } +/* track eNB connection loss events */ +private altstep as_conn_track() runs on ConnHdlr { + [] S1AP_CONN.receive(S1APSRV_Event:S1APSRV_EVENT_CONN_DOWN) { + setverdict(fail, "eNB disconnected unexpectedly"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } +} + +function f_ConnHdlr_conn_track_enable() runs on ConnHdlr { + if (conn_track == null) { + conn_track := activate(as_conn_track()); + } +} + +function f_ConnHdlr_conn_track_disable() runs on ConnHdlr { + if (conn_track != null) { + deactivate(conn_track); + } +} function f_ConnHdlr_s1ap_connect(charstring local_addr, charstring remote_addr) runs on ConnHdlr { var Result res; @@ -110,6 +130,9 @@ } g_s1ap_conn_id := res.connId; + /* start tracking eNB connection */ + f_ConnHdlr_conn_track_enable(); + /* wait for the establishment confirmation */ T.start(2.0); alt { @@ -127,6 +150,9 @@ function f_ConnHdlr_s1ap_disconnect() runs on ConnHdlr { var Result res; + /* stop tracking eNB connection (teardown expected) */ + f_ConnHdlr_conn_track_disable(); + S1AP_CodecPort_CtrlFunct.f_IPL4_close(S1AP_ENB, g_s1ap_conn_id, { sctp := c_SctpTuple_S1AP }); g_s1ap_conn_id := -1; diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index 296c234..501f1be 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -343,6 +343,9 @@ f_ConnHdlr_s1ap_setup(g_pars.genb_id); f_sleep(0.5); /* keep the connection idle for some time */ + /* stop tracking eNB connection (teardown expected) */ + f_ConnHdlr_conn_track_disable(); + /* MME (S1AP_Server_CT) terminates connection */ f_ConnHdlr_s1ap_close_conn(g_pars.genb_id); /* expect our eNB connection to be released gracefully */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41169?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: I34a3d30270f1236908643b60fc8abe590a780b89 Gerrit-Change-Number: 41169 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: s1gw: implement the REST interface client
by laforge 08 Oct '25

08 Oct '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41125?usp=email ) Change subject: s1gw: implement the REST interface client ...................................................................... s1gw: implement the REST interface client OsmoS1GW implements a custom (non-standard) REST interface, primarily intended for state introspection. The interface is specified using OpenAPI, with the specification available in osmo-s1gw.git. Change-Id: Ic6e8b46b7de4fb72139b017fc9a9c83f92fc1541 Related: SYS#7066 --- M s1gw/S1GW_ConnHdlr.ttcn A s1gw/S1GW_REST_Functions.ttcn A s1gw/S1GW_REST_Types.ttcn M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.default M s1gw/S1GW_Tests.ttcn M s1gw/gen_links.sh M s1gw/regen_makefile.sh 8 files changed, 290 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn index 94c6d78..013d7bf 100644 --- a/s1gw/S1GW_ConnHdlr.ttcn +++ b/s1gw/S1GW_ConnHdlr.ttcn @@ -36,12 +36,15 @@ import from SCTP_Templates all; +import from HTTP_Adapter all; +import from HTTPmsg_Types all; + import from StatsD_Types all; import from StatsD_Checker all; import from S1AP_Server all; -type component ConnHdlr extends MutexCT, S1APSRV_ConnHdlr, PFCP_ConnHdlr, StatsD_ConnHdlr { +type component ConnHdlr extends MutexCT, S1APSRV_ConnHdlr, PFCP_ConnHdlr, StatsD_ConnHdlr, http_CT { var ConnHdlrPars g_pars; port S1AP_CODEC_PT S1AP_ENB; var ConnectionId g_s1ap_conn_id := -1; diff --git a/s1gw/S1GW_REST_Functions.ttcn b/s1gw/S1GW_REST_Functions.ttcn new file mode 100644 index 0000000..fb8731b --- /dev/null +++ b/s1gw/S1GW_REST_Functions.ttcn @@ -0,0 +1,94 @@ +/* REST interface API for OsmoS1GW + * + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> + * + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +module S1GW_REST_Functions { + +import from HTTP_Adapter all; +import from HTTPmsg_Types all; +import from S1GW_REST_Types all; + +/* Get a list of metrics */ +function f_REST_MetricsList(charstring metric_type := "all", + charstring path := "") +runs on http_CT return MetricsList { + var HTTPMessage rsp := f_http_transact("/metrics-list?type=" & metric_type & "&path=" & path); + return dec_MetricsList(char2oct(rsp.response.body)); +} + +/* Get the PFCP association state */ +function f_REST_PfcpAssocState() +runs on http_CT return PfcpAssocInfo { + var HTTPMessage rsp := f_http_transact("/pfcp/assoc", method := "GET"); + return dec_PfcpAssocInfo(char2oct(rsp.response.body)); +} + +/* Initiate the PFCP Association Setup procedure */ +function f_REST_PfcpAssocSetup() +runs on http_CT return OperationResult { + var HTTPMessage rsp := f_http_transact("/pfcp/assoc", method := "POST"); + return dec_OperationResult(char2oct(rsp.response.body)); +} + +/* Initiate the PFCP Association Release procedure */ +function f_REST_PfcpAssocRelease() +runs on http_CT return OperationResult { + var HTTPMessage rsp := f_http_transact("/pfcp/assoc", method := "DELETE"); + return dec_OperationResult(char2oct(rsp.response.body)); +} + +/* Send a PFCP Heartbeat Request to the peer */ +function f_REST_PfcpHeartbeat() +runs on http_CT return OperationResult { + var HTTPMessage rsp := f_http_transact("/pfcp/heartbeat", method := "POST"); + return dec_OperationResult(char2oct(rsp.response.body)); +} + +/* Get a list of eNB connections */ +function f_REST_EnbList() +runs on http_CT return EnbList { + var HTTPMessage rsp := f_http_transact("/enb-list", method := "GET"); + return dec_EnbList(char2oct(rsp.response.body)); +} + +/* Get information about a specific eNB */ +function f_REST_EnbInfo(ParamEnbId enb_id) +runs on http_CT return EnbItem { + var charstring p_enb_id := enc_ParamEnbId(enb_id); + var HTTPMessage rsp := f_http_transact("/enb/" & p_enb_id, method := "GET"); + return dec_EnbItem(char2oct(rsp.response.body)); +} + +/* Get E-RAB list for a specific eNB */ +function f_REST_EnbErabList(ParamEnbId enb_id) +runs on http_CT return ErabList { + var charstring p_enb_id := enc_ParamEnbId(enb_id); + var HTTPMessage rsp := f_http_transact("/enb/" & p_enb_id & "/erab-list", method := "GET"); + return dec_ErabList(char2oct(rsp.response.body)); +} + +/* Get E-RAB list for all eNBs */ +function f_REST_ErabList() +runs on http_CT return ErabList { + var HTTPMessage rsp := f_http_transact("/erab-list", method := "GET"); + return dec_ErabList(char2oct(rsp.response.body)); +} + +/* Get information about a specific E-RAB */ +function f_REST_ErabInfo(ParamErabId erab_id) +runs on http_CT return ErabItem { + var charstring p_erab_id := enc_ParamErabId(erab_id); + var HTTPMessage rsp := f_http_transact("/erab/" & p_erab_id, method := "GET"); + return dec_ErabItem(char2oct(rsp.response.body)); +} + +} diff --git a/s1gw/S1GW_REST_Types.ttcn b/s1gw/S1GW_REST_Types.ttcn new file mode 100644 index 0000000..8ddbc20 --- /dev/null +++ b/s1gw/S1GW_REST_Types.ttcn @@ -0,0 +1,135 @@ +/* REST interface definitions for OsmoS1GW + * + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> + * + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +module S1GW_REST_Types { + +type charstring GlobalEnbId (pattern "[0-9]#3-[0-9]#(2,3)-[0-9]+"); +type charstring Pid (pattern "<[0-9]+.[0-9]+.[0-9]+>"); + +type integer EnbHandle (0..infinity); +type integer SEID (0..18446744073709551615); +type integer TEID (0..4294967295); +type integer Port (0..65535); + +type union ParamEnbId { + charstring handle (pattern "handle:[0-9]+"), + charstring pid (pattern "pid:[0-9]+.[0-9]+.[0-9]+"), + charstring genbid (pattern "genbid:[0-9]#3-[0-9]#(2,3)-[0-9]+"), + charstring sctp_aid (pattern "(enb|mme)-sctp-aid:[0-9]+"), + charstring enb_conn (pattern "enb-conn:[0-9:.]+-[0-9]+") +} with { encode "TEXT" }; + +type union ParamErabId { + charstring pid (pattern "pid:[0-9]+.[0-9]+.[0-9]+") +} with { encode "TEXT" }; + +type set OperationResult { + boolean success, + charstring msg optional +} with { + variant(msg) "JSON:name as message"; +}; + +type set of MetricsItem MetricsList; +type set MetricsItem { + MetricType metric_type, + charstring metric_name, + integer metric_value +} with { + variant(metric_type) "JSON:name as type"; + variant(metric_name) "JSON:name as name"; + variant(metric_value) "JSON:name as value"; +}; + +type enumerated MetricType { + counter, + gauge +}; + +type set PfcpAssocInfo { + PfcpAssocState state, /* Current association state */ + charstring laddr, /* Local (bind) IP address */ + charstring raddr, /* Remote (connect) IP address */ + integer lrts optional, /* Local Recovery TimeStamp */ + integer rrts optional /* Remote Recovery TimeStamp */ +}; + +type enumerated PfcpAssocState { + connecting, + connected +}; + +type set of EnbItem EnbList; +type set EnbItem { + EnbHandle handle, /* Unique number in the eNB registry */ + Pid pid, /* Process ID */ + EnbState state, /* Connection state */ + integer uptime, /* Uptime (in seconds) */ + integer erab_count, /* Total number of E-RABs */ + GlobalEnbId genb_id optional, /* Global-eNB-ID (e.g. "001-01-1337") */ + charstring enb_saddr optional, /* Source (remote) address of the eNB */ + charstring mme_daddr optional, /* Destination (remote) address of the MME */ + Port enb_sport optional, /* Source (remote) port of the eNB-S1GW connection */ + Port mme_sport optional, /* Source (local) port of the S1GW-MME connection */ + Port mme_dport optional, /* Destination (remote) port of the S1GW-MME connection */ + integer enb_sctp_aid optional, /* SCTP association identifier of the eNB-S1GW connection */ + integer mme_sctp_aid optional /* SCTP association identifier of the eNB-S1GW connection */ +}; + +type enumerated EnbState { + connecting, + connected, + s1setup +}; + +type set of ErabItem ErabList; +type set ErabItem { + integer mme_ue_id, /* MME-UE-S1AP-ID */ + integer erab_id, /* E-RAB-ID */ + charstring state, /* E-RAB FSM state */ + Pid pid, /* E-RAB FSM process ID */ + SEID pfcp_lseid optional, /* PFCP SEID (local) */ + SEID pfcp_rseid optional, /* PFCP SEID (remote) */ + FTEID f_teid_u2c optional, /* GTP-U F-TEID for UPF -> Core */ + FTEID f_teid_c2u optional, /* GTP-U F-TEID for UPF <- Core */ + FTEID f_teid_a2u optional, /* GTP-U F-TEID for UPF <- Access */ + FTEID f_teid_u2a optional /* GTP-U F-TEID for UPF -> Access */ + +}; + +type set FTEID { + TEID teid, /* GTP-U TEID */ + charstring tla /* GTP-U TLA (Transport Layer Address) */ +}; + +external function enc_ParamEnbId(in ParamEnbId enb_id) return charstring + with { extension "prototype(convert) encode(TEXT)" } +external function enc_ParamErabId(in ParamErabId erab_id) return charstring + with { extension "prototype(convert) encode(TEXT)" } + +external function dec_OperationResult(in octetstring data) return OperationResult + with { extension "prototype(convert) decode(JSON)" } +external function dec_MetricsList(in octetstring data) return MetricsList + with { extension "prototype(convert) decode(JSON)" } +external function dec_PfcpAssocInfo(in octetstring data) return PfcpAssocInfo + with { extension "prototype(convert) decode(JSON)" } +external function dec_EnbList(in octetstring data) return EnbList + with { extension "prototype(convert) decode(JSON)" } +external function dec_EnbItem(in octetstring data) return EnbItem + with { extension "prototype(convert) decode(JSON)" } +external function dec_ErabList(in octetstring data) return ErabList + with { extension "prototype(convert) decode(JSON)" } +external function dec_ErabItem(in octetstring data) return ErabItem + with { extension "prototype(convert) decode(JSON)" } + +} with { encode "JSON" } diff --git a/s1gw/S1GW_Tests.cfg b/s1gw/S1GW_Tests.cfg index 54e7992..69e893f 100644 --- a/s1gw/S1GW_Tests.cfg +++ b/s1gw/S1GW_Tests.cfg @@ -19,6 +19,9 @@ S1GW_Tests.mp_upf_bind_ip := "127.0.3.10"; S1GW_Tests.mp_local_statsd_ip := "127.0.4.10"; S1GW_Tests.mp_local_statsd_port := 8125; +S1GW_Tests.mp_rest_host := "127.0.0.1"; +S1GW_Tests.mp_rest_port := 8125; +S1GW_Tests.mp_rest_enable := false; [MAIN_CONTROLLER] diff --git a/s1gw/S1GW_Tests.default b/s1gw/S1GW_Tests.default index 8f9cfdc..48169e1 100644 --- a/s1gw/S1GW_Tests.default +++ b/s1gw/S1GW_Tests.default @@ -5,6 +5,7 @@ [TESTPORT_PARAMETERS] *.S1AP_ENB.noDelay := "yes" // eNB: turn off Nagle *.S1AP.noDelay := "yes" // MME: turn off Nagle +*.HTTP.use_notification_ASPs := "yes" [MODULE_PARAMETERS] diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index 501f1be..cd64d21 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -41,10 +41,16 @@ import from StatsD_CodecPort_CtrlFunct all; import from StatsD_Checker all; +import from HTTP_Adapter all; +import from HTTPmsg_Types all; + import from S1AP_Server all; import from S1GW_ConnHdlr all; import from S1GW_UEMux all; +import from S1GW_REST_Types all; +import from S1GW_REST_Functions all; + modulepar { charstring mp_s1gw_enb_ip := "127.0.1.1"; /* eNB facing address of the S1GW */ charstring mp_enb_bind_ip := "127.0.1.10"; /* eNB address to use locally when connecting to S1GW */ @@ -60,9 +66,13 @@ integer mp_multi_enb_num := 42; /* number of eNBs in _multi TCs */ integer mp_multi_ue_num := 128; /* number of UEs in _multi TCs */ + + boolean mp_rest_enable := false; /* whether enable the HTTP/REST interface */ + charstring mp_rest_host := "127.0.0.1"; + integer mp_rest_port := 8080; } -type component test_CT extends StatsD_Checker_CT { +type component test_CT extends StatsD_Checker_CT, http_CT { timer g_Tguard; var MutexDispCT vc_mutex_disp; var S1AP_Server_CT vc_S1APSRV; @@ -93,6 +103,9 @@ f_init_pfcp(); f_pfcp_assoc(); } + if (mp_rest_enable) { + f_init_rest(); + } } function f_init_s1ap_srv() runs on test_CT { @@ -131,6 +144,16 @@ } } +function f_init_rest() runs on test_CT { + f_http_init(valueof(t_HTTP_Adapter_Params)); +} + +template (value) HTTP_Adapter_Params t_HTTP_Adapter_Params := { + http_host := mp_rest_host, + http_port := mp_rest_port, + use_ssl := false +} + template (value) ConnHdlrPars t_ConnHdlrPars(integer idx := 0, integer num_erabs := 1, @@ -193,6 +216,14 @@ vc_conn := ConnHdlr.create(id) alive; f_ConnHdlr_connect(vc_conn); + + if (mp_rest_enable) { + /* Init the HTTP client (M2M/REST interface) */ + vc_conn.start(f_http_init(valueof(t_HTTP_Adapter_Params))); + vc_conn.done; + } + + /* run the actual testcase logic */ vc_conn.start(f_ConnHdlr_init(fn, id, pars)); return vc_conn; diff --git a/s1gw/gen_links.sh b/s1gw/gen_links.sh index 6328ab8..58a3e57 100755 --- a/s1gw/gen_links.sh +++ b/s1gw/gen_links.sh @@ -21,6 +21,22 @@ FILES="PFCP_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.Common_Components.Abstract_Socket/src +FILES="Abstract_Socket.cc Abstract_Socket.hh " +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.HTTPmsg/src +FILES="HTTPmsg_MessageLen.ttcn HTTPmsg_MessageLen_Function.cc HTTPmsg_PT.cc HTTPmsg_PT.hh HTTPmsg_PortType.ttcn HTTPmsg_Types.ttcn " +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolModules.JSON_v07_2006/src +FILES="JSON_EncDec.cc JSON_Types.ttcn " +gen_links $DIR $FILES + DIR=../library/s1ap FILES="S1AP_CommonDataTypes.asn S1AP_Constants.asn S1AP_Containers.asn S1AP_IEs.asn " FILES+="S1AP_PDU_Contents.asn S1AP_PDU_Descriptions.asn " @@ -33,6 +49,7 @@ FILES+="S1AP_CodecPort.ttcn S1AP_CodecPort_CtrlFunctDef.cc S1AP_CodecPort_CtrlFunct.ttcn S1AP_Functions.ttcn " FILES+="SCTP_Templates.ttcn " FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcnpp " +FILES+="HTTP_Adapter.ttcn " gen_links $DIR $FILES gen_links_finish diff --git a/s1gw/regen_makefile.sh b/s1gw/regen_makefile.sh index 3c48af2..cc7e2bb 100755 --- a/s1gw/regen_makefile.sh +++ b/s1gw/regen_makefile.sh @@ -6,8 +6,12 @@ *.asn *.ttcn *.ttcnpp + Abstract_Socket.cc + HTTPmsg_MessageLen_Function.cc + HTTPmsg_PT.cc IPL4asp_PT.cc IPL4asp_discovery.cc + JSON_EncDec.cc Native_FunctionDefs.cc PFCP_CodecPort_CtrlFunctDef.cc S1AP_CodecPort_CtrlFunctDef.cc -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41125?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: Ic6e8b46b7de4fb72139b017fc9a9c83f92fc1541 Gerrit-Change-Number: 41125 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: s1gw: implement the REST interface client
by laforge 08 Oct '25

08 Oct '25
Attention is currently required from: fixeria. laforge has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41125?usp=email ) Change subject: s1gw: implement the REST interface client ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41125?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: Ic6e8b46b7de4fb72139b017fc9a9c83f92fc1541 Gerrit-Change-Number: 41125 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Oct 2025 12:00:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: track eNB connection, fail immediately on loss
by laforge 08 Oct '25

08 Oct '25
Attention is currently required from: fixeria. laforge has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41169?usp=email ) Change subject: s1gw: track eNB connection, fail immediately on loss ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41169?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: I34a3d30270f1236908643b60fc8abe590a780b89 Gerrit-Change-Number: 41169 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Oct 2025 12:00:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • ...
  • 64
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.