pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/41634?usp=email )
Change subject: vty: Forbid deleting ASP currently configured in an AS
......................................................................
vty: Forbid deleting ASP currently configured in an AS
Make the user first remove the ASP from the AS manually.
Change-Id: I3eed65b4a33b786e7dde6e86774c56655523aea2
---
M src/ss7_asp_vty.c
M tests/vty/osmo_stp_test.vty
2 files changed, 16 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index 49177a1..d54eb01 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -232,12 +232,23 @@
struct osmo_ss7_instance *inst = vty->index;
const char *name = argv[0];
struct osmo_ss7_asp *asp;
+ struct osmo_ss7_as *as;
asp = osmo_ss7_asp_find_by_name(inst, name);
if (!asp) {
vty_out(vty, "No ASP named '%s' found%s", name, VTY_NEWLINE);
return CMD_WARNING;
}
+
+ llist_for_each_entry(as, &inst->as_list, list) {
+ if (osmo_ss7_as_has_asp(as, asp)) {
+ vty_out(vty, "%% ASP '%s' currently configured in AS '%s'. "
+ "You must first remove the ASP from the AS configuration%s",
+ name, as->cfg.name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
+
osmo_ss7_asp_destroy(asp);
return CMD_SUCCESS;
}
diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index bf2db65..1114a2c 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -657,6 +657,11 @@
No ASP named 'unknown-asp' found
OsmoSTP(config-cs7)# no asp my-asp
+% ASP 'my-asp' currently configured in AS 'my-ass'. You must first remove the ASP from the AS configuration
+OsmoSTP(config-cs7)# as my-ass m3ua
+OsmoSTP(config-cs7-as)# no asp my-asp
+OsmoSTP(config-cs7-as)# exit
+OsmoSTP(config-cs7)# no asp my-asp
OsmoSTP(config-cs7)# do show cs7 instance 0 asp
ASP Name AS Name State Type Role SCTP Role Local Addresses Remote Addresses
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41634?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3eed65b4a33b786e7dde6e86774c56655523aea2
Gerrit-Change-Number: 41634
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(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-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/41635?usp=email )
Change subject: tests/vty: Run ss7_asp_test.vty
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS2:
> looks like the tests need to be adjusted more to have it pass? […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41635?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb0c589e6bdf692fa82361deedeb82169c09270
Gerrit-Change-Number: 41635
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(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-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 09 Dec 2025 12:48:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/41634?usp=email )
Change subject: vty: Forbid deleting ASP currently configured in an AS
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41634?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3eed65b4a33b786e7dde6e86774c56655523aea2
Gerrit-Change-Number: 41634
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(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-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 09 Dec 2025 12:48:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes