Change in ...osmo-ttcn3-hacks[master]: msc: check IMEI: move reject LU into new function

osmith gerrit-no-reply at lists.osmocom.org
Tue Jul 23 11:55:15 UTC 2019


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14901


Change subject: msc: check IMEI: move reject LU into new function
......................................................................

msc: check IMEI: move reject LU into new function

Change-Id: Ifad259e21df035a89e97831a57c0675502308eb6
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 22 insertions(+), 48 deletions(-)



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

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index e951400..1e5e2d5 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -642,6 +642,24 @@
 	setverdict(pass);
 }
 
+function f_reject_lu() runs on BSC_ConnHdlr {
+	var PDU_DTAP_MT dtap_mt;
+	timer T := 5.0;
+
+	T.start;
+	alt {
+	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
+		setverdict(pass);
+		}
+	[] BSSAP.receive(tr_PDU_DTAP_MT(?)) -> value dtap_mt {
+		setverdict(fail, "Expected LU reject BSSAP message, got: ", dtap_mt);
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for LU reject");
+		}
+	}
+}
+
 function f_foo() runs on BSC_ConnHdlr{
 	/* SCCP CC handled by RAN_Emulation_CT.main() */
 	/* Expect auth, if enabled */
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 15ff17c..e6aaf9f 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -5601,7 +5601,6 @@
 
 private function f_tc_lu_imsi_auth_tmsi_check_imei_nack(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var PDU_ML3_MS_NW l3_lu;
-	var PDU_DTAP_MT dtap_mt;
 
 	pars.net.expect_auth := true;
 	pars.net.expect_imei := true;
@@ -5617,17 +5616,7 @@
 	f_mm_common();
 	f_msc_lu_hlr();
 	f_mm_imei();
-
-	/* Expect reject */
-	alt {
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
-		setverdict(pass);
-		}
-	[] BSSAP.receive(tr_PDU_DTAP_MT(?)) -> value dtap_mt {
-		setverdict(fail, "Expected LU reject BSSAP message, got: ", dtap_mt);
-		mtc.stop;
-		}
-	}
+	f_reject_lu();
 	f_expect_clear();
 }
 testcase TC_lu_imsi_auth_tmsi_check_imei_nack() runs on MTC_CT {
@@ -5642,7 +5631,6 @@
 
 private function f_tc_lu_imsi_auth_tmsi_check_imei_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var PDU_ML3_MS_NW l3_lu;
-	var PDU_DTAP_MT dtap_mt;
 
 	pars.net.expect_auth := true;
 	pars.net.expect_imei := true;
@@ -5658,17 +5646,7 @@
 	f_mm_common();
 	f_msc_lu_hlr();
 	f_mm_imei();
-
-	/* Expect reject */
-	alt {
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
-		setverdict(pass);
-		}
-	[] BSSAP.receive(tr_PDU_DTAP_MT(?)) -> value dtap_mt {
-		setverdict(fail, "Expected LU reject BSSAP message, got: ", dtap_mt);
-		mtc.stop;
-		}
-	}
+	f_reject_lu();
 	f_expect_clear();
 }
 testcase TC_lu_imsi_auth_tmsi_check_imei_err() runs on MTC_CT {
@@ -5746,7 +5724,6 @@
 
 private function f_tc_lu_imsi_auth_tmsi_check_imei_early_nack(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var PDU_ML3_MS_NW l3_lu;
-	var PDU_DTAP_MT dtap_mt;
 
 	pars.net.expect_auth := true;
 	pars.net.expect_imei_early := true;
@@ -5760,17 +5737,7 @@
 	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
 
 	f_mm_imei_early();
-
-	/* Expect reject */
-	alt {
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
-		setverdict(pass);
-		}
-	[] BSSAP.receive(tr_PDU_DTAP_MT(?)) -> value dtap_mt {
-		setverdict(fail, "Expected LU reject BSSAP message, got: ", dtap_mt);
-		mtc.stop;
-		}
-	}
+	f_reject_lu();
 	f_expect_clear();
 }
 testcase TC_lu_imsi_auth_tmsi_check_imei_early_nack() runs on MTC_CT {
@@ -5785,7 +5752,6 @@
 
 private function f_tc_lu_imsi_auth_tmsi_check_imei_early_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var PDU_ML3_MS_NW l3_lu;
-	var PDU_DTAP_MT dtap_mt;
 
 	pars.net.expect_auth := true;
 	pars.net.expect_imei_early := true;
@@ -5799,17 +5765,7 @@
 	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
 
 	f_mm_imei_early();
-
-	/* Expect reject */
-	alt {
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
-		setverdict(pass);
-		}
-	[] BSSAP.receive(tr_PDU_DTAP_MT(?)) -> value dtap_mt {
-		setverdict(fail, "Expected LU reject BSSAP message, got: ", dtap_mt);
-		mtc.stop;
-		}
-	}
+	f_reject_lu();
 	f_expect_clear();
 }
 testcase TC_lu_imsi_auth_tmsi_check_imei_early_err() runs on MTC_CT {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14901
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: Ifad259e21df035a89e97831a57c0675502308eb6
Gerrit-Change-Number: 14901
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190723/86b731dc/attachment.html>


More information about the gerrit-log mailing list