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

March 2026

  • 1 participants
  • 1933 discussions
[S] Change in ...osmo-s1gw[master]: doc/manuals: update MmeItem related info
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42369?usp=email ) Change subject: doc/manuals: update MmeItem related info ...................................................................... doc/manuals: update MmeItem related info The osmo-s1gw-cli documentation was not properly updated in 63ce2c9: * default local/bind address for an MME is "any", not "::" * allowed TACs (--tac) was missing in help and examples Change-Id: I0b8115fe6342a80bf1eb99bd6ad210492a013947 Fixes: 63ce2c9 ("[REST] Add MmeList, MmeAdd, MmeInfo, MmeDelete") Related: OS#6671 --- M doc/manuals/chapters/cli.adoc M doc/manuals/chapters/rest.adoc 2 files changed, 15 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/69/42369/1 diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc index b1562c0..984ad14 100644 --- a/doc/manuals/chapters/cli.adoc +++ b/doc/manuals/chapters/cli.adoc @@ -135,11 +135,11 @@ ---- OsmoS1GW# mme_list -| Name | Local address | Remote address/port | -|--------|-----------------|-----------------------| -| mme0 | :: | 127.0.2.10:36412 | -| mme1 | :: | 127.0.2.20:36412 | -| mme2 | :: | 127.0.2.30:36412 | +| Name | Local address | Remote address/port | Allowed TACs | +|--------|-----------------|-----------------------|----------------| +| mme0 | 127.0.2.1 | 127.0.2.10:36412 | all | +| mme1 | 127.0.2.1 | 127.0.2.11:36412 | all | +| mme2 | 127.0.2.1 | 127.0.2.12:36412 | all | ---- ==== `mme_add` @@ -147,15 +147,18 @@ Add an MME to the pool. ---- -Usage: mme_add -N NAME -ra RADDR [-la LADDR] [-rp RPORT] +Usage: mme_add -N NAME -ra RADDR [-h] [-la LADDR] [-rp RPORT] [--tac TAC_LIST] + +Add an MME to the pool required arguments: -N, --name NAME MME name (example: mme0) -ra, --raddr RADDR Remote address (example: 192.168.1.101) optional arguments: - -la, --laddr LADDR Local address (default: ::) + -la, --laddr LADDR Local address (default: any) -rp, --rport RPORT Remote port (default: 36412) + --tac TAC_LIST Allowed TAC (Tracking Area Code) ---- Example: @@ -182,8 +185,9 @@ | Parameter | Value | |---------------------|------------------| | Name | mme0 | -| Local address | :: | +| Local address | any | | Remote address/port | 127.0.2.10:36412 | +| Allowed TACs | all | ---- ==== `mme_delete` diff --git a/doc/manuals/chapters/rest.adoc b/doc/manuals/chapters/rest.adoc index 938421d..57342ef 100644 --- a/doc/manuals/chapters/rest.adoc +++ b/doc/manuals/chapters/rest.adoc @@ -135,8 +135,8 @@ ---- [ - {"name": "mme0", "laddr": "::", "raddr": "192.168.2.10", "rport": 36412, "tac_list": []}, - {"name": "mme1", "laddr": "::", "raddr": "192.168.2.20", "rport": 36412, "tac_list": [100, 101]} + {"name": "mme0", "laddr": "any", "raddr": "192.168.2.10", "rport": 36412, "tac_list": []}, + {"name": "mme1", "laddr": "any", "raddr": "192.168.2.20", "rport": 36412, "tac_list": [100, 101]} ] ---- @@ -148,7 +148,7 @@ `name` (required):: Unique human-readable name. `raddr` (required):: Remote IP address of the MME. -`laddr` (optional):: Local bind address. Default: `"::"` (any). +`laddr` (optional):: Local bind address. Default: `"any"`. `rport` (optional):: Remote SCTP port. Default: `36412`. `tac_list` (optional):: List of TACs this MME serves. Default: `[]` (all). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42369?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I0b8115fe6342a80bf1eb99bd6ad210492a013947 Gerrit-Change-Number: 42369 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[L] Change in ...osmo-s1gw[master]: doc/manuals: merge doc/osmo-s1gw-cli.md
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42368?usp=email ) Change subject: doc/manuals: merge doc/osmo-s1gw-cli.md ...................................................................... doc/manuals: merge doc/osmo-s1gw-cli.md Change-Id: Ic2556f6add9c6a24f6da03f4388d7f86dde0c5dc Related: OS#6671 --- M README.md A doc/manuals/chapters/cli.adoc M doc/manuals/chapters/configuration.adoc M doc/manuals/chapters/rest.adoc M doc/manuals/chapters/running.adoc M doc/manuals/osmo-s1gw-usermanual.adoc D doc/osmo-s1gw-cli.md 7 files changed, 356 insertions(+), 540 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/68/42368/1 diff --git a/README.md b/README.md index d6a5299..a999f38 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,9 @@ Interactive CLI --------------- -OsmoS1GW comes with [`osmo-s1gw-cli.py`](contrib/osmo-s1gw-cli.py) - an interactive -shell based on Python's **cmd2** library. This script serves as an alternative to the -traditional telnet/VTY interface found in many Osmocom projects. For more details, -see the respective [documentation](doc/osmo-s1gw-cli.md). +OsmoS1GW comes with [`osmo-s1gw-cli.py`](contrib/osmo-s1gw-cli.py) — an interactive +shell based on Python's **cmd2** library. It serves the same purpose as the +telnet/VTY interface found in many other Osmocom projects, providing tab-completion, +output filtering, and redirection as a convenient alternative to raw HTTP requests. +For full usage and command reference, see the CLI chapter in the user manual +([`doc/manuals/chapters/cli.adoc`](doc/manuals/chapters/cli.adoc)). diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc new file mode 100644 index 0000000..b1562c0 --- /dev/null +++ b/doc/manuals/chapters/cli.adoc @@ -0,0 +1,341 @@ +[[cli]] +== Interactive CLI (`osmo-s1gw-cli`) + +`osmo-s1gw-cli` is an interactive command-line shell built on Python's +https://cmd2.readthedocs.io/[cmd2] library. It provides a convenient +alternative to issuing raw HTTP requests, with tab-completion, filtering +(`CMD | grep ...`), and output redirection (`CMD > FILE`). + +[[cli_installation]] +=== Installation + +`osmo-s1gw-cli` requires the following Python packages: + +* https://pypi.org/project/cmd2/[cmd2] +* https://pypi.org/project/tabulate/[tabulate] + +Install via pip: + +---- +pip install cmd2 tabulate +---- + +Or via the system package manager (Debian/Ubuntu): + +---- +sudo apt install python3-cmd2 python3-tabulate +---- + +After `make install` (see <<running_building_installation>>), the CLI is available +system-wide as `osmo-s1gw-cli`. + +[[cli_usage]] +=== Usage + +---- +osmo-s1gw-cli [-h] [-v] [-p PORT] [HOST] + + HOST OsmoS1GW REST host/address (default: localhost) + -p REST port (default: 8080) + -v Enable verbose/debug logging +---- + +Once inside the shell, available commands can be listed with `help -v` +and per-command help is accessible with `help <command>`. In addition +to tab-completion, output can be filtered (`CMD | grep ...`) or +redirected to a file (`CMD > FILE`). + +[[cli_commands]] +=== Commands + +==== `fetch_openapi_spec` + +Fetch the OpenAPI specification (JSON) from the server and display it. + +==== `metrics_list` + +Get a list of metrics, optionally filtered by type and/or name path. + +---- +Usage: metrics_list [-h] [-t {all,counter,gauge}] [PATH] + +positional arguments: + PATH Metric path prefix (dot-separated) + +optional arguments: + -t, --type {all,counter,gauge} + Metric type (default: all) +---- + +Example: obtaining PFCP association metrics. + +---- +OsmoS1GW# metrics_list pfcp.assoc +| Name | Type | Value | +|-------------------------------|---------|---------| +| pfcp.assoc_setup_req.timeout | counter | 21 | +| pfcp.assoc_setup_req.tx | counter | 22 | +| pfcp.assoc_setup_resp.rx | counter | 0 | +| pfcp.assoc_setup_resp.rx_ack | counter | 0 | +| pfcp.assoc_setup_resp.rx_nack | counter | 0 | +| pfcp.associated | gauge | 0 | +---- + +Example: listing all gauge metrics. + +---- +OsmoS1GW# metrics_list --type gauge +| Name | Type | Value | +|-------------------------------|--------|---------| +| pfcp.associated | gauge | 0 | +| s1ap.enb.num_sctp_connections | gauge | 0 | +---- + +==== `pfcp_assoc_state` + +Display the current PFCP association state. + +---- +OsmoS1GW# pfcp_assoc_state +| Parameter | Value | +|---------------------------|------------| +| State | connected | +| Local address | 127.0.3.1 | +| Remote address | 127.0.3.10 | +| Local Recovery TimeStamp | 3967211233 | +| Remote Recovery TimeStamp | 3965211123 | +---- + +==== `pfcp_heartbeat` + +Send a PFCP Heartbeat Request to the UPF and display the result. + +---- +OsmoS1GW# pfcp_heartbeat +Heartbeat succeeded + +OsmoS1GW# pfcp_heartbeat +Heartbeat failed: timeout +---- + +==== `mme_list` + +List the MMEs currently registered in the pool. + +---- +Usage: mme_list [-h] [-S {none,name,laddr,raddr}] [--reverse] + +optional arguments: + -S, --sort-by {none,name,laddr,raddr} + Sort by (default: none) + --reverse Reverse sort order +---- + +Example: + +---- +OsmoS1GW# mme_list +| Name | Local address | Remote address/port | +|--------|-----------------|-----------------------| +| mme0 | :: | 127.0.2.10:36412 | +| mme1 | :: | 127.0.2.20:36412 | +| mme2 | :: | 127.0.2.30:36412 | +---- + +==== `mme_add` + +Add an MME to the pool. + +---- +Usage: mme_add -N NAME -ra RADDR [-la LADDR] [-rp RPORT] + +required arguments: + -N, --name NAME MME name (example: mme0) + -ra, --raddr RADDR Remote address (example: 192.168.1.101) + +optional arguments: + -la, --laddr LADDR Local address (default: ::) + -rp, --rport RPORT Remote port (default: 36412) +---- + +Example: + +---- +OsmoS1GW# mme_add --name mme42 --raddr 192.168.1.101 +---- + +==== `mme_info` + +Show configuration details for a specific MME, selected by name. + +---- +Usage: mme_info [-h] -N NAME + +MME ID: + -N, --name NAME MME name (example: mme0) +---- + +Example: + +---- +OsmoS1GW# mme_info --name mme0 +| Parameter | Value | +|---------------------|------------------| +| Name | mme0 | +| Local address | :: | +| Remote address/port | 127.0.2.10:36412 | +---- + +==== `mme_delete` + +Remove an MME from the pool, selected by name. + +---- +Usage: mme_delete [-h] -N NAME + +MME ID: + -N, --name NAME MME name (example: mme0) +---- + +Example: + +---- +OsmoS1GW# mme_delete --name mme0 +---- + +==== `enb_list` + +List all currently connected eNBs. + +---- +Usage: enb_list [-h] [-S {handle,pid,state,genb_id,uptime}] [--reverse] + +optional arguments: + -S, --sort-by {handle,pid,state,genb_id,uptime} + Sort by (default: handle) + --reverse Reverse sort order +---- + +Example: + +---- +OsmoS1GW# enb_list +| handle | PID | Global-eNB-ID | State | eNB addr:port (aid) | MME addr:port (aid) | Uptime | E-RABs | +|----------|-----------|---------------|-----------|-------------------------|-------------------------|----------|----------| +| 0 | <0.699.0> | 001-01-0 | connected | 127.0.1.10:56767 (5706) | 127.0.2.10:36412 (5707) | 418 | 0 | +| 1 | <0.701.0> | 001-01-1 | connected | 127.0.1.10:54140 (5710) | 127.0.2.10:36412 (5711) | 33 | 3 | +| 2 | <0.703.0> | 001-01-2 | connected | 127.0.1.10:34076 (5714) | 127.0.2.10:36412 (5715) | 3600 | 20 | +---- + +==== `enb_info` + +Show details for a specific eNB. The eNB can be identified by any of +the following selectors: + +---- +Usage: enb_info [-h] (-H HANDLE | -P PID | -G GENBID | + --enb-sctp-aid AID | --mme-sctp-aid AID) + +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 SCTP association identifier + --mme-sctp-aid AID MME SCTP association identifier +---- + +Example: selecting by handle. + +---- +OsmoS1GW# enb_info -H 8 +| Parameter | Value | +|---------------------|-------------------------| +| eNB handle | 8 | +| PID | <0.715.0> | +| Global-eNB-ID | 001-01-8 | +| State | connected | +| eNB addr:port (aid) | 127.0.1.10:57362 (5734) | +| MME addr:port (aid) | 127.0.2.10:36412 (5745) | +| Uptime (s) | 521 | +| # E-RABs | 99 | +---- + +==== `enb_delete` + +Force-disconnect an eNB, terminating its SCTP connection. The same +selectors as `enb_info` are accepted. + +==== `enb_erab_list` + +List the E-RABs associated with a specific eNB. + +---- +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) + +optional arguments: + -f, --full Print full table including PFCP and GTP-U F-TEID columns + -S, --sort-by {pid,state,mme_ue_id,erab_id} + Sort by (default: pid) + --reverse Reverse sort order +---- + +Example: + +---- +OsmoS1GW# enb_erab_list -G 001-01-0 +| PID | MME-UE-S1AP-ID | E-RAB-ID | State | +|-----------|------------------|------------|------------| +| <0.707.0> | 4242 | 0 | erab_setup | +| <0.708.0> | 4242 | 1 | erab_setup | +| <0.709.0> | 4242 | 2 | erab_setup | +---- + +==== `erab_list` + +List all E-RABs across all connected eNBs. Accepts the same `-f`, +`--sort-by`, and `--reverse` options as `enb_erab_list`. + +==== `erab_info` + +Show details for a specific E-RAB, identified by its process ID. + +---- +Usage: erab_info -P PID + +required arguments: + -P, --pid PID E-RAB process ID (example: 0.33.1) +---- + +Example: + +---- +OsmoS1GW# erab_info -P 0.714.0 +| Parameter | Value | +|----------------|----------------------| +| PID | <0.714.0> | +| MME-UE-S1AP-ID | 4242 | +| E-RAB-ID | 1 | +| State | erab_setup | +| SEID (local) | 0x0000000000000002 | +| SEID (remote) | 0x5454434e2d330001 | +| U2C F-TEID | 0x00010001(a)127.0.0.1 | +| C2U F-TEID | 0x01010001(a)127.0.1.1 | +| A2U F-TEID | 0x02020001(a)127.0.2.2 | +| U2A F-TEID | 0x00020001(a)127.0.0.2 | +---- + +==== `erab_delete` + +Terminate an E-RAB FSM process, triggering PFCP Session Deletion. + +---- +Usage: erab_delete -P PID + +required arguments: + -P, --pid PID E-RAB process ID (example: 0.33.1) +---- + +// vim:set ts=4 sw=4 et: diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index dc738a4..1a4d284 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -207,6 +207,9 @@ Whether to serve the Swagger UI at `http://host:rest_srv_port/swagger`. Default: `true`. +For the full REST API reference see <<rest>>. For the interactive CLI +tool that wraps the REST API see <<cli>>. + [[config_kernel]] === `kernel` — Logging diff --git a/doc/manuals/chapters/rest.adoc b/doc/manuals/chapters/rest.adoc index e1fb324..938421d 100644 --- a/doc/manuals/chapters/rest.adoc +++ b/doc/manuals/chapters/rest.adoc @@ -4,7 +4,9 @@ OsmoS1GW exposes an HTTP REST API for monitoring and management. The API follows the OpenAPI 3.0 specification; the full machine-readable spec is served at `GET /openapi.json`. A Swagger UI is available at -`/swagger` when enabled (see <<config_rest>>). +`/swagger` when enabled (see <<config_rest>>). An interactive CLI tool +(`osmo-s1gw-cli`) is also available as a convenient alternative to +issuing raw HTTP requests — see <<cli>>. By default the REST server listens on port `8080`. No authentication is implemented; access control should be enforced at the network level if @@ -285,48 +287,4 @@ live connections. Returns HTTP 200 on success, HTTP 404 if no matching E-RAB is found. - -[[rest_cli]] -=== Interactive CLI (`osmo-s1gw-cli`) - -`osmo-s1gw-cli` is an interactive command-line shell built on Python's -https://cmd2.readthedocs.io/[cmd2] library. It provides a convenient -alternative to issuing raw HTTP requests, with tab-completion, filtering -(`CMD | grep ...`), and output redirection (`CMD > FILE`). - -After installation, the CLI is available as `osmo-s1gw-cli`. It -communicates with OsmoS1GW via the REST interface. - ----- -osmo-s1gw-cli [-h] [-v] [-p PORT] [HOST] - - HOST OsmoS1GW REST host/address (default: localhost) - -p REST port (default: 8080) - -v Enable verbose/debug logging ----- - -Available commands can be listed within the shell using `help -v`, and -per-command help is available with `help <command>`. The following -commands are supported: - -[options="header",cols="30,70"] -|=== -| Command | Description -| `fetch_openapi_spec` | Fetch and display the OpenAPI specification -| `metrics_list` | List metrics, optionally filtered by type and/or name path -| `pfcp_assoc_state` | Display the PFCP association state -| `pfcp_heartbeat` | Send a PFCP Heartbeat Request -| `mme_list` | List registered MMEs -| `mme_add` | Add an MME to the pool -| `mme_info` | Show details for a specific MME -| `mme_delete` | Remove an MME from the pool -| `enb_list` | List connected eNBs -| `enb_info` | Show details for a specific eNB -| `enb_delete` | Force-disconnect an eNB -| `enb_erab_list` | List E-RABs for a specific eNB -| `erab_list` | List all E-RABs across all eNBs -| `erab_info` | Show details for a specific E-RAB -| `erab_delete` | Terminate an E-RAB FSM process -|=== - // vim:set ts=4 sw=4 et: diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index 743456f..7f06ab3 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -114,7 +114,7 @@ * Installs the `osmo-s1gw.sh` bootstrap script (see <<running_bootstrap_script>>) as `$(BINDIR)/osmo-s1gw` (default: `/usr/bin/osmo-s1gw`). -* Installs the `osmo-s1gw-cli.py` management CLI as +* Installs the `osmo-s1gw-cli.py` management CLI (see <<cli>>) as `$(BINDIR)/osmo-s1gw-cli` (default: `/usr/bin/osmo-s1gw-cli`). * Installs the example `config/sys.config` as `$(CONFDIR)/osmo-s1gw.config` (default: `/etc/osmocom/osmo-s1gw.config`). diff --git a/doc/manuals/osmo-s1gw-usermanual.adoc b/doc/manuals/osmo-s1gw-usermanual.adoc index c565911..03003d1 100644 --- a/doc/manuals/osmo-s1gw-usermanual.adoc +++ b/doc/manuals/osmo-s1gw-usermanual.adoc @@ -19,6 +19,8 @@ include::{srcdir}/chapters/gtpu_kpi.adoc[] +include::{srcdir}/chapters/cli.adoc[] + include::{srcdir}/chapters/rest.adoc[] include::{commondir}/chapters/glossary.adoc[] diff --git a/doc/osmo-s1gw-cli.md b/doc/osmo-s1gw-cli.md deleted file mode 100644 index d50659e..0000000 --- a/doc/osmo-s1gw-cli.md +++ /dev/null @@ -1,490 +0,0 @@ -Interactive CLI -=============== - -[`osmo-s1gw-cli.py`](../contrib/osmo-s1gw-cli.py) is an interactive shell based on -Python's **cmd2** library. This script serves as an alternative to the traditional -telnet/VTY interface found in many Osmocom projects. It communicates with the main -process via the **REST interface**, allowing users to inspect and interact with -OsmoS1GW in a familiar CLI style. - -Installation ------------- - -`osmo-s1gw-cli.py` has the following dependencies: - -* [`cmd2`](https://pypi.org/project/cmd2/) -* [`tabulate`](https://pypi.org/project/tabulate/) - -You can install them using **pip**: - -```bash -pip install cmd2 tabulate -``` - -Or using your system's package manager (Debian/Ubuntu example): - -```bash -sudo apt install python3-cmd2 python3-tabulate -``` - -Usage ------ - -By default, `osmo-s1gw-cli.py` is sending HTTP requests to `http://localhost:8080`. -The hostname/address and port can be specified using command-line arguments: - -```bash -./contrib/osmo-s1gw-cli.py --help -usage: osmo-s1gw-cli [-h] [-v] [-p PORT] [HOST] - -Interactive CLI for OsmoS1GW - -positional arguments: - HOST OsmoS1GW REST host/address (default: localhost) - -options: - -h, --help show this help message and exit - -v, --verbose print debug logging - -p, --port PORT OsmoS1GW REST port (default: 8080) -``` - -Available commands can be listed by entering `help -v`: - -``` -Welcome to Interactive CLI for OsmoS1GW! -OsmoS1GW# help -v -... -``` - -Each command has its own detailed help, accessible with `help CMD`: - -``` -OsmoS1GW# help quit -Usage: quit [-h] - -Exit this application - -optional arguments: - -h, --help show this help message and exit -``` - -In addition to tab-completion, you can filter (`CMD | grep ...`) and/or -redirect (`CMD > FILE`) output of a command to a file. For more details -on the available features and usage patterns, please refer to the -[cmd2 documentation](https://cmd2.readthedocs.io/en/stable/features/). - -Commands --------- - -Below is a list of currently supported commands and some examples. - -### `fetch_openapi_spec` - -Fetch the OpenAPI specification (JSON), dump as text. - -### `metrics_list` - -Get a list of metrics. - -``` -Usage: metrics_list [-h] [-t {all, counter, gauge}] [PATH] - -Get a list of metrics - -positional arguments: - PATH Metric path - -optional arguments: - -h, --help show this help message and exit - -t, --type {all, counter, gauge} - Metric type (default: all) -``` - -Example: Obtaining PFCP association related metrics. - -``` -OsmoS1GW# metrics_list pfcp.assoc -| Name | Type | Value | -|-------------------------------|---------|---------| -| pfcp.assoc_setup_req.timeout | counter | 21 | -| pfcp.assoc_setup_req.tx | counter | 22 | -| pfcp.assoc_setup_resp.rx | counter | 0 | -| pfcp.assoc_setup_resp.rx_ack | counter | 0 | -| pfcp.assoc_setup_resp.rx_nack | counter | 0 | -| pfcp.associated | gauge | 0 | -``` - -Example: Obtaining all gauges. - -``` -OsmoS1GW# metrics_list --type gauge -| Name | Type | Value | -|----------------------------------|--------|---------| -| pfcp.associated | gauge | 0 | -| s1ap.enb.num_sctp_connections | gauge | 0 | -| s1ap.proxy.uplink_packets_queued | gauge | 0 | -``` - -### `pfcp_assoc_state` - -Get the PFCP association state. - -``` -| Parameter | Value | -|---------------------------|------------| -| State | connected | -| Local address | 127.0.3.1 | -| Remote address | 127.0.3.10 | -| Local Recovery TimeStamp | 3967211233 | -| Remote Recovery TimeStamp | 3965211123 | -``` - -### `pfcp_heartbeat` - -Send a PFCP Heartbeat Request. - -``` -OsmoS1GW# pfcp_heartbeat -Heartbeat succeeded - -OsmoS1GW# pfcp_heartbeat -Heartbeat failed: timeout -``` - -### `mme_list` - -Get a list of registered MMEs. - -``` -Usage: mme_list [-h] [-S {none, name, laddr, raddr}] [--reverse] - -Get a list of registered MMEs - -optional arguments: - -h, --help show this help message and exit - -Sorting options: - -S, --sort-by {none, name, laddr, raddr} - Sort by (default: none) - --reverse Reverse order (default: False) -``` - -Example: getting a list of MMEs (not sorted by default). - -``` -OsmoS1GW# mme_list -| Name | Local address | Remote address/port | -|--------|-----------------|-----------------------| -| mme0 | :: | 127.0.2.10:36412 | -| mme1 | :: | 127.0.2.20:36412 | -| mme2 | :: | 127.0.2.30:36412 | -``` - -### `mme_add` - -Add an MME to the pool. - -``` -Usage: mme_add -N NAME -ra RADDR [-h] [-la LADDR] [-rp RPORT] - -Add an MME to the pool - -required arguments: - -N, --name NAME MME name (example: mme0) - -ra, --raddr RADDR Remote address (example: 192.168.1.101) - -optional arguments: - -h, --help show this help message and exit - -la, --laddr LADDR Local address (default: ::) - -rp, --rport RPORT Remote port (default: 36412) -``` - -Example: adding an MME with remote address "192.168.1.101". - -``` -OsmoS1GW# mme_add --name mme42 --raddr 192.168.1.101 -``` - -### `mme_info` - -Get information about a specific MME. - -``` -Usage: mme_info [-h] -N NAME - -Get information about a specific MME - -optional arguments: - -h, --help show this help message and exit - -MME ID: - -N, --name NAME MME name (example: mme0) -``` - -Example: getting information about an MME with name "mme0". - -``` -OsmoS1GW# mme_info --name mme0 -| Parameter | Value | -|---------------------|------------------| -| Name | mme0 | -| Local address | :: | -| Remote address/port | 127.0.2.10:36412 | -``` - -### `mme_delete` - -Delete an MME from the pool. - -``` -Usage: mme_delete [-h] -N NAME - -Delete an MME from the pool - -optional arguments: - -h, --help show this help message and exit - -MME ID: - -N, --name NAME MME name (example: mme0) -``` - -Example: deleting an MME with name "mme0". - -``` -OsmoS1GW# mme_delete --name mme0 -``` - -### `enb_list` - -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 | -|--------------|-----------|-----------------|-----------|-------------------------|-------------------------|--------------|------------| -| 0 | <0.699.0> | 001-01-0 | connected | 127.0.1.10:56767 (5706) | 127.0.2.10:36412 (5707) | 418 | 0 | -| 1 | <0.701.0> | 001-01-1 | connected | 127.0.1.10:54140 (5710) | 127.0.2.10:36412 (5711) | 33 | 3 | -| 2 | <0.703.0> | 001-01-2 | connected | 127.0.1.10:34076 (5714) | 127.0.2.10:36412 (5715) | 3600 | 20 | -| 3 | <0.705.0> | 001-01-3 | connected | 127.0.1.10:46501 (5718) | 127.0.2.10:36412 (5719) | 869 | 13 | -| 4 | <0.707.0> | 001-01-4 | connected | 127.0.1.10:35610 (5722) | 127.0.2.10:36412 (5723) | 18 | 0 | -| 5 | <0.709.0> | 001-01-5 | connected | 127.0.1.10:37610 (5726) | 127.0.2.10:36412 (5727) | 933 | 129 | -| 6 | <0.711.0> | 001-01-6 | connected | 127.0.1.10:58447 (5730) | 127.0.2.10:36412 (5741) | 535 | 6 | -| 7 | <0.713.0> | 001-01-7 | connected | 127.0.1.10:35842 (5732) | 127.0.2.10:36412 (5743) | 736 | 8 | -| 8 | <0.715.0> | 001-01-8 | connected | 127.0.1.10:57362 (5734) | 127.0.2.10:36412 (5745) | 521 | 99 | -| 9 | <0.717.0> | 001-01-9 | connected | 127.0.1.10:50955 (5736) | 127.0.2.10:36412 (5747) | 33 | 1 | -``` - -### `enb_info` - -Get information about a specific eNB. - -``` -Usage: enb_info [-h] (-H HANDLE | -P PID | -G GENBID | - --enb-sctp-aid AID | - --mme-sctp-aid AID) - -Get information about a specific eNB - -optional arguments: - -h, --help show this help message and exit - -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) -``` - -Example: Getting eNB information using a handle. - -``` -OsmoS1GW# enb_info -H8 -| Parameter | Value | -|---------------------|-------------------------| -| eNB handle | 8 | -| PID | <0.715.0> | -| Global-eNB-ID | 001-01-8 | -| State | connected | -| eNB addr:port (aid) | 127.0.1.10:57362 (5734) | -| MME addr:port (aid) | 127.0.2.10:36412 (5745) | -| Uptime (s) | 521 | -| # E-RABs | 99 | -``` - -Example: Getting eNB information using a pricess ID. - -``` -OsmoS1GW# enb_info --pid 0.715.0 -| Parameter | Value | -|---------------------|-------------------------| -| eNB handle | 8 | -| PID | <0.715.0> | -| Global-eNB-ID | 001-01-8 | -| State | connected | -| eNB addr:port (aid) | 127.0.1.10:57362 (5734) | -| MME addr:port (aid) | 127.0.2.10:36412 (5745) | -| Uptime (s) | 521 | -| # E-RABs | 99 | -``` - -Example: Unsuccessful outcome for an unknown/invalid Global-eNB-ID. - -``` -OsmoS1GW# enb_info -G 001-01-42 -EXCEPTION of type 'HTTPError' occurred with message: HTTP Error 404: Not Found -To enable full traceback, run the following command: 'set debug true' - -OsmoS1GW# enb_info -G 123456 -EXCEPTION of type 'HTTPError' occurred with message: HTTP Error 400: Bad Request -To enable full traceback, run the following command: 'set debug true' -``` - -### `enb_delete` - -Force disconnect an eNB. - -``` -Usage: enb_delete [-h] (-H HANDLE | -P PID | -G GENBID | --enb-sctp-aid AID | --mme-sctp-aid AID) - -Force disconnect an eNB - -optional arguments: - -h, --help show this help message and exit - -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) -``` - -### `enb_erab_list` - -Get E-RAB list for a specific eNB. - -``` -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) - -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) -``` - -Example: Obtaining E-RAB list for an eNB with the given Global-eNB-ID. - -``` -OsmoS1GW# enb_erab_list -G 001-01-0 -| PID | MME-UE-S1AP-ID | E-RAB-ID | State | -|-----------|------------------|------------|------------| -| <0.707.0> | 4242 | 0 | erab_setup | -| <0.708.0> | 4242 | 1 | erab_setup | -| <0.709.0> | 4242 | 2 | erab_setup | -``` - -### `erab_list` - -Get E-RAB list for all eNBs. - -``` -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) - -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. - -### `erab_info` - -Get information about a specific E-RAB. - -``` -Usage: erab_info -P PID [-h] - -Get information about a specific E-RAB - -required arguments: - -P, --pid PID E-RAB process ID (example: 0.33.1) - -optional arguments: - -h, --help show this help message and exit - -``` - -Example: Obtaining E-RAB info using process ID. - -``` -OsmoS1GW# erab_info -P 0.714.0 -| Parameter | Value | -|----------------|----------------------| -| PID | <0.714.0> | -| MME-UE-S1AP-ID | 4242 | -| E-RAB-ID | 1 | -| State | erab_setup | -| SEID (local) | 0x0000000000000002 | -| SEID (remote) | 0x5454434e2d330001 | -| U2C F-TEID | 0x00010001(a)127.0.0.1 | -| C2U F-TEID | 0x01010001(a)127.0.1.1 | -| A2U F-TEID | 0x02020001(a)127.0.2.2 | -| U2A F-TEID | 0x00020001(a)127.0.0.2 | -``` - -### `erab_delete` - -Terminate an E-RAB FSM process. - -``` -Usage: erab_delete -P PID [-h] - -Terminate an E-RAB FSM process - -required arguments: - -P, --pid PID E-RAB process ID (example: 0.33.1) - -optional arguments: - -h, --help show this help message and exit -``` -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42368?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ic2556f6add9c6a24f6da03f4388d7f86dde0c5dc Gerrit-Change-Number: 42368 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-gsm-manuals[master]: gsup: align ordering of IEs
by fixeria 14 Mar '26

14 Mar '26
Attention is currently required from: fixeria, laforge, pespin. Hello Jenkins Builder, laforge, lynxis lazus, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/38666?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review+1 by laforge, Code-Review+1 by pespin, Verified+1 by Jenkins Builder Change subject: gsup: align ordering of IEs ...................................................................... gsup: align ordering of IEs Align with the IE order produced by libosmocore's GSUP encoder. Change-Id: I5caa3101da310cddfa311d068ad889bca697b438 Related: 54343caa ("common/gsup.adoc: document Supplementary Services extension") Related: ce32ec2a ("gsup: Document ePDG Tunnel Req/Res/Err") Related: 92cf519c ("GSUP: document inter-MSC handover additions") --- M common/chapters/gsup.adoc 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/66/38666/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/38666?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I5caa3101da310cddfa311d068ad889bca697b438 Gerrit-Change-Number: 38666 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy/mme_registry: add per-MME counters for connection events
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email ) Change subject: enb_proxy/mme_registry: add per-MME counters for connection events ...................................................................... enb_proxy/mme_registry: add per-MME counters for connection events Register a set of per-MME counters when an MME is added to the pool, and increment them from enb_proxy at the relevant state transitions: - selected (MME chosen for a connection attempt) - conn_est_timeout (SCTP connection establishment timed out) - conn_est_failure (SCTP connection establishment failed) - s1setup_rsp (S1 SETUP RESPONSE received successfully) - s1setup_failure (S1 SETUP FAILURE received from MME) - s1setup_rsp_timeout (timed out waiting for S1 SETUP RESPONSE) A new global aggregate counter ?S1GW_CTR_ENB_PROXY_MME_SELECTED is also added alongside the existing ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR. Change-Id: Ie0149c1ad0754af6d8f5f95d4e8919993eac3760 Related: SYS#7052 --- M include/s1gw_metrics.hrl M src/enb_proxy.erl M src/mme_registry.erl M src/s1gw_metrics.erl 4 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/63/42363/1 diff --git a/include/s1gw_metrics.hrl b/include/s1gw_metrics.hrl index 249bc6c..06a9719 100644 --- a/include/s1gw_metrics.hrl +++ b/include/s1gw_metrics.hrl @@ -50,6 +50,17 @@ -define(S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, [ctr, enb_proxy, unexpected_pdu]). -define(S1GW_CTR_ENB_PROXY_MALFORMED_PDU, [ctr, enb_proxy, malformed_pdu]). -define(S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, [ctr, enb_proxy, mme_select, error]). +-define(S1GW_CTR_ENB_PROXY_MME_SELECTED, [ctr, enb_proxy, mme_select, ok]). + +%% per-MME counters +%% NOTE: these counters shall not be listed in ?S1GW_COUNTERS, +%% but created dynamically for each registered MME. +-define(S1GW_CTR_MME_SELECTED(N), [ctr, mme, N, selected]). +-define(S1GW_CTR_MME_CONN_EST_TIMEOUT(N), [ctr, mme, N, conn_est, timeout]). +-define(S1GW_CTR_MME_CONN_EST_FAILURE(N), [ctr, mme, N, conn_est, failure]). +-define(S1GW_CTR_MME_S1_SETUP_RSP(N), [ctr, mme, N, s1setup, rsp]). +-define(S1GW_CTR_MME_S1_SETUP_FAILURE(N), [ctr, mme, N, s1setup, failure]). +-define(S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(N), [ctr, mme, N, s1setup, rsp, timeout]). %% SCTP related metrics -define(S1GW_CTR_SCTP_ERROR_ALL, [ctr, sctp, error, all]). diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 3ce205f..1d479d6 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -195,6 +195,8 @@ {ok, MmeInfo} -> MmeName = maps:get(name, MmeInfo), ?LOG_INFO("MME selection: trying ~p", [MmeName]), + ctr_inc(?S1GW_CTR_ENB_PROXY_MME_SELECTED, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_SELECTED(MmeName)), %% Close the old connection, if any close_sock(S), %% Initiate connection establishment with the MME @@ -225,6 +227,7 @@ ?LOG_ERROR("MME ~p: timeout establishing connection", [hd(S#state.tried_mmes)]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_TIMEOUT, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_CONN_EST_TIMEOUT(hd(S#state.tried_mmes))), %% re-enter the state to try again (or another MME) repeat_state_and_data; @@ -253,6 +256,7 @@ ?LOG_NOTICE("MME ~p: connection establishment failed: ~p", [MmeName, ConnState]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_FAILURE, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_CONN_EST_FAILURE(MmeName)), %% re-enter the state to try again (or another MME) repeat_state_and_data end; @@ -272,6 +276,7 @@ wait_s1setup_rsp(state_timeout, s1setup_rsp_timeout, S) -> ?LOG_ERROR("Timeout waiting for S1 SETUP RESPONSE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_RSP_TIMEOUT, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(hd(S#state.tried_mmes))), %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; @@ -296,11 +301,13 @@ {{?'id-S1Setup', successfulOutcome}, _IEs} -> ?LOG_INFO("Rx S1 SETUP RESPONSE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_RSP, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP(hd(S#state.tried_mmes))), sctp_send_from_mme(Data, S), {next_state, connected, S}; {{?'id-S1Setup', unsuccessfulOutcome}, _IEs} -> ?LOG_NOTICE("Rx S1 SETUP FAILURE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_FAILURE, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_FAILURE(hd(S#state.tried_mmes))), %% do *not* forward the FAILURE to the eNB %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; diff --git a/src/mme_registry.erl b/src/mme_registry.erl index d9ca43a..d052f0c 100644 --- a/src/mme_registry.erl +++ b/src/mme_registry.erl @@ -199,6 +199,19 @@ lists:subtract(EnbTACs, MmeTACs) == []. +%% Register per-MME metrics +-spec mme_ctr_reg(mme_name()) -> ok. +mme_ctr_reg(MmeName) -> + Ctrs = [?S1GW_CTR_MME_SELECTED(MmeName), + ?S1GW_CTR_MME_CONN_EST_TIMEOUT(MmeName), + ?S1GW_CTR_MME_CONN_EST_FAILURE(MmeName), + ?S1GW_CTR_MME_S1_SETUP_RSP(MmeName), + ?S1GW_CTR_MME_S1_SETUP_FAILURE(MmeName), + ?S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(MmeName)], + %% counter may already exist (e.g. MME re-registered), so ignore errors + lists:foreach(fun(C) -> catch exometer:new(C, counter) end, Ctrs). + + %% Add a new MME if it does not already exist -spec mme_add(mme_info(), mme_list()) -> {ok, mme_list()} | {error, term()}. mme_add(MmeInfo0, MMEs) -> @@ -221,6 +234,7 @@ false -> ?LOG_INFO("MME (name=~p, ~p:~p) registered", [MmeName, RAddr, RPort]), + mme_ctr_reg(MmeName), {ok, MMEs ++ [MmeInfo1]} end. diff --git a/src/s1gw_metrics.erl b/src/s1gw_metrics.erl index c505a8b..551b821 100644 --- a/src/s1gw_metrics.erl +++ b/src/s1gw_metrics.erl @@ -107,6 +107,7 @@ ?S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, %% unexpected PDUs received from eNB/MME ?S1GW_CTR_ENB_PROXY_MALFORMED_PDU, %% malformed PDUs received from eNB/MME ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, %% failed to select an MME (pool exhaustion) + ?S1GW_CTR_ENB_PROXY_MME_SELECTED, %% successfully selected an MME %% SCTP related counters ?S1GW_CTR_SCTP_ERROR_ALL, %% total number of SCTP errors -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ie0149c1ad0754af6d8f5f95d4e8919993eac3760 Gerrit-Change-Number: 42363 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: s1gw: add tests for MME registry REST procedures
by fixeria 14 Mar '26

14 Mar '26
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42360?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: s1gw: add tests for MME registry REST procedures ...................................................................... s1gw: add tests for MME registry REST procedures Add three test cases exercising the S1GW REST interface for MME pool management. The REST TCs are gated on the mp_rest_enable module parameter in the control block. TC_rest_mme_list: query the MME pool list via REST and verify it matches the three static entries from the 'mme_pool' section in osmo-s1gw.config (mme0/mme1/mme2 with their respective addresses). TC_rest_mme_add_del: add a new MME entry at runtime via REST, verify it appears in both the list and individual GET responses, then delete it and confirm it is gone. TC_rest_mme_del_fallback: delete mme0 from the pool at runtime and verify that a connecting eNB is routed directly to mme1, skipping the deleted entry. The pool is restored to its original state afterwards via f_REST_mme_pool_restore(). Also add: * {ts,tr}_MmeItem templates to S1GW_REST_Types.ttcn * f_REST_mme_find(): returns the integer index of a named entry in a MmeList, or -1 if not found; used for both presence and absence checks * f_REST_mme_pool_restore(): deletes all current entries and re-adds mme0/mme1/mme2 in original order to keep pool state predictable across test cases Change-Id: I260bc987ab8ae0ecb547d0b69b261fd97c5c9c23 Related: SYS#7052 --- M s1gw/S1GW_REST_Types.ttcn M s1gw/S1GW_Tests.ttcn M s1gw/expected-results.xml 3 files changed, 199 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/42360/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42360?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I260bc987ab8ae0ecb547d0b69b261fd97c5c9c23 Gerrit-Change-Number: 42360 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: use REST interface to check PFCP assoc state
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42362?usp=email ) Change subject: s1gw: use REST interface to check PFCP assoc state ...................................................................... s1gw: use REST interface to check PFCP assoc state It's quicker to query the IUT using the REST interface rather than waiting for StatsD metric "gauge.pfcp.associated.value" to be received. As a bonus, we "learn" the local/remote RTS from the S1GW, which can be used in new PFCP related testcases. Change-Id: Iec7594e79f533b08ee93b443a39cb9c8ff03da43 --- M s1gw/S1GW_ConnHdlr.ttcn M s1gw/S1GW_Tests.ttcn 2 files changed, 13 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/42362/1 diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn index 574a2d0..fd171d3 100644 --- a/s1gw/S1GW_ConnHdlr.ttcn +++ b/s1gw/S1GW_ConnHdlr.ttcn @@ -434,16 +434,7 @@ function f_ConnHdlr_pfcp_assoc_handler(charstring id) runs on ConnHdlr { - var charstring key_name := g_pars.statsd_prefix & "gauge.pfcp.associated.value"; - var StatsDMetricKeys statsd_keys := { valueof(ts_StatsDMetricKey(key_name, "g")) }; - var StatsDMetrics statsd_snapshot := f_statsd_snapshot(statsd_keys, since_last_snapshot := false); - var boolean pfcp_associated := statsd_snapshot[0].val == 1; - - if (not pfcp_associated) { - log("Waiting for IUT to associate over PFCP"); - f_ConnHdlr_pfcp_assoc_setup(); - } - + f_ConnHdlr_pfcp_assoc_setup(); setverdict(pass); } diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index b7b01b1..f86546c 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -76,6 +76,7 @@ var S1AP_ServerList vc_S1APSRVs := {}; var PFCP_Emulation_CT vc_PFCP; var StatsD_Checker_CT vc_STATSD; + var PfcpAssocInfo g_pfcp_assoc; }; private altstep as_Tguard() runs on test_CT { @@ -98,11 +99,11 @@ if (s1apsrv_start) { f_init_s1ap_srv(num_mmes); } + f_init_rest(); if (upf_start) { f_init_pfcp(); f_pfcp_assoc(); } - f_init_rest(); } /* compute the IP address for pool MME server [idx]: mp_mme_bind_ip + idx */ @@ -140,11 +141,16 @@ var verdicttype verdict; var ConnHdlr vc_conn; - vc_conn := f_ConnHdlr_spawn(refers(f_ConnHdlr_pfcp_assoc_handler), - pars := valueof(t_ConnHdlrPars)); - vc_conn.done -> value verdict; - if (verdict != pass) { - Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + g_pfcp_assoc := f_REST_PfcpAssocState(); + if (g_pfcp_assoc.state != connected) { + log("Waiting for IUT to associate over PFCP"); + vc_conn := f_ConnHdlr_spawn(refers(f_ConnHdlr_pfcp_assoc_handler), + pars := valueof(t_ConnHdlrPars)); + vc_conn.done -> value verdict; + if (verdict != pass) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + g_pfcp_assoc := f_REST_PfcpAssocState(); } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42362?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: Iec7594e79f533b08ee93b443a39cb9c8ff03da43 Gerrit-Change-Number: 42362 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: enable the REST interface, fix wrong REST port
by fixeria 14 Mar '26

14 Mar '26
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42361?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: s1gw: enable the REST interface, fix wrong REST port ...................................................................... s1gw: enable the REST interface, fix wrong REST port REST had been disabled because only nightly builds supported it. The latest stable release (v0.4.0) also supports the REST interface, so let's enable it unconditionally by removing the mp_rest_enable. Also fix the REST port: mp_rest_port was incorrectly set to 8125 (the StatsD port) instead of the actual REST port 8080. Change-Id: I012749076c652ab541e569026eb01c696ad5adc8 Related: SYS#7052, SYS#7066 --- M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.ttcn 2 files changed, 8 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/42361/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42361?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I012749076c652ab541e569026eb01c696ad5adc8 Gerrit-Change-Number: 42361 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: s1gw: add testcases for impatient eNB during MME pool selection
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42359?usp=email ) Change subject: s1gw: add testcases for impatient eNB during MME pool selection ...................................................................... s1gw: add testcases for impatient eNB during MME pool selection Two new test cases covering scenarios where the eNB disconnects before S1 setup completes, targeting specific states of the enb_proxy FSM: * TC_mme_pool_enb_disc_wait_s1setup_req: eNB connects but disconnects before sending S1SetupReq (enb_proxy in wait_s1setup_req). No MME connection is ever attempted; S1GW must handle the disconnect cleanly. * TC_mme_pool_enb_disc_wait_s1setup_rsp: eNB sends S1SetupReq, S1GW forwards it to the first pool MME (enb_proxy in wait_s1setup_rsp), then eNB disconnects before the response arrives. S1GW must detect the eNB disconnect and close the open MME connection in response. A new helper S1GW_ConnHdlr.f_ConnHdlr_s1ap_close() is added for these tests: unlike f_ConnHdlr_s1ap_disconnect(), it closes the eNB-side socket without waiting for an S1APSRV_EVENT_CONN_DOWN from a pool server (since in these scenarios either no MME connection exists yet, or the CONN_DOWN is captured by the test body directly). Change-Id: I5d27cdafcb9f595a2d3db59beff17cd55de2539e Related: SYS#7052 --- M s1gw/S1GW_ConnHdlr.ttcn M s1gw/S1GW_Tests.ttcn M s1gw/expected-results.xml 3 files changed, 82 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/42359/1 diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn index 2c900fe..574a2d0 100644 --- a/s1gw/S1GW_ConnHdlr.ttcn +++ b/s1gw/S1GW_ConnHdlr.ttcn @@ -179,6 +179,18 @@ log("eNB connection closed"); } +/* Close the eNB-side SCTP connection without waiting for pool server events. + * For use in 'impatient eNB' scenarios where the eNB initiates teardown before + * S1 setup completes and no S1APSRV_EVENT_CONN_DOWN is expected in return. */ +function f_ConnHdlr_s1ap_close() runs on ConnHdlr { + 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; + unmap(self:S1AP_ENB, system:S1AP_CODEC_PT); + log("eNB connection closed"); +} + function f_ConnHdlr_s1ap_expect_shutdown() runs on ConnHdlr { S1AP_ENB.receive(tr_SctpShutDownEvent(g_s1ap_conn_id)); S1AP_ENB.receive(tr_SctpAssocChange(SCTP_SHUTDOWN_COMP, g_s1ap_conn_id)); diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index 5fffb09..d870be8 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -1135,6 +1135,71 @@ { S1APSRV_SETUP_REJECT, S1APSRV_SETUP_REJECT, S1APSRV_SETUP_REJECT }); } +/* MME pool test: eNB connects but disconnects before sending S1SetupReq + * (S1GW is in wait_s1setup_req); S1GW must handle the disconnect cleanly + * and must not attempt to connect to any MME. */ +function f_TC_mme_pool_enb_disc_wait_s1setup_req(charstring id) runs on ConnHdlr { + f_ConnHdlr_s1ap_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); + + /* disconnect before S1SetupReq: S1GW is in wait_s1setup_req, + * no MME connection is ever attempted */ + f_ConnHdlr_s1ap_close(); + setverdict(pass); +} +testcase TC_mme_pool_enb_disc_wait_s1setup_req() runs on test_CT { + f_TC_exec_pool(refers(f_TC_mme_pool_enb_disc_wait_s1setup_req), 1, + { S1APSRV_SETUP_ACCEPT }); +} + +/* MME pool test: eNB connects, sends S1SetupReq, S1GW forwards it to an MME + * (S1GW is in wait_s1setup_rsp), then eNB disconnects before the response arrives. + * S1GW must detect the eNB disconnect and close the MME connection. */ +function f_TC_mme_pool_enb_disc_wait_s1setup_rsp(charstring id) runs on ConnHdlr { + var S1AP_Server_CT vc_srv := g_pars.pool_srvs[0]; + var S1AP_PDU pdu; + timer T; + + f_ConnHdlr_s1ap_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); + f_ConnHdlr_conn_track_disable(); + + /* pre-register with the pool server, then trigger MME selection */ + f_ConnHdlr_s1ap_register_to(g_pars.genb_id, vc_srv); + f_ConnHdlr_tx_s1ap_from_enb(ts_S1AP_SetupReq(g_pars.genb_id, c_SupportedTAs, v32)); + + /* wait until S1GW has forwarded SetupReq to the MME (now in wait_s1setup_rsp) */ + g_s1ap_server := vc_srv; + T.start(10.0); + alt { + [] S1AP_CONN.receive(S1APSRV_Event:S1APSRV_EVENT_CONN_UP) from vc_srv { repeat; } + [] S1AP_CONN.receive(tr_S1AP_SetupReq) from vc_srv -> value pdu { T.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for S1SetupReq on pool server"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + } + + /* eNB disconnects impatient; S1GW must close the MME connection in response */ + f_ConnHdlr_s1ap_close(); + + T.start(10.0); + alt { + [] S1AP_CONN.receive(S1APSRV_Event:S1APSRV_EVENT_CONN_DOWN) from vc_srv { + T.stop; + setverdict(pass); + } + [] T.timeout { + setverdict(fail, "S1GW did not close MME connection after eNB disconnect"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + } + + f_ConnHdlr_s1ap_unregister_from(g_pars.genb_id, vc_srv); +} +testcase TC_mme_pool_enb_disc_wait_s1setup_rsp() runs on test_CT { + f_TC_exec_pool(refers(f_TC_mme_pool_enb_disc_wait_s1setup_rsp), 1, + { S1APSRV_SETUP_ACCEPT }); +} + control { execute( TC_setup() ); execute( TC_setup_multi() ); @@ -1174,6 +1239,8 @@ execute( TC_mme_pool_reject_fallback() ); execute( TC_mme_pool_timeout_fallback() ); execute( TC_mme_pool_all_reject() ); + execute( TC_mme_pool_enb_disc_wait_s1setup_req() ); + execute( TC_mme_pool_enb_disc_wait_s1setup_rsp() ); } } diff --git a/s1gw/expected-results.xml b/s1gw/expected-results.xml index 28fcf71..0769764 100644 --- a/s1gw/expected-results.xml +++ b/s1gw/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='S1GW_Tests' tests='36' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='S1GW_Tests' tests='38' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='S1GW_Tests' name='TC_setup' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_setup_multi' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_conn_term_by_mme' time='MASKED'/> @@ -38,4 +38,6 @@ <testcase classname='S1GW_Tests' name='TC_mme_pool_reject_fallback' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_mme_pool_timeout_fallback' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_mme_pool_all_reject' time='MASKED'/> + <testcase classname='S1GW_Tests' name='TC_mme_pool_enb_disc_wait_s1setup_req' time='MASKED'/> + <testcase classname='S1GW_Tests' name='TC_mme_pool_enb_disc_wait_s1setup_rsp' time='MASKED'/> </testsuite> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42359?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: I5d27cdafcb9f595a2d3db59beff17cd55de2539e Gerrit-Change-Number: 42359 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: s1gw: add tests for MME registry REST procedures
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42360?usp=email ) Change subject: s1gw: add tests for MME registry REST procedures ...................................................................... s1gw: add tests for MME registry REST procedures Add three test cases exercising the S1GW REST interface for MME pool management. The REST TCs are gated on the mp_rest_enable module parameter in the control block. TC_rest_mme_list: query the MME pool list via REST and verify it matches the three static entries from the 'mme_pool' section in osmo-s1gw.config (mme0/mme1/mme2 with their respective addresses). TC_rest_mme_add_del: add a new MME entry at runtime via REST, verify it appears in both the list and individual GET responses, then delete it and confirm it is gone. TC_rest_mme_del_fallback: delete mme0 from the pool at runtime and verify that a connecting eNB is routed directly to mme1, skipping the deleted entry. The pool is restored to its original state afterwards via f_REST_mme_pool_restore(). Also add: * {ts,tr}_MmeItem templates to S1GW_REST_Types.ttcn * f_REST_mme_find(): returns the integer index of a named entry in a MmeList, or -1 if not found; used for both presence and absence checks * f_REST_mme_pool_restore(): deletes all current entries and re-adds mme0/mme1/mme2 in original order to keep pool state predictable across test cases Change-Id: I260bc987ab8ae0ecb547d0b69b261fd97c5c9c23 Related: SYS#7052 --- M s1gw/S1GW_REST_Types.ttcn M s1gw/S1GW_Tests.ttcn M s1gw/expected-results.xml 3 files changed, 198 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/42360/1 diff --git a/s1gw/S1GW_REST_Types.ttcn b/s1gw/S1GW_REST_Types.ttcn index f182ae9..696df3d 100644 --- a/s1gw/S1GW_REST_Types.ttcn +++ b/s1gw/S1GW_REST_Types.ttcn @@ -157,4 +157,30 @@ external function dec_ErabItem(in octetstring data) return ErabItem with { extension "prototype(convert) decode(JSON)" } + +template (value) MmeItem +ts_MmeItem(template (value) charstring name, + template (value) charstring raddr, + template (omit) charstring laddr := omit, + template (omit) Port rport := omit, + template (omit) TacList tac_list := omit) := { + name := name, + laddr := laddr, + raddr := raddr, + rport := rport, + tac_list := tac_list +} +template (present) MmeItem +tr_MmeItem(template (present) charstring name := ?, + template (present) charstring raddr := ?, + template charstring laddr := *, + template Port rport := *, + template TacList tac_list := *) := { + name := name, + laddr := laddr, + raddr := raddr, + rport := rport, + tac_list := tac_list +} + } with { encode "JSON" } diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index d870be8..f2af12a 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -1200,6 +1200,167 @@ { S1APSRV_SETUP_ACCEPT }); } + +/* Find an MME entry in the list by name; return its index, or -1 if not found */ +private function f_REST_mme_find(MmeList mmes, charstring name) return integer { + for (var integer i := 0; i < lengthof(mmes); i := i + 1) { + if (mmes[i].name == name) { + return i; + } + } + return -1; +} + +/* Restore the MME pool to its original state: delete all current entries and + * re-add the three static pool entries (mme0/mme1/mme2) in their original order. */ +private function f_REST_mme_pool_restore() runs on test_CT { + var MmeList mmes := f_REST_MmeList(); + for (var integer i := 0; i < lengthof(mmes); i := i + 1) { + f_REST_MmeDelete({ name := "name:" & mmes[i].name }); + } + for (var integer i := 0; i < 3; i := i + 1) { + f_REST_MmeAdd(valueof(ts_MmeItem(name := "mme" & int2str(i), + raddr := f_mme_ip(i)))); + } +} + +/* REST test: verify the configured MME pool is correctly reflected via REST */ +testcase TC_rest_mme_list() runs on test_CT { + var template (present) MmeList tr_mmes; + var MmeList mmes; + + f_init(s1apsrv_start := false, upf_start := false); + + /* this resembles the 'mme_pool' section in osmo-s1gw.config */ + for (var integer i := 0; i < 3; i := i + 1) { + tr_mmes[i] := tr_MmeItem(name := "mme" & int2str(i), + raddr := f_mme_ip(i), + laddr := "any", + rport := 36412, + tac_list := { }); + } + + mmes := f_REST_MmeList(); + if (not match(mmes, tr_mmes)) { + setverdict(fail, "Got unexpected MmeList: ", mmes); + } + + setverdict(pass); +} + +/* REST test: add an MME to the pool, verify it appears, then delete it */ +testcase TC_rest_mme_add_del() runs on test_CT { + var MmeList mmes; + var MmeItem mme; + var integer idx; + + var template (value) MmeItem ts_mme_test := ts_MmeItem(name := "mme-test", + raddr := f_mme_ip(9)); + var template (present) MmeItem tr_mme_test := tr_MmeItem(name := "mme-test", + raddr := f_mme_ip(9), + laddr := "any", + rport := 36412, + tac_list := { }); + + f_init(s1apsrv_start := false, upf_start := false); + + /* add the new entry and verify it appears in the list */ + if (not f_REST_MmeAdd(valueof(ts_mme_test))) { + setverdict(fail, "Failed to add mme-test via REST"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + mmes := f_REST_MmeList(); + if (lengthof(mmes) != 4) { + setverdict(fail, "Expected 4 MMEs after add, got ", lengthof(mmes)); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + idx := f_REST_mme_find(mmes, "mme-test"); + if (idx == -1) { + setverdict(fail, "mme-test not found in MmeList after add"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + if (not match(mmes[idx], tr_mme_test)) { + setverdict(fail, "mme-test does not match: ", mmes[idx]); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + /* also verify via individual GET */ + mme := f_REST_MmeInfo({ name := "name:mme-test" }); + if (not match(mme, tr_mme_test)) { + setverdict(fail, "mme-test does not match: ", mme); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + /* delete the entry and verify it's gone */ + if (not f_REST_MmeDelete({ name := "name:mme-test" })) { + setverdict(fail, "Failed to delete mme-test via REST"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + mmes := f_REST_MmeList(); + if (lengthof(mmes) != 3) { + setverdict(fail, "Expected 3 MMEs after delete, got ", lengthof(mmes)); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + if (f_REST_mme_find(mmes, "mme-test") != -1) { + setverdict(fail, "mme-test still present in MmeList after delete"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + setverdict(pass); +} + +/* ConnHdlr body for TC_rest_mme_del_fallback: connect and complete S1 setup via pool */ +private function f_TC_rest_pool_connect_accept(charstring id) runs on ConnHdlr { + f_ConnHdlr_s1ap_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); + f_ConnHdlr_s1ap_setup_pool(g_pars.pool_srvs, g_pars.pool_behaviors); + f_sleep(0.5); + f_ConnHdlr_s1ap_disconnect(); + f_ConnHdlr_s1ap_unregister_from(g_pars.genb_id, g_s1ap_server); +} + +/* REST test: delete an MME from the pool at runtime; eNB must fall back to the + * next available MME without attempting to connect to the deleted entry. */ +testcase TC_rest_mme_del_fallback() runs on test_CT { + var ConnHdlrPars pars; + var ConnHdlr vc_conn; + var MmeList mmes; + + /* start 2 S1AP servers: server[0]=mme0(a)127.0.2.10, server[1]=mme1(a)127.0.2.11 */ + f_init(num_mmes := 2); + + /* delete mme0: effective pool becomes [mme1, mme2] */ + if (not f_REST_MmeDelete({ name := "name:mme0" })) { + setverdict(fail, "Failed to delete mme0 via REST"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + mmes := f_REST_MmeList(); + if (lengthof(mmes) != 2) { + setverdict(fail, "Expected 2 MMEs after deleting mme0, got ", lengthof(mmes)); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + if (f_REST_mme_find(mmes, "mme0") != -1) { + setverdict(fail, "mme0 still present in MmeList after delete"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + /* eNB connects: S1GW must select mme1 (server[1](a)127.0.2.11) directly */ + pars := valueof(t_ConnHdlrPars); + pars.pool_srvs := { vc_S1APSRVs[1] }; + pars.pool_behaviors := { S1APSRV_SETUP_ACCEPT }; + vc_conn := f_ConnHdlr_spawn(refers(f_TC_rest_pool_connect_accept), pars); + vc_conn.done; + + /* restore original pool state (mme0/mme1/mme2 in order) for subsequent tests */ + f_REST_mme_pool_restore(); + mmes := f_REST_MmeList(); + if (lengthof(mmes) != 3) { + setverdict(fail, "Expected 3 MMEs after pool restore, got ", lengthof(mmes)); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + setverdict(pass); +} + control { execute( TC_setup() ); execute( TC_setup_multi() ); @@ -1241,6 +1402,13 @@ execute( TC_mme_pool_all_reject() ); execute( TC_mme_pool_enb_disc_wait_s1setup_req() ); execute( TC_mme_pool_enb_disc_wait_s1setup_rsp() ); + + /* REST interface TCs */ + if (mp_rest_enable) { + execute( TC_rest_mme_list() ); + execute( TC_rest_mme_add_del() ); + execute( TC_rest_mme_del_fallback() ); + } } } diff --git a/s1gw/expected-results.xml b/s1gw/expected-results.xml index 0769764..b2b6cdb 100644 --- a/s1gw/expected-results.xml +++ b/s1gw/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='S1GW_Tests' tests='38' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='S1GW_Tests' tests='41' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='S1GW_Tests' name='TC_setup' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_setup_multi' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_conn_term_by_mme' time='MASKED'/> @@ -40,4 +40,7 @@ <testcase classname='S1GW_Tests' name='TC_mme_pool_all_reject' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_mme_pool_enb_disc_wait_s1setup_req' time='MASKED'/> <testcase classname='S1GW_Tests' name='TC_mme_pool_enb_disc_wait_s1setup_rsp' time='MASKED'/> + <testcase classname='S1GW_Tests' name='TC_rest_mme_list' time='MASKED'/> + <testcase classname='S1GW_Tests' name='TC_rest_mme_add_del' time='MASKED'/> + <testcase classname='S1GW_Tests' name='TC_rest_mme_del_fallback' time='MASKED'/> </testsuite> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42360?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: I260bc987ab8ae0ecb547d0b69b261fd97c5c9c23 Gerrit-Change-Number: 42360 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: s1gw: enable the REST interface, fix wrong REST port
by fixeria 14 Mar '26

14 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42361?usp=email ) Change subject: s1gw: enable the REST interface, fix wrong REST port ...................................................................... s1gw: enable the REST interface, fix wrong REST port REST had been disabled because only nightly builds supported it. The latest stable release (v0.4.0) also supports the REST interface, so let's enable it by default. Also fix the REST port: mp_rest_port was incorrectly set to 8125 (the StatsD port) instead of the actual REST port 8080. Change-Id: I012749076c652ab541e569026eb01c696ad5adc8 Related: SYS#7052, SYS#7066 --- M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.ttcn 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/42361/1 diff --git a/s1gw/S1GW_Tests.cfg b/s1gw/S1GW_Tests.cfg index 8174b9e..54863f9 100644 --- a/s1gw/S1GW_Tests.cfg +++ b/s1gw/S1GW_Tests.cfg @@ -19,8 +19,8 @@ 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; +S1GW_Tests.mp_rest_port := 8080; +S1GW_Tests.mp_rest_enable := true; [MAIN_CONTROLLER] diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index f2af12a..1a1a1ab 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -66,7 +66,7 @@ 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 */ + boolean mp_rest_enable := true; /* whether enable the HTTP/REST interface */ charstring mp_rest_host := "127.0.0.1"; integer mp_rest_port := 8080; } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42361?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: I012749076c652ab541e569026eb01c696ad5adc8 Gerrit-Change-Number: 42361 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.