summaryrefslogtreecommitdiffstats
path: root/stp
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-07-23 11:01:06 +0200
committerlaforge <laforge@osmocom.org>2021-07-27 07:26:21 +0000
commitee02223e28b8c5d8f03f21a14374ba1bfd397a09 (patch)
treeea18c0b139002687c9c6de12941e4d18a5744eb1 /stp
parent326d78ed84847aca59d52233b8051a126683966c (diff)
stp: fix TC_rkm_unreg_active
Create the routing key dynamically, before trying to unregister it, so osmo-stp doesn't answer with ERR_NOT_REG instead of the expected ERR_ASP_ACTIVE. While at it, add missing clean up logic. Related: OS#4239 Change-Id: I31fcba85d23a8767eb0ceb513ff5b440558a475b
Diffstat (limited to 'stp')
-rw-r--r--stp/STP_Tests_M3UA.ttcn20
1 files changed, 16 insertions, 4 deletions
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 0bc398d5..13703d0c 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -637,9 +637,11 @@ testcase TC_rkm_unreg_registered() runs on RAW_M3UA_CT {
/* try to de-register a routing key for an active ASP -> ERROR */
testcase TC_rkm_unreg_active() runs on RAW_M3UA_CT {
- var OCT3 dpc := int2oct(mp_m3ua_configs[0].point_code, 3); // must match config
- var OCT4 rctx := int2oct(mp_m3ua_configs[0].routing_ctx, 4); // must match config
+ var OCT3 dpc := int2oct(123, 3);
+ var OCT4 rctx := int2oct(1234, 4);
+ f_init_common();
+ f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation dynamic-permitted");
f_init_m3ua();
/* first register the routing key */
@@ -647,12 +649,22 @@ testcase TC_rkm_unreg_active() runs on RAW_M3UA_CT {
/* then activate the ASP */
f_M3UA_asp_up_act(0);
+ f_M3UA_exp(0, tr_M3UA_DAVA({*}, rctx));
+ f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, c_M3UA_ST_I_AS_ACTIVE, *));
+ f_M3UA_exp(0, tr_M3UA_DAVA({*}, *));
- /* then try to de-regsiter */
+ /* then try to de-register -> ERR_ASP_ACTIVE */
f_M3UA_send(0, ts_M3UA_DEREG_REQ(ts_M3UA_routing_ctx(rctx)));
f_M3UA_exp(0, tr_M3UA_DEREG_RSP({tr_M3UA_dereg_res(?,c_m3UA_DEREGSTS_ERR_ASP_ACTIVE)}));
- /* FIXME: we now may have changed the state on the STP side! */
+ /* deactivate ASP and properly de-register to clean up */
+ f_M3UA_asp_inact(0);
+ f_M3UA_send(0, ts_M3UA_DEREG_REQ(ts_M3UA_routing_ctx(rctx)));
+ f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, c_M3UA_ST_I_AS_PENDING, *));
+ f_M3UA_exp(0, tr_M3UA_NOTIFY(c_M3UA_ST_T_STATE_CHG, c_M3UA_ST_I_AS_PENDING, *));
+ f_M3UA_exp(0, tr_M3UA_DEREG_RSP({tr_M3UA_dereg_res(?,c_m3UA_DEREGSTS_SUCCESS)}));
+
+ f_vty_config2(VTY, {"cs7 instance 0"}, "xua rkm routing-key-allocation static-only");
f_clear_m3ua();
}