pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641?usp=email )

Change subject: stp: Allow setting up different m3ua_config list by test
......................................................................

stp: Allow setting up different m3ua_config list by test

This is useful, for instance, for tests willing to test dynamic ASPs.

Change-Id: I0a875bac5e9506be9140d5afa28da25bdc99a5a6
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 101 insertions(+), 71 deletions(-)

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




diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 0ae854b..195ce81 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -37,14 +37,14 @@
 
 import from STP_Tests_Common all;

-private const integer NR_M3UA := 4;    /* number of M3UA clients in ATS */
-private const integer NR_M3UA_SRV := 4;        /* number of M3UA servres in 
ATS */
+private const integer MAX_NR_M3UA := 8;        /* Maximum number of M3UA 
clients+servers in ATS */

 modulepar {
        /* STP-side IP addresses */
        HostList mp_stp_m3ua_ip := { "127.0.0.1", "::1" };
        /* local IP addresses */
        HostList mp_local_m3ua_ip := { "127.0.0.1", "::1" };
+       /* Clients first, servers afterwards, match 
mp_m3ua_num_{clients,servers} */
        M3uaConfigs mp_m3ua_configs := {
                /* as-sender: One ASP within AS */
                {
@@ -109,6 +109,10 @@
                        routing_ctx := 1155
                }
        };
+       /* number of M3UA clients in ATS */
+       integer mp_m3ua_num_clients := 4;
+       /* number of M3UA servers in ATS */
+       integer mp_m3ua_num_servers := 4;
        integer mp_recovery_timeout_msec := 2000;
        charstring mp_sccp_service_type := "mtp3_itu";
 }
@@ -125,29 +129,32 @@
        /* associated routing context */
        integer routing_ctx
 };
-type record length (NR_M3UA+NR_M3UA_SRV) of M3uaConfig M3uaConfigs;
+type record of M3uaConfig M3uaConfigs;

-private function M3UA_SRV(integer idx) return integer {
-       return NR_M3UA+idx;
+private function M3UA_SRV(integer idx) runs on RAW_M3UA_CT return integer {
+       return g_m3ua_num_clients + idx;
 }

-private function f_m3ua_cli_config(integer idx) return M3uaConfig {
-       if (idx < 0 or idx >= NR_M3UA) {
+private function f_m3ua_cli_config(integer idx) runs on RAW_M3UA_CT return 
M3uaConfig {
+       if (idx < 0 or idx >= g_m3ua_num_clients) {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"f_m3ua_cli_config(): unexpected idx");
        }
-       return mp_m3ua_configs[idx];
+       return g_m3ua_configs[idx];
 }

-private function f_m3ua_srv_config(integer idx) return M3uaConfig {
-       if (idx < 0 or idx >= NR_M3UA_SRV) {
+private function f_m3ua_srv_config(integer idx) runs on RAW_M3UA_CT return 
M3uaConfig {
+       if (idx < 0 or idx >= g_m3ua_num_servers) {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"f_m3ua_srv_config(): unexpected idx");
        }
-       return mp_m3ua_configs[M3UA_SRV(idx)];
+       return g_m3ua_configs[M3UA_SRV(idx)];
 }

 type component RAW_M3UA_CT extends Test_CT {
-       port M3UA_CODEC_PT M3UA[NR_M3UA+NR_M3UA_SRV];
-       var integer g_m3ua_conn_id[NR_M3UA+NR_M3UA_SRV];
+       port M3UA_CODEC_PT M3UA[MAX_NR_M3UA];
+       var M3uaConfigs g_m3ua_configs;
+       var integer g_m3ua_num_clients;
+       var integer g_m3ua_num_servers;
+       var integer g_m3ua_conn_id[MAX_NR_M3UA];
 }

 private template PortEvent tr_ConnOpened := {
@@ -170,7 +177,7 @@

 friend function f_M3UA_send(integer idx, template (present) PDU_M3UA msg, 
integer stream := 0)
 runs on RAW_M3UA_CT {
-       if (mp_m3ua_configs[idx].use_tcp) {
+       if (g_m3ua_configs[idx].use_tcp) {
                M3UA[idx].send(t_M3UA_Send(g_m3ua_conn_id[idx], msg, omit));
        } else {
                M3UA[idx].send(t_M3UA_Send(g_m3ua_conn_id[idx], msg, stream));
@@ -232,7 +239,7 @@
        var Option opt_add_local_addrs;
        var OptionList opt_list := {};
        var template SocketList opt_add_remote_addrs;
-       var M3uaConfig m3cfg := mp_m3ua_configs[i];
+       var M3uaConfig m3cfg := g_m3ua_configs[i];

        if (lengthof(mp_local_m3ua_ip) == 0 or lengthof(mp_stp_m3ua_ip) == 0) {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -266,7 +273,7 @@
 }

 friend function f_M3UA_connect_tcp(integer i) runs on RAW_M3UA_CT {
-       var M3uaConfig m3cfg := mp_m3ua_configs[i];
+       var M3uaConfig m3cfg := g_m3ua_configs[i];
        var Result res;

        if (lengthof(mp_local_m3ua_ip) == 0 or lengthof(mp_stp_m3ua_ip) == 0) {
@@ -288,11 +295,11 @@
 friend function f_M3UA_close(integer i) runs on RAW_M3UA_CT {
        var Result res;
        if (g_m3ua_conn_id[i] < 0) {
-               log("Not close()ing m3cfg := ", mp_m3ua_configs[i], " (not 
connected)");
+               log("Not close()ing m3cfg := ", g_m3ua_configs[i], " (not 
connected)");
                /* not connected */
                return;
        }
-       if (mp_m3ua_configs[i].use_tcp) {
+       if (g_m3ua_configs[i].use_tcp) {
                res := M3UA_CodecPort_CtrlFunct.f_IPL4_close(M3UA[i], 
g_m3ua_conn_id[i], {tcp:={}});
        } else {
                res := M3UA_CodecPort_CtrlFunct.f_IPL4_close(M3UA[i], 
g_m3ua_conn_id[i], {sctp:=valueof(ts_SCTP)});
@@ -304,7 +311,7 @@
        var Result res;
        var Option opt_add_local_addrs;
        var OptionList opt_list := {};
-       var M3uaConfig m3cfg := mp_m3ua_configs[i];
+       var M3uaConfig m3cfg := g_m3ua_configs[i];

        if (lengthof(mp_local_m3ua_ip) == 0 ) {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -332,12 +339,26 @@
        }
 }

-friend function f_init_m3ua(boolean ignore_ssnm := true) runs on RAW_M3UA_CT {
+friend function f_init_m3ua(boolean ignore_ssnm := true,
+                           template (omit) M3uaConfigs m3ua_configs := omit,
+                           integer m3ua_num_clients := 0,
+                           integer m3ua_num_servers := 0) runs on RAW_M3UA_CT {
        var integer i;

        f_init_common();

-       for (i := 0; i < NR_M3UA; i:=i+1) {
+       if (isvalue(m3ua_configs)) {
+               g_m3ua_configs := valueof(m3ua_configs);
+               g_m3ua_num_clients := m3ua_num_clients;
+               g_m3ua_num_servers := m3ua_num_servers
+       } else {
+               g_m3ua_configs := mp_m3ua_configs;
+               g_m3ua_num_clients := mp_m3ua_num_clients;
+               g_m3ua_num_servers := mp_m3ua_num_servers;
+       }
+
+
+       for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
                map(self:M3UA[i], system:M3UA_CODEC_PT);
        }

@@ -346,8 +367,8 @@
                activate(as_m3ua_ssnm_ignore());
        }

-       for (i := 0; i < NR_M3UA; i:=i+1) {
-               if (mp_m3ua_configs[i].use_tcp) {
+       for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
+               if (g_m3ua_configs[i].use_tcp) {
                        f_M3UA_connect_tcp(i);
                } else {
                        f_M3UA_connect_sctp(i);
@@ -360,7 +381,7 @@

        log("Clearing M3UA...");

-       for (i := 0; i < NR_M3UA; i:=i+1) {
+       for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
                f_M3UA_close(i);
        }
        /* Wait for recovery timer to trigger and shutdown all AS: */
@@ -372,14 +393,14 @@
        var integer i;
        var PortEvent port_evt;

-       for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+       for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
                map(self:M3UA[i], system:M3UA_CODEC_PT);
        }
-       for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+       for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
                /* bind + listen */
                f_M3UA_listen(i);
        }
-       for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+       for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
                /* wait for accept() */
                M3UA[i].receive(tr_ConnOpened) -> value port_evt {
                        g_m3ua_conn_id[i] := port_evt.connOpened.connId;
@@ -495,12 +516,11 @@

 /* test whether the STP accepts M3UA DATA without Routing Context IE */
 testcase TC_act_rctx_data_no_rctx() runs on RAW_M3UA_CT {
+       f_init_m3ua();
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
-
-       f_init_m3ua();
        /* bring up the sender specifying a routing context */

        f_M3UA_asp_up_act(0, rctx := rctx_sender);
@@ -527,13 +547,14 @@

 /* test "traffic-mode override" behavior */
 testcase TC_tmt_override() runs on RAW_M3UA_CT {
+
+       f_init_m3ua();
+
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);

-       f_init_m3ua();
-
        /* bring up the 'sender' side (single ASP in AS) */
        f_M3UA_asp_up_act(0, omit, omit);

@@ -564,13 +585,14 @@

 /* test "traffic-mode load-share" behavior */
 testcase TC_tmt_loadshare() runs on RAW_M3UA_CT {
+       var integer i;
+
+       f_init_m3ua();
+
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
-       var integer i;
-
-       f_init_m3ua();

        /* FIXME: configure the STP via VTY to set traffic-mode */

@@ -590,7 +612,10 @@

        /* verify traffic is routed from sender to new receiver */
        const integer iter_per_asp := 5;
-       var integer num_rx[NR_M3UA] := { 0, 0, 0, 0 };
+       var Integers num_rx := {};
+       for (i := 0; i < g_m3ua_num_clients; i := i + 1) {
+               num_rx := num_rx & {0};
+       }
        for (i := 0; i < 2*iter_per_asp; i := i+1) {
                var octetstring data := f_rnd_octstring_rnd_len(100);
                var template (value) M3UA_Protocol_Data tx_pd;
@@ -617,13 +642,14 @@

 /* test "traffic-mode broadcast" behavior */
 testcase TC_tmt_broadcast() runs on RAW_M3UA_CT {
+       var integer i;
+
+       f_init_m3ua();
+
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
-       var integer i;
-
-       f_init_m3ua();

        /* FIXME: configure the STP via VTY to set traffic-mode */

@@ -679,11 +705,11 @@
 
 /* Send RKM registration; expect OK as RCTX does match config */
 testcase TC_rkm_reg_static_permitted() runs on RAW_M3UA_CT {
+       f_init_m3ua();
+
        var OCT3 dpc := int2oct(f_m3ua_cli_config(0).point_code, 3); // must 
match config
        var OCT4 rctx := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);  // must 
match config

-       f_init_m3ua();
-
        f_M3UA_send(0, ts_M3UA_REG_REQ({ts_M3UA_rkey(id:='10000099'O, dpc:=dpc, 
rctx:=rctx)}));
        f_M3UA_exp(0, tr_M3UA_REG_RSP({tr_M3UA_reg_res(id:='10000099'O, 
status:=c_M3UA_REGSTS_SUCCESS,
                                                       rctx:=rctx)}));
@@ -850,14 +876,14 @@
 /* Test traffic being routed through "server" side STP (M3UA SG), coming back 
in "client"
  * side STP (M3UA ASP) */
 testcase TC_clnt_sg_to_asp() runs on RAW_M3UA_CT {
+       f_init_m3ua();
+       f_M3UA_asp_up_act(0);
+
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_srv_config(0).point_code, 4);

-       f_init_m3ua();
-       f_M3UA_asp_up_act(0);
-
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctx_receiver);

@@ -872,14 +898,14 @@
 /* Test traffic being routed through "client" side STP (M3UA ASP), coming back 
in "server"
  * side STP (M3UA SG) */
 testcase TC_clnt_asp_to_sg() runs on RAW_M3UA_CT {
+       f_init_m3ua();
+       f_M3UA_asp_up_act(0);
+
        var OCT4 rctx_sender := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_srv_config(0).point_code, 4);
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(0).point_code, 4);

-       f_init_m3ua();
-       f_M3UA_asp_up_act(0);
-
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctx_sender);

@@ -893,15 +919,15 @@
 /* Test traffic being routed through "server" side STP (M3UA SG), coming back 
in "client"
  * side STP (M3UA ASP) which has no routing context set */
 testcase TC_clnt_sg_to_asp_norctx() runs on RAW_M3UA_CT {
+       /* activate the sender side (ATS is client to STP in SG role) */
+       f_init_m3ua();
+       f_M3UA_asp_up_act(0);
+
        var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_srv_config(1).point_code, 4);
        var OCT4 pc_receiver2 := int2oct(f_m3ua_srv_config(2).point_code, 4);

-       /* activate the sender side (ATS is client to STP in SG role) */
-       f_init_m3ua();
-       f_M3UA_asp_up_act(0);
-
        /* activate the receiver side (ATS is server to STP in ASP role) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(1), rctx := omit);
@@ -920,15 +946,15 @@
 /* Test traffic being routed through "server" side STP (M3UA SG), coming back 
in "client"
  * side STP (M3UA ASP) which has no routing context set */
 testcase TC_clnt_asp_to_sg_norctx() runs on RAW_M3UA_CT {
+       /* activate the sender side (ATS is client to STP in SG role) */
+       f_init_m3ua();
+       f_M3UA_asp_up_act(0);
+
        var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
        var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(0).point_code, 4);
        var OCT4 pc_sender := int2oct(f_m3ua_srv_config(1).point_code, 4);
        var OCT4 pc_sender2 := int2oct(f_m3ua_srv_config(2).point_code, 4);

-       /* activate the sender side (ATS is client to STP in SG role) */
-       f_init_m3ua();
-       f_M3UA_asp_up_act(0);
-
        /* activate the receiver side (ATS is server to STP in ASP role) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(1), rctx := omit);
@@ -946,13 +972,13 @@

 /* Test if ASPAC / ASPIA of one ASP generates DAVA / DUNA on other ASP */
 testcase TC_ssnm_aspac_dava_aspia_duna() runs on RAW_M3UA_CT {
-       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
-       var integer pc0 := f_m3ua_cli_config(1).point_code;
-
        f_init_m3ua(ignore_ssnm := false);
        /* activate the first ASP */
        f_M3UA_asp_up_act(0);

+       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+       var integer pc0 := f_m3ua_cli_config(1).point_code;
+
        /* activate the second ASP */
        f_M3UA_asp_up_act(1, c_M3UA_TMT_override, omit);
        /* expect DAVA for PC of second ASP on first ASP */
@@ -970,8 +996,6 @@

 /* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP 
*/
 testcase TC_ssnm_distribution_dava_duna() runs on RAW_M3UA_CT {
-       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
-       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        /* some random point code whose availability we advertise */
        var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);

@@ -980,6 +1004,9 @@
        /* activate the first ASP */
        f_M3UA_asp_up_act(0);

+       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
        /* activate SG-role ASP (ASP on STP) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -997,8 +1024,6 @@

 /* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP 
*/
 testcase TC_ssnm_distribution_dava_duna_multipc() runs on RAW_M3UA_CT {
-       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
-       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        /* some random point code whose availability we advertise */
        var template (value) M3UA_Point_Codes adv_pcs := { ts_M3UA_PC(1234, 0), 
ts_M3UA_PC(5678, 0) };

@@ -1007,6 +1032,9 @@
        /* activate the first ASP */
        f_M3UA_asp_up_act(0);

+       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
        /* activate SG-role ASP (ASP on STP) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1024,8 +1052,6 @@

 /* Test if DUPU sent from SG to ASP-role STP gets forwarded to other ASP */
 testcase TC_ssnm_distribution_dupu() runs on RAW_M3UA_CT {
-       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
-       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        /* some random point code whose availability we advertise */
        var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);

@@ -1034,6 +1060,9 @@
        /* activate the first ASP */
        f_M3UA_asp_up_act(0);

+       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
        /* activate SG-role ASP (ASP on STP) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1046,8 +1075,6 @@

 /* Test if SCON sent from SG to ASP-role STP gets forwarded to other ASP */
 testcase TC_ssnm_distribution_scon() runs on RAW_M3UA_CT {
-       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
-       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
        /* some random point code whose availability we advertise */
        var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);

@@ -1056,6 +1083,9 @@
        /* activate the first ASP */
        f_M3UA_asp_up_act(0);

+       var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+       var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
        /* activate SG-role ASP (ASP on STP) */
        f_init_m3ua_srv();
        f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1189,30 +1219,30 @@
 }

 private function f_TC_m3ua_tcp(integer idx_a, integer idx_b) runs on 
RAW_M3UA_CT {
-       var M3uaConfig cfg_a := mp_m3ua_configs[idx_a];
-       var M3uaConfig cfg_b := mp_m3ua_configs[idx_b];
+       var M3uaConfig cfg_a := g_m3ua_configs[idx_a];
+       var M3uaConfig cfg_b := g_m3ua_configs[idx_b];
        var OCT4 rctx_a := int2oct(cfg_a.routing_ctx, 4);
        var OCT4 rctx_b := int2oct(cfg_b.routing_ctx, 4);
        var OCT4 pc_a := int2oct(cfg_a.point_code, 4);
        var OCT4 pc_b := int2oct(cfg_b.point_code, 4);

        /* establish connection with ASP 'A' */
-       if (idx_a < NR_M3UA) {
+       if (idx_a < g_m3ua_num_clients) {
                f_M3UA_asp_up_act(idx_a, rctx := rctx_a);
        } else {
                f_M3UA_CLNT_asp_up_act(idx_a, rctx := rctx_a);
        }

        /* establish connection with ASP 'B' */
-       if (idx_b < NR_M3UA) {
+       if (idx_b < g_m3ua_num_clients) {
                f_M3UA_asp_up_act(idx_b, rctx := rctx_b);
        } else {
                f_M3UA_CLNT_asp_up_act(idx_b, rctx := rctx_b);
        }

        /* In the case when ASP[idx_b] is configured as the client (i.e. 
osmo-stp connects to
-        * the testsuite; idx_b >= NR_M3UA), in f_M3UA_CLNT_asp_up_act() we're 
expecting to
-        * receive ASPACT and then sending ASPACT_ACK to it.  Right after that, 
we're sending
+        * the testsuite; idx_b >= g_m3ua_num_clients), in 
f_M3UA_CLNT_asp_up_act() we're expecting
+        * to receive ASPACT and then sending ASPACT_ACK to it.  Right after 
that, we're sending
         * some random data via ASP[idx_a], which we then expect to receive via 
ASP[idx_b].
         *
         * There is a chance that the random data sent via ASP[idx_a] would 
reach osmo-stp

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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a875bac5e9506be9140d5afa28da25bdc99a5a6
Gerrit-Change-Number: 39641
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillm...@sysmocom.de>
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>

Reply via email to