pespin has uploaded this change for review.

View Change

hnbgw: Move normal condition Iu Release procedure to helper function

Change-Id: I5dc7923b78d1b98fea1f71aa6e39c41f70b1f3e6
---
M hnbgw/ConnHdlr.ttcn
M hnbgw/HNBGW_Tests.ttcn
2 files changed, 38 insertions(+), 51 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/38596/1
diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn
index 47dbd21..1b053d0 100644
--- a/hnbgw/ConnHdlr.ttcn
+++ b/hnbgw/ConnHdlr.ttcn
@@ -542,6 +542,36 @@
return valueof(ts_RANAP_RabAssResp(rab_sml));
}

+/* HNB <- CN: Iu-ReleaseCmd, HNB -> CN: Iu-ReleaseCompl */
+function f_cn_iu_release_procedure(boolean mgcp_teardown := false, boolean pfcp_teardown := false) runs on ConnHdlr {
+ var RANAP_PDU tx;
+ timer T := 5.0;
+
+ tx := valueof(ts_RANAP_IuReleaseCommand(g_pars.rab_rel_cause));
+ f_iu2iuh(tx);
+
+ if (mgcp_teardown) {
+ T.start;
+ alt {
+ [] as_mgcp_dlcx() {}
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for DLCX");
+ }
+ }
+ T.stop;
+ }
+ if (pfcp_teardown) {
+ var PDU_PFCP m;
+ m := f_pfcp_expect(tr_PFCP_Session_Del_Req(g_pars.pfcp_pars.up_f_seid.seid));
+ PFCP.send(ts_PFCP_Session_Del_Resp(m.sequence_number, g_pars.pfcp_pars.hnbgw_f_seid.seid));
+ /* ask PFCPEM to *not* route PDUs with this specific SEID to us */
+ f_PFCPEM_unsubscribe_seid(c_SEID1);
+ }
+
+ tx := valueof(ts_RANAP_IuReleaseComplete());
+ f_iuh2iu_disconnect(tx, RUA_IEs.Cause:{radioNetwork:=normal});
+}
+
/* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters.
* Return true when an OK reply was sent, false otherwise.
* Count occurrence of Osmux, include Osmux parameters in the reply if necessary. */
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index c422ba2..c917816 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -1007,21 +1007,7 @@
};
f_statsd_expect(expect);

- /* Send Iu Release */
- tx := valueof(ts_RANAP_IuReleaseCommand(g_pars.rab_rel_cause));
- f_iu2iuh(tx);
-
- T.start;
- alt {
- [] as_mgcp_dlcx() {}
- [] T.timeout {
- setverdict(fail, "Timeout waiting for DLCX");
- }
- }
- T.stop
-
- tx := valueof(ts_RANAP_IuReleaseComplete());
- f_iuh2iu(tx);
+ f_cn_iu_release_procedure(mgcp_teardown := true);
}

testcase TC_rab_assignment() runs on test_CT {
@@ -1198,12 +1184,7 @@
}
}

- /* Send Iu Release */
- tx := valueof(ts_RANAP_IuReleaseCommand(g_pars.rab_rel_cause));
- f_iu2iuh(tx);
-
- tx := valueof(ts_RANAP_IuReleaseComplete());
- f_iuh2iu(tx);
+ f_cn_iu_release_procedure();
}

testcase TC_rab_assign_mgcp_to() runs on test_CT {
@@ -1273,12 +1254,12 @@
/* HNB->MSC: InitialUE */
f_iuh2iu_connect(f_build_initial_ue(g_pars));

+ g_pars.rab_rel_cause := valueof(ts_RanapCause_radio_conn_release);
+
/* HNB->MSC: Request CN to start Iu-Release procedure: */
- f_iuh2iu(ts_RANAP_IuReleaseRequest(ts_RanapCause_radio_conn_release));
+ f_iuh2iu(ts_RANAP_IuReleaseRequest(g_pars.rab_rel_cause));
/* HNB<-MSC: CN starts Iu-Release procedure: */
- f_iu2iuh(ts_RANAP_IuReleaseCommand(ts_RanapCause_radio_conn_release));
- /* HNB->MSC: RUA disconnect */
- f_iuh2iu_disconnect(ts_RANAP_IuReleaseComplete, RUA_IEs.Cause:{misc:=processing_overload});
+ f_cn_iu_release_procedure();
}
testcase TC_ranap_cs_mo_disconnect() runs on test_CT {
var ConnHdlr vc_conn;
@@ -1396,18 +1377,7 @@
f_create_rab_ps();
f_sleep(2.0);

- tx := valueof(ts_RANAP_IuReleaseCommand(g_pars.rab_rel_cause));
- f_iu2iuh(tx);
- tx := valueof(ts_RANAP_IuReleaseComplete());
- f_iuh2iu(tx);
-
- if (g_pars.pfcp_pars.pfcp_enabled) {
- var PDU_PFCP m;
- m := f_pfcp_expect(tr_PFCP_Session_Del_Req(g_pars.pfcp_pars.up_f_seid.seid));
- PFCP.send(ts_PFCP_Session_Del_Resp(m.sequence_number, g_pars.pfcp_pars.hnbgw_f_seid.seid));
- /* ask PFCPEM to *not* route PDUs with this specific SEID to us */
- f_PFCPEM_unsubscribe_seid(c_SEID1);
- }
+ f_cn_iu_release_procedure(pfcp_teardown := g_pars.pfcp_pars.pfcp_enabled);
}

testcase TC_ps_rab_assignment() runs on test_CT {
@@ -2247,20 +2217,7 @@
f_bssap_expect(tx);

/* Send Iu Release */
- tx := valueof(ts_RANAP_IuReleaseCommand(g_pars.rab_rel_cause));
- f_iu2iuh(tx);
-
- T.start;
- alt {
- [] as_mgcp_dlcx() {}
- [] T.timeout {
- setverdict(fail, "Timeout waiting for DLCX");
- }
- }
- T.stop;
-
- tx := valueof(ts_RANAP_IuReleaseComplete());
- f_iuh2iu(tx);
+ f_cn_iu_release_procedure(mgcp_teardown := true);
}

testcase TC_second_rab_assignment() runs on test_CT {

To view, visit change 38596. To unsubscribe, or for help writing mail filters, visit settings.

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