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
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 @@
private altstep as_Tguard() runs on BSC_ConnHdlr {
[] g_Tguard.timeout {
setverdict(fail, "Tguard timeout");
- self.stop;
+ mtc.stop;
}
}
@@ -183,7 +183,7 @@
[] 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 @@
}
[] 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 @@
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 @@
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 @@
[] 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 @@
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 @@
[] 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 @@
}
[] 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 @@
[] as_clear_cmd_compl_disc(t) { }
[] T.timeout {
setverdict(fail, "Timeout waiting for ClearCommand/Release");
- self.stop;
+ mtc.stop;
}
}
}
@@ -808,7 +808,7 @@
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 @@
private altstep as_Tguard_direct() runs on MTC_CT {
[] Tguard_direct.timeout {
setverdict(fail, "Tguard timeout");
- self.stop;
+ mtc.stop;
}
}
@@ -213,7 +213,7 @@
[] 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 @@
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 @@
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 @@
}
[] 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 @@
}
[] 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 @@
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"); }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for CM SERV REQ");
+ mtc.stop;
+ }
}
f_expect_clear();
@@ -730,6 +737,7 @@
/* 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 @@
}
[] 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 @@
[] 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 @@
[] 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 @@
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 @@
* 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 @@
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 @@
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 @@
[] 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 @@
[] 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 @@
}
[] 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 @@
}
[] 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 @@
[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 @@
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 @@
case ('1010'B) { return ermes; }
}
setverdict(fail, "Unknown NPI ", npi);
- self.stop;
+ mtc.stop;
}
/* build a SMPP_SM from SmsParameters */
@@ -2154,7 +2176,7 @@
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}
@@ -2217,7 +2239,7 @@
}
[] BSSAP.receive {
setverdict(fail, "Unknown/unexpected BSSAP received");
- self.stop;
+ mtc.stop;
}
}