Change in osmo-ttcn3-hacks[master]: ns: SNS: add bss change weight testcase

lynxis lazus gerrit-no-reply at lists.osmocom.org
Mon Mar 22 12:17:38 UTC 2021


lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23181 )

Change subject: ns: SNS: add bss change weight testcase
......................................................................

ns: SNS: add bss change weight testcase

Do a normal SNS configuration. Afterwards the BSS will change
the weights of the endpoints

Change-Id: I691b9d26bf3eb8fa65aa02eba3efd0fd3869fc2a
---
M library/RAW_NS.ttcnpp
M ns/NS_Tests.ttcn
2 files changed, 34 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/library/RAW_NS.ttcnpp b/library/RAW_NS.ttcnpp
index 298ef1e..c5b0d50 100644
--- a/library/RAW_NS.ttcnpp
+++ b/library/RAW_NS.ttcnpp
@@ -390,6 +390,26 @@
 	rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig.nsei, cause), idx);
 }
 
+/* perform inbound SNS-CHANGE-WEIGHT procedure */
+function f_incoming_sns_chg_weight(template (omit) NsCause cause := omit, integer idx := 0)
+runs on RAW_NS_CT {
+	log("f_incoming_sns_chg_weight(idx=", idx, ")");
+	var PDU_NS rx;
+	var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[idx];
+
+	if (nsvc_cfg.provider.ip.address_family == AF_INET) {
+		var template IP4_Elements v4_elem := { tr_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip,
+								   nsvc_cfg.provider.ip.remote_udp_port) };
+		rx := f_ns_exp(tr_SNS_CHG_WEIGHT(g_nsconfig.nsei, ?, v4 := v4_elem), idx);
+	} else {
+		var template IP6_Elements v6_elem := { tr_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip,
+								   nsvc_cfg.provider.ip.remote_udp_port) };
+		rx := f_ns_exp(tr_SNS_CHG_WEIGHT(g_nsconfig.nsei, ?, v4 := omit, v6 := v6_elem), idx);
+	}
+	NSCP[idx].send(ts_SNS_ACK(g_nsconfig.nsei, rx.pDU_SNS_ChangeWeight.transactionID));
+}
+
+
 function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0, template (omit) NsCause cause := omit)
 runs on RAW_NS_CT {
 	log("f_outgoing_sns_add(idx_add=", idx_add, ")");
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index e2ff114..8182a91 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -468,6 +468,19 @@
 	f_clean_ns_codec();
 }
 
+testcase TC_sns_bss_change_weight() runs on RAW_Test_CT {
+	f_init_vty();
+	f_init_ns_codec(mp_nsconfig);
+	f_incoming_sns_size();
+	f_incoming_sns_config();
+	f_outgoing_sns_config();
+	activate(as_rx_alive_tx_ack());
+	f_vty_config2(NSVTY, {"ns", "bind udp local"}, "ip-sns signalling-weight 99 data-weight 99");
+	f_incoming_sns_chg_weight();
+	setverdict(pass);
+	f_clean_ns_codec();
+}
+
 control {
 	if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) {
 		execute( TC_tx_reset() );
@@ -513,6 +526,7 @@
 
 	if (mp_dialect == NS2_DIALECT_SNS) {
 		execute( TC_sns_config_success() );
+		execute( TC_sns_bss_change_weight() );
 	}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23181
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: I691b9d26bf3eb8fa65aa02eba3efd0fd3869fc2a
Gerrit-Change-Number: 23181
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210322/4e9d7740/attachment.htm>


More information about the gerrit-log mailing list