pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29325 )
Change subject: hnbgw: Introduce test TC_hnb_reregister_reuse_sctp_assoc ......................................................................
hnbgw: Introduce test TC_hnb_reregister_reuse_sctp_assoc
Change-Id: I7386bd4e786daf2688a68ab174a9d4f0b093a741 --- M hnbgw/HNBGW_Tests.ttcn M library/hnbap/HNBAP_Templates.ttcn 2 files changed, 36 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index f3079da..19df73e 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -688,6 +688,18 @@ f_shutdown_helper(); }
+/* Drop HNBAP conn (HNBAP DEREG) and reconnect it (HNBAP REG) using same SCTP association. + * Related: OS#5676, SYS#6113 */ +testcase TC_hnb_reregister_reuse_sctp_assoc() runs on test_CT { + g_num_hnbs := 1; + f_init(); + f_hnbap_register(0); + HNBAP[0].send(ts_HNBAP_HNBDe_Register(ts_HnbapCause(unspecified))); + f_hnbap_register(0); + f_verify_talloc_count(HNBGWVTY, {"struct hnb_context"}, expect_count := 1); + f_shutdown_helper(); +} + /*********************************************************************** * RUA / RANAP Testing ***********************************************************************/ @@ -1368,6 +1380,9 @@ execute(TC_ranap_cs_mo_disconnect()); execute(TC_ranap_ps_mo_disconnect()); execute(TC_ps_rab_assignment()); + + /* Run at the end since it makes osmo-hnbgw <= 1.3.0 crash: OS#5676 */ + execute(TC_hnb_reregister_reuse_sctp_assoc()); }
} diff --git a/library/hnbap/HNBAP_Templates.ttcn b/library/hnbap/HNBAP_Templates.ttcn index 89edf76..2576d17 100644 --- a/library/hnbap/HNBAP_Templates.ttcn +++ b/library/hnbap/HNBAP_Templates.ttcn @@ -232,4 +232,25 @@ } }
+/* 9.1.9 HNB DE-REGISTER */ +template (value) HNBAP_PDU +ts_HNBAP_HNBDe_Register(template (value) Cause cause) := { + initiatingMessage := { + procedureCode := id_HNBDe_Register, + criticality := reject, + value_ := { + HNBDe_Register := { + protocolIEs := { + { + id := HNBAP_Constants.id_Cause, + criticality := ignore, + value_ := { Cause := cause } + } + }, + protocolExtensions := omit /* TODO: BackoffTimer */ + } + } + } +} + }