summaryrefslogtreecommitdiffstats
path: root/msc
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-07-06 23:11:32 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2018-07-24 14:19:42 +0200
commitafce86630ccc0d9a3c0f566fa1c935587bbe3770 (patch)
tree5eadbb8c5508a19831a987d6e55739f19e7f11ba /msc
parente4ff537f9baacc94242407041f30de1994316622 (diff)
Stop tests after failures
Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857
Diffstat (limited to 'msc')
-rw-r--r--msc/BSC_ConnectionHandler.ttcn26
-rw-r--r--msc/MSC_Tests.ttcn70
2 files changed, 59 insertions, 37 deletions
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 803cb4d..4e02d6c 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -109,7 +109,7 @@ function f_alg_from_mask(OCT1 mask_in) return integer {
private altstep as_Tguard() runs on BSC_ConnHdlr {
[] g_Tguard.timeout {
setverdict(fail, "Tguard timeout");
- self.stop;
+ mtc.stop;
}
}
@@ -183,7 +183,7 @@ runs on BSC_ConnHdlr {
[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
setverdict(fail, "DISC.ind from SCCP");
- self.stop;
+ mtc.stop;
}
}
}
@@ -294,7 +294,7 @@ function f_mm_common() runs on BSC_ConnHdlr
}
[] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) {
setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd");
- self.stop;
+ mtc.stop;
}
}
/* FIXME: Send the best available algorithm */
@@ -331,7 +331,7 @@ runs on BSC_ConnHdlr {
if (not ispresent(lu_acc.mobileIdentityTLV) or
not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) {
setverdict(fail, "Expected TMSI but no TMSI was allocated");
- self.stop;
+ mtc.stop;
} else {
g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets;
BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl));
@@ -340,13 +340,13 @@ runs on BSC_ConnHdlr {
if (ispresent(lu_acc.mobileIdentityTLV) and
ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) {
setverdict(fail, "Expected no TMSI but TMSI was allocated");
- self.stop;
+ mtc.stop;
}
}
}
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
setverdict(fail, "Expected LU ACK, but received LU REJ");
- self.stop;
+ mtc.stop;
}
}
/* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */
@@ -695,7 +695,7 @@ runs on BSC_ConnHdlr {
[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {}
[] T.timeout {
setverdict(fail, "Timeout waiting for START_DTMF_ind");
- self.stop;
+ mtc.stop;
}
}
@@ -704,7 +704,7 @@ runs on BSC_ConnHdlr {
alt {
[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {
setverdict(fail, "Received duplicate START_DTMF_ind");
- self.stop;
+ mtc.stop;
}
[] T.timeout { }
}
@@ -716,7 +716,7 @@ runs on BSC_ConnHdlr {
[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "3")) { }
[] T.timeout {
setverdict(fail, "Received duplicate START_DTMF_ind");
- self.stop;
+ mtc.stop;
}
}
@@ -732,13 +732,13 @@ altstep as_clear_cmd_compl_disc(float t := 5.0) runs on BSC_ConnHdlr {
}
[] BSSAP.receive {
setverdict(fail, "Unexpected BSSMAP while waiting for SCCP Release");
- self.stop;
+ mtc.stop;
}
}
}
[] BSSAP.receive {
setverdict(fail, "Unexpected BSSMAP while waiting for ClearCommand");
- self.stop;
+ mtc.stop;
}
}
@@ -750,7 +750,7 @@ function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr {
[] as_clear_cmd_compl_disc(t) { }
[] T.timeout {
setverdict(fail, "Timeout waiting for ClearCommand/Release");
- self.stop;
+ mtc.stop;
}
}
}
@@ -808,7 +808,7 @@ template (value) SmsParameters t_SmsPars(hexstring tp_daddr := '12345'H) := {
private altstep as_other_sms() runs on BSC_ConnHdlr {
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_SMS(?, ?, ?), ?)) {
setverdict(fail, "Unexpected SMS related PDU from MSC");
- self.stop;
+ mtc.stop;
}
}
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index a18b9b0..161744c 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -133,7 +133,7 @@ modulepar {
private altstep as_Tguard_direct() runs on MTC_CT {
[] Tguard_direct.timeout {
setverdict(fail, "Tguard timeout");
- self.stop;
+ mtc.stop;
}
}
@@ -213,7 +213,7 @@ function f_init_gsup(charstring id) runs on MTC_CT {
[] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { }
[] T.timeout {
setverdict(fail, "No connection to GSUP Port");
- self.stop
+ mtc.stop
}
}
}
@@ -226,7 +226,7 @@ function f_init(integer num_bsc := 1) runs on MTC_CT {
g_initialized := true;
if (num_bsc > NUM_BSC) {
- setverdict(fail, "excess number of BSC instances requested");
+ testcase.stop("excess number of BSC instances requested");
}
for (var integer i := 0; i < num_bsc; i := i + 1) {
@@ -234,7 +234,7 @@ function f_init(integer num_bsc := 1) runs on MTC_CT {
f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps);
f_bssap_start(g_bssap[i]);
} else {
- setverdict(fail, "missing BSSAP configuration");
+ testcase.stop("missing BSSAP configuration");
}
}
@@ -529,7 +529,7 @@ private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs
}
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) {
setverdict(fail, "Expecting LU REJ, but got ACCEPT");
- self.stop;
+ mtc.stop;
}
}
f_expect_clear();
@@ -558,7 +558,7 @@ private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars)
}
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) {
setverdict(fail, "Expecting LU REJ, but got ACCEPT");
- self.stop;
+ mtc.stop;
}
}
f_expect_clear();
@@ -605,11 +605,18 @@ runs on BSC_ConnHdlr {
alt {
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { }
//[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { }
- [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); }
+ [] BSSAP.receive {
+ setverdict(fail, "Received unexpected BSSAP");
+ mtc.stop;
+ }
[] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) {
setverdict(fail, "Unexpected GSUP UL REQ");
+ mtc.stop;
+ }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for CM SERV REQ");
+ mtc.stop;
}
- [] T.timeout { setverdict(fail, "Timeout waiting for CM SERV REQ"); }
}
f_expect_clear();
@@ -730,6 +737,7 @@ private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) run
/* See https://osmocom.org/issues/2862 */
[] BSSAP.receive(tr_BSSMAP_ClearCommand) {
setverdict(fail, "Got a second Clear Command, only one expected");
+ mtc.stop;
repeat;
}
[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {}
@@ -840,6 +848,7 @@ private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars par
}
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
setverdict(fail, "Expected LU ACK, but received REJ");
+ mtc.stop;
}
}
@@ -1127,7 +1136,7 @@ private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs
[] as_clear_cmd_compl_disc();
[] T.timeout {
setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release");
- self.stop;
+ mtc.stop;
}
}
setverdict(pass);
@@ -1161,7 +1170,7 @@ private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs
[] as_clear_cmd_compl_disc();
[] T.timeout {
setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release");
- self.stop;
+ mtc.stop;
}
}
setverdict(pass);
@@ -1305,7 +1314,10 @@ private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) r
timer T := 30.0;
T.start;
alt {
- [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for channel release");
+ mtc.stop;
+ }
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) {
BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id)));
repeat;
@@ -1317,7 +1329,10 @@ private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) r
* the current implementation, there is no recovery mechanism implemented
* and a DLCX can not be performed as the MSC does not know a specific
* endpoint yet. */
- [] MGCP.receive { setverdict(fail, "Unexpected MGCP message"); self.stop; }
+ [] MGCP.receive {
+ setverdict(fail, "Unexpected MGCP message");
+ mtc.stop;
+ }
[] as_clear_cmd_compl_disc();
}
}
@@ -1405,7 +1420,10 @@ private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) r
timer T := 30.0;
T.start;
alt {
- [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for channel release");
+ mtc.stop;
+ }
[] BSSAP.receive { repeat; }
[] MNCC.receive { repeat; }
[] GSUP.receive { repeat; }
@@ -1449,7 +1467,10 @@ private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_
timer T := 190.0;
T.start;
alt {
- [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for T310");
+ mtc.stop;
+ }
[] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) {
MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23))));
}
@@ -1496,7 +1517,7 @@ private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on
[] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { }
[] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) {
setverdict(fail, "Received GSUP Location Cancel Error");
- self.stop;
+ mtc.stop;
}
}
@@ -1508,7 +1529,7 @@ private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on
[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { }
[] BSSAP.receive {
setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ");
- self.stop;
+ mtc.stop;
}
}
setverdict(pass);
@@ -1581,11 +1602,11 @@ private function f_tc_lu_imsi_auth_tmsi_encr_3_1(charstring id, BSC_ConnHdlrPars
}
[] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) {
setverdict(fail, "CipherModeCommand despite no A5 intersection");
- self.stop;
+ mtc.stop;
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}
setverdict(pass);
@@ -1648,11 +1669,11 @@ private function f_tc_lu_imsi_auth_tmsi_encr_13_2(charstring id, BSC_ConnHdlrPar
}
[] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) {
setverdict(fail, "CipherModeCommand despite no A5 intersection");
- self.stop;
+ mtc.stop;
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}
setverdict(pass);
@@ -1764,6 +1785,7 @@ testcase TC_cr_before_reset() runs on MTC_CT {
[reset_ack_seen == true] T.timeout { setverdict(pass) }
[reset_ack_seen == false] T.timeout {
setverdict(fail, "no BSSMAP RESET ACK seen!");
+ mtc.stop;
}
}
}
@@ -1999,7 +2021,7 @@ function f_sm_ton_from_gsm(BIT3 ton) return SMPP_TON {
case ('110'B) { return abbreviated; }
}
setverdict(fail, "Unknown TON ", ton);
- self.stop;
+ mtc.stop;
}
/* convert GSM L3 NPI to SMPP_NPI enum */
function f_sm_npi_from_gsm(BIT4 npi) return SMPP_NPI {
@@ -2014,7 +2036,7 @@ function f_sm_npi_from_gsm(BIT4 npi) return SMPP_NPI {
case ('1010'B) { return ermes; }
}
setverdict(fail, "Unknown NPI ", npi);
- self.stop;
+ mtc.stop;
}
/* build a SMPP_SM from SmsParameters */
@@ -2154,7 +2176,7 @@ runs on BSC_ConnHdlr {
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}
@@ -2217,7 +2239,7 @@ runs on BSC_ConnHdlr {
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}