Change in osmo-ttcn3-hacks[master]: bsc: fix f_vty_msc_allow_attach(): do not create new empty mscs (fix ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Wed Aug 12 23:17:46 UTC 2020


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19585 )

Change subject: bsc: fix f_vty_msc_allow_attach(): do not create new empty mscs (fix latest)
......................................................................

bsc: fix f_vty_msc_allow_attach(): do not create new empty mscs (fix latest)

In the ttcn3-bsc-latest tests, there are no 'msc 1' and 'msc 2' configured, so
stepping into 'msc 1' and '2' creates two new, empty MSC configurations.
osmo-bsc latest actually still tries to use them and fails 2/3 Compl L3.

So do not step into 'msc' config scopes if no such MSC is mentioned in the
running config yet.

This should finally fix the bsc latest tests after I broke them in
I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca and
Ibd5adb359b3fb302e2c70700d911878aef605ff3 and
I75295d638072df9f5213a7e74e4a960c009c2865.
Yes, I know :/

Change-Id: Ibfeeea98c2a962dec58ad03beb35bb7f83cad228
---
M bsc/BSC_Tests.ttcn
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 15d83da..1c02cb6 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -837,7 +837,15 @@
 
 private function f_vty_msc_allow_attach(TELNETasp_PT pt, my_BooleanList allow_attach_list)
 {
+	var charstring config := f_vty_transceive_ret(pt, "show running-config");
+
 	for (var integer msc_nr := 0; msc_nr < sizeof(allow_attach_list); msc_nr := msc_nr+1) {
+		if (f_strstr(config, "\nmsc " & int2str(msc_nr) & "\n") < 0) {
+			/* There is no 'msc N' for this msc_nr in the running config, so don't create an empty msc by
+			 * stepping into that config node. */
+			log("msc ", msc_nr, " is not configured, skipping");
+			continue;
+		}
 		f_vty_enter_cfg_msc(pt, msc_nr);
 		if (allow_attach_list[msc_nr]) {
 			/* strict := false: ignore if osmo-bsc does not support this config option (latest build) */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19585
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibfeeea98c2a962dec58ad03beb35bb7f83cad228
Gerrit-Change-Number: 19585
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200812/9a4e7972/attachment.htm>


More information about the gerrit-log mailing list