pespin has uploaded this change for review.

View Change

stp: Store asp name in array of m3ua cfgs

This way we keep STP specific config in one place instead of having to
figure out the ASP name on each test where we want to modify that ASP.

Change-Id: I1d5d9113dc95a8da911a7a99260c9bfe6e9de7c9
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 20 insertions(+), 6 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/40192/1
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 18076bd..bee2488 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -48,6 +48,7 @@
M3uaConfigs mp_m3ua_configs := {
/* as-sender: One ASP within AS */
{
+ asp_name := "asp-sender",
use_tcp := false,
remote_port := 2905,
local_port := 9999,
@@ -56,12 +57,14 @@
},
/* as-receiver: Two ASP within AS */
{
+ asp_name := "asp-receiver0",
use_tcp := false,
remote_port := 2905,
local_port := 10000,
point_code := 42,
routing_ctx := 1042
}, {
+ asp_name := "asp-receiver1",
use_tcp := false,
remote_port := 2905,
local_port := 10001,
@@ -70,6 +73,7 @@
},
/* as-sender-tcp: One ASP within AS */
{
+ asp_name := "asp-sender-tcp",
use_tcp := true,
remote_port := 2905,
local_port := 9999,
@@ -78,6 +82,7 @@
},
/* as-client: One ASP within AS */
{
+ asp_name := "asp-client0",
use_tcp := false,
remote_port := 2906,
local_port := 10002,
@@ -86,6 +91,7 @@
},
/* as-client60-norctx */
{
+ asp_name := "asp-client60-norctx0",
use_tcp := false,
remote_port := 2907,
local_port := 11060,
@@ -94,6 +100,7 @@
},
/* as-client61-norctx */
{
+ asp_name := "asp-client61-norctx0",
use_tcp := false,
remote_port := 2907,
local_port := 11061,
@@ -102,6 +109,7 @@
},
/* as-client-tcp: One ASP within AS */
{
+ asp_name := "asp-client0-tcp",
use_tcp := true,
remote_port := 2906,
local_port := 10002,
@@ -118,6 +126,8 @@
}

type record M3uaConfig {
+ /* Name of the ASP in the STP, (eg. to access it over VTY) */
+ charstring asp_name,
/* use TCP (true) or SCTP (false) */
boolean use_tcp,
/* STP-side SCTP (or TCP) port for M3UA */
@@ -1309,11 +1319,11 @@
f_M3UA_exp(0, tr_M3UA_SCON({adv_pc}, rctx0));
}

-private function f_asp_cfg_str(charstring asp_name, in M3uaConfig cfg)
+private function f_asp_cfg_str(in M3uaConfig cfg)
return charstring {
var charstring str;

- str := "asp " & asp_name;
+ str := "asp " & cfg.asp_name;
str := str & " " & int2str(cfg.local_port);
str := str & " " & int2str(cfg.remote_port);
str := str & " m3ua";
@@ -1325,14 +1335,18 @@
return str;
}

+private function f_vty_cs7_asp_cmd(in M3uaConfig cfg, charstring cmd) runs on RAW_M3UA_CT
+{
+ var charstring asp_cfg_str := f_asp_cfg_str(cfg);
+ f_vty_config2(VTY, {"cs7 instance 0", asp_cfg_str}, cmd);
+}
+
private function f_quirk(charstring quirk) runs on RAW_M3UA_CT {
- var charstring asp_cfg_str := f_asp_cfg_str("asp-client0", f_m3ua_srv_config(0));
- f_vty_config2(VTY, {"cs7 instance 0", asp_cfg_str}, "quirk " & quirk);
+ f_vty_cs7_asp_cmd(f_m3ua_srv_config(0), "quirk " & quirk)
}

private function f_no_quirk(charstring quirk) runs on RAW_M3UA_CT {
- var charstring asp_cfg_str := f_asp_cfg_str("asp-client0", f_m3ua_srv_config(0));
- f_vty_config2(VTY, {"cs7 instance 0", asp_cfg_str}, "no quirk " & quirk);
+ f_vty_cs7_asp_cmd(f_m3ua_srv_config(0), "no quirk " & quirk)
}

/* quirk 'no_notify': Expect inbound connection from ASP/SCTP-client, followed by ASP-UP + ASP-ACT */

To view, visit change 40192. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1d5d9113dc95a8da911a7a99260c9bfe6e9de7c9
Gerrit-Change-Number: 40192
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>