fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email )
Change subject: stp: add testcases for M3UA-over-TCP
......................................................................
stp: add testcases for M3UA-over-TCP
Change-Id: I1e2a887aa22f317783b3207494fd707d7b426439
Related: docker-playground.git I210b7d62845075dcfe147f2f77603625cc1e64f9
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
M stp/expected-results.xml
2 files changed, 90 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 96cd268..a0162cb 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -1203,6 +1203,75 @@
f_clear_m3ua();
}
+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 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) {
+ 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) {
+ 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
+ * 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
+ * earlier than the ASPUP_ACK we sent for ASP[idx_b]. This is happening most of the
+ * times when running TC_m3ua_tcp_cli_srv. Using f_sleep() helps to avoid this. */
+ f_sleep(1.0);
+
+ /* M3UA/A -> M3UA/B */
+ f_test_traffic(idx_a, rctx_a, pc_a,
+ idx_b, rctx_b, pc_b);
+ /* M3UA/B -> M3UA/A */
+ f_test_traffic(idx_b, rctx_b, pc_b,
+ idx_a, rctx_a, pc_a);
+
+ f_clear_m3ua();
+}
+
+/* test routing between M3UA/SCTP (client) and M3UA/TCP (client) */
+testcase TC_m3ua_tcp_cli() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_TC_m3ua_tcp(0, 3); /* 'asp-sender' <-> 'asp-sender-tcp' */
+}
+
+/* test routing between M3UA/SCTP (client) and M3UA/TCP (server) */
+testcase TC_m3ua_tcp_cli_srv() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_init_m3ua_srv();
+ f_TC_m3ua_tcp(0, M3UA_SRV(3)); /* 'asp-sender' <->
'asp-client-tcp' */
+}
+
+/* test routing between M3UA/SCTP (server) and M3UA/TCP (server) */
+testcase TC_m3ua_tcp_srv() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_init_m3ua_srv();
+ f_TC_m3ua_tcp(M3UA_SRV(0), M3UA_SRV(3)); /* 'asp-client' <->
'asp-client-tcp' */
+}
+
+/* test routing between M3UA/SCTP (server) and M3UA/TCP (client) */
+testcase TC_m3ua_tcp_srv_cli() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_init_m3ua_srv();
+ f_TC_m3ua_tcp(M3UA_SRV(0), 3); /* 'asp-client' <->
'asp-sender-tcp' */
+}
+
control {
/* M3UA Tests */
@@ -1218,6 +1287,11 @@
execute( TC_tmt_broadcast() );
execute( TC_act_rctx_data_no_rctx() );
+ execute( TC_m3ua_tcp_cli() );
+ execute( TC_m3ua_tcp_cli_srv() );
+ execute( TC_m3ua_tcp_srv() );
+ execute( TC_m3ua_tcp_srv_cli() );
+
/* M3UA RKM tests */
execute( TC_rkm_reg_static_notpermitted() );
execute( TC_rkm_reg_static_permitted() );
diff --git a/stp/expected-results.xml b/stp/expected-results.xml
index 0f6073b..fdb4e44 100644
--- a/stp/expected-results.xml
+++ b/stp/expected-results.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<testsuite name='STP_Tests' tests='46' failures='0'
errors='0' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='STP_Tests' tests='50' failures='0'
errors='0' skipped='0' inconc='0' time='MASKED'>
<testcase classname='STP_Tests_M3UA' name='TC_connect_asp_up'
time='MASKED'/>
<testcase classname='STP_Tests_M3UA' name='TC_beat'
time='MASKED'/>
<testcase classname='STP_Tests_M3UA' name='TC_beat_payload'
time='MASKED'/>
@@ -11,6 +11,10 @@
<testcase classname='STP_Tests_M3UA' name='TC_tmt_loadshare'
time='MASKED'/>
<testcase classname='STP_Tests_M3UA' name='TC_tmt_broadcast'
time='MASKED'/>
<testcase classname='STP_Tests_M3UA' name='TC_act_rctx_data_no_rctx'
time='MASKED'/>
+ <testcase classname='STP_Tests_M3UA' name='TC_m3ua_tcp_cli'
time='MASKED'/>
+ <testcase classname='STP_Tests_M3UA' name='TC_m3ua_tcp_cli_srv'
time='MASKED'/>
+ <testcase classname='STP_Tests_M3UA' name='TC_m3ua_tcp_srv'
time='MASKED'/>
+ <testcase classname='STP_Tests_M3UA' name='TC_m3ua_tcp_srv_cli'
time='MASKED'/>
<testcase classname='STP_Tests_M3UA'
name='TC_rkm_reg_static_notpermitted' time='MASKED'/>
<testcase classname='STP_Tests_M3UA'
name='TC_rkm_reg_static_permitted' time='MASKED'/>
<testcase classname='STP_Tests_M3UA'
name='TC_rkm_reg_dynamic_permitted' time='MASKED'/>
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36150?usp=email
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: I1e2a887aa22f317783b3207494fd707d7b426439
Gerrit-Change-Number: 36150
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged