pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39647?usp=email )


Change subject: stp: Introduce tests TC_dyn_(2)asp_as_rkm_permitted
......................................................................

stp: Introduce tests TC_dyn_(2)asp_as_rkm_permitted

These tests allows testing behavior of scenarios related to dynamic
ASP/AS/RKM improved/fixed in libosmo-sigtran.git Change-Ids:
I986044944282cea9a13ed59424f2220fee6fe567
I85948ab98623a8a53521eb2d2e84244011b39a93
I3dffa2e9c554f03c7c721b757ff33a89961665b5

Change-Id: Ic3116cbe63832003876ae19b31491275aebb41a9
---
M stp/STP_Tests_M3UA.ttcn
M stp/expected-results.xml
2 files changed, 109 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/47/39647/1

diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 674097a..c3598d3 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -815,6 +815,109 @@
        f_clear_m3ua();
 }

+/* RFC 4666 5.1.1.2 "Single ASP in Application Server ("1+0" Sparing), Dynamic 
Registration" */
+testcase TC_dyn_asp_as_rkm_permitted() runs on RAW_M3UA_CT {
+       /* Pick ports not configured in osmo-stp for any ASP: */
+       var M3uaConfigs m3ua_configs := {
+               {
+                       use_tcp := false,
+                       remote_port := 2905,
+                       local_port := 2222,
+                       point_code := 22,
+                       routing_ctx := 220
+               }
+       };
+       var OCT4 rctx0 := int2oct(m3ua_configs[0].routing_ctx, 4);
+       f_init_common();
+       f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation 
dynamic-permitted");
+       f_init_m3ua(m3ua_configs := m3ua_configs, m3ua_num_clients := 1, 
m3ua_num_servers := 0);
+
+       /* ASPUP + ACK */
+       f_M3UA_asp_up(0);
+
+       /* REG REQ + RESP */
+       f_M3UA_send(0, ts_M3UA_REG_REQ({ts_M3UA_rkey(id:='00000001'O,
+                                                    
dpc:=int2oct(m3ua_configs[0].point_code, 3),
+                                                    tmt := 
c_M3UA_TMT_loadshare,
+                                                    rctx := rctx0)}));
+       f_M3UA_exp(0, tr_M3UA_REG_RSP({tr_M3UA_reg_res(id:='00000001'O, 
status:=c_M3UA_REGSTS_SUCCESS,
+                                                      rctx:=rctx0)}));
+       f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_INACTIVE, *));
+
+       /* ASPAC + ACK */
+       f_M3UA_asp_act(0, c_M3UA_TMT_loadshare, rctx0);
+       f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_ACTIVE, *));
+
+       f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation 
static-only");
+       f_clear_m3ua();
+}
+
+/* RFC 4666 5.1.3 "Two ASPs in an Application Server ("1+1" Sparing, 
Loadsharing Case)" */
+testcase TC_dyn_2asp_as_rkm_permitted() runs on RAW_M3UA_CT {
+       /* Pick ports not configured in osmo-stp for any ASP: */
+       var M3uaConfigs m3ua_configs := {
+               {
+                       use_tcp := false,
+                       remote_port := 2905,
+                       local_port := 2222,
+                       point_code := 22,
+                       routing_ctx := 220
+               }, {
+                       use_tcp := false,
+                       remote_port := 2905,
+                       local_port := 2223,
+                       point_code := 22,
+                       routing_ctx := 220
+               }
+       };
+       var OCT4 rctx0 := int2oct(m3ua_configs[0].routing_ctx, 4);
+       var OCT4 rctx1 := int2oct(m3ua_configs[0].routing_ctx, 4);
+       f_init_common();
+       f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation 
dynamic-permitted");
+       f_init_m3ua(m3ua_configs := m3ua_configs, m3ua_num_clients := 2, 
m3ua_num_servers := 0);
+
+       ///////// ASP 0 /////////////
+       /* ASPUP + ACK */
+       f_M3UA_asp_up(0);
+
+       /* REG REQ + RESP */
+       f_M3UA_send(0, ts_M3UA_REG_REQ({ts_M3UA_rkey(id:='00000001'O,
+                                                    
dpc:=int2oct(m3ua_configs[0].point_code, 3),
+                                                    tmt := 
c_M3UA_TMT_loadshare,
+                                                    rctx := rctx0)}));
+       f_M3UA_exp(0, tr_M3UA_REG_RSP({tr_M3UA_reg_res(id:='00000001'O, 
status:=c_M3UA_REGSTS_SUCCESS,
+                                                      rctx:=rctx0)}));
+       f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_INACTIVE, *));
+
+       /* ASPAC + ACK */
+       f_M3UA_asp_act(0, c_M3UA_TMT_loadshare, rctx0);
+       f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_ACTIVE, *));
+
+       ///////// ASP 1 /////////////
+       /* ASPUP + ACK */
+       f_M3UA_asp_up(1);
+
+       /* REG REQ + RESP */
+       f_M3UA_send(1, ts_M3UA_REG_REQ({ts_M3UA_rkey(id:='00000001'O,
+                                                    
dpc:=int2oct(m3ua_configs[1].point_code, 3),
+                                                    tmt := 
c_M3UA_TMT_loadshare,
+                                                    rctx := rctx1)}));
+       f_M3UA_exp(1, tr_M3UA_REG_RSP({tr_M3UA_reg_res(id:='00000001'O, 
status:=c_M3UA_REGSTS_SUCCESS,
+                                                      rctx:=rctx1)}));
+       /* See RFC4666 4.3.4.5: There's a NOTIFY sent to this ASP after
+        * ASPUP+ASPUP-ACK to let it know AS state. */
+       f_M3UA_exp(1, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_ACTIVE, *));
+
+       /* ASPAC + ACK */
+       f_M3UA_asp_act(1, c_M3UA_TMT_loadshare, rctx1);
+       /* See RFC 4666 5.1.4: No NOTIFY is sent because there's no state 
change.
+        * f_M3UA_exp(1, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, 
c_M3UA_ST_I_AS_ACTIVE, *));
+        */
+
+       f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation 
static-only");
+       f_clear_m3ua();
+}
+
 /***********************************************************************
  * Test the STP in M3UA ASP role (we are SG)
  ***********************************************************************/
@@ -1333,6 +1436,10 @@
        /* TODO: register/unregister multiple routing contexts in one message; 
including mixed
                 success/failure situations */

+       /* test dynamic ASP & AS with dynamic RKM */
+       execute( TC_dyn_asp_as_rkm_permitted() );
+       execute( TC_dyn_2asp_as_rkm_permitted() );
+
        /* Test STP as SCTP client + M3UA ASP role */
        execute( TC_clnt_connect_asp_up() );
        execute( TC_clnt_asp_act() );
diff --git a/stp/expected-results.xml b/stp/expected-results.xml
index fdb4e44..bc9c861 100644
--- a/stp/expected-results.xml
+++ b/stp/expected-results.xml
@@ -22,6 +22,8 @@
   <testcase classname='STP_Tests_M3UA' name='TC_rkm_unreg_invalid' 
time='MASKED'/>
   <testcase classname='STP_Tests_M3UA' name='TC_rkm_unreg_registered' 
time='MASKED'/>
   <testcase classname='STP_Tests_M3UA' name='TC_rkm_unreg_active' 
time='MASKED'/>
+  <testcase classname='STP_Tests_M3UA' name='TC_dyn_asp_as_rkm_permitted' 
time='MASKED'/>
+  <testcase classname='STP_Tests_M3UA' name='TC_dyn_2asp_as_rkm_permitted' 
time='MASKED'/>
   <testcase classname='STP_Tests_M3UA' name='TC_clnt_connect_asp_up' 
time='MASKED'/>
   <testcase classname='STP_Tests_M3UA' name='TC_clnt_asp_act' time='MASKED'/>
   <testcase classname='STP_Tests_M3UA' name='TC_clnt_sg_to_asp' time='MASKED'/>

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

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

Reply via email to