From e4ff537f9baacc94242407041f30de1994316622 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 5 Jul 2018 17:35:03 +0200 Subject: library: Ensure setverdict(fail) is followed by mtc.stop This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Using testcase.stop instead for errors internal to our test infrastructure to mark them as test errors instead of failed. Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 --- library/BSSAP_Adapter.ttcn | 2 +- library/BSSGP_Emulation.ttcn | 19 ++++++------ library/BSSMAP_Emulation.ttcn | 58 +++++++++++++++++-------------------- library/GSM_Types.ttcn | 1 + library/GSUP_Emulation.ttcn | 24 +++++++-------- library/GTP_Emulation.ttcn | 10 +++---- library/GTP_Templates.ttcn | 3 +- library/IPA_Emulation.ttcnpp | 6 ++-- library/IuUP_Emulation.ttcn | 5 ++++ library/L1CTL_PortType.ttcn | 16 +++++----- library/L3_Common.ttcn | 2 +- library/LAPDm_RAW_PT.ttcn | 4 +-- library/MGCP_Emulation.ttcn | 31 ++++++++++---------- library/MGCP_Templates.ttcn | 2 +- library/MNCC_Emulation.ttcn | 33 ++++++++++----------- library/MNCC_Types.ttcn | 2 +- library/NS_Emulation.ttcn | 2 +- library/Osmocom_CTRL_Adapter.ttcn | 2 +- library/Osmocom_CTRL_Functions.ttcn | 7 +++++ library/Osmocom_Types.ttcn | 2 -- library/Osmocom_VTY_Functions.ttcn | 6 ++-- library/PCUIF_CodecPort.ttcn | 6 ++-- library/RSL_Emulation.ttcn | 9 +++--- library/RTP_Emulation.ttcn | 10 ++++--- library/SIP_Emulation.ttcn | 17 ++++++----- library/SMPP_Emulation.ttcn | 16 +++++----- library/TRXC_CodecPort.ttcn | 1 + 27 files changed, 148 insertions(+), 148 deletions(-) (limited to 'library') diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index e50487dc..b29d03f0 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -144,7 +144,7 @@ function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charst } case else { setverdict(fail, "Unsuppored BSSAP_Transport"); - self.stop; + mtc.stop; } } diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index f51d5393..8b3b9eb5 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -288,8 +288,7 @@ runs on BSSGP_CT { return; } } - setverdict(fail, "Client Table full"); - self.stop; + testcase.stop("Client Table full"); } private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT { @@ -299,7 +298,7 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs if (ClientTable[i].comp_ref != vc_conn) { setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ", ClientTable[i].comp_ref, " from ", vc_conn); - self.stop; + mtc.stop; } log("Removing Client IMSI=", imsi, ", index=", i); ClientTable[i] := { @@ -313,7 +312,7 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs } } setverdict(fail, "Could not find client for IMSI ", imsi); - self.stop; + mtc.stop; } /* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ @@ -344,7 +343,7 @@ private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSG } } setverdict(fail, "Couldn't find Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT { @@ -357,7 +356,7 @@ private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Cli } } setverdict(fail, "Couldn't find Component for TLLI ", tlli); - self.stop; + mtc.stop; } private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer { @@ -368,7 +367,7 @@ private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT re } } setverdict(fail, "Couldn't find Client for Component ", comp_ref); - self.stop; + mtc.stop; } private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 { @@ -380,7 +379,7 @@ private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT r } } setverdict(fail, "Couldn't find TLLI for Component ", comp_ref); - self.stop; + mtc.stop; } altstep as_allstate() runs on BSSGP_CT { @@ -590,7 +589,7 @@ private function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 { return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mo); - self.stop; + mtc.stop; } private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 { @@ -602,7 +601,7 @@ private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 { return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mt); - self.stop; + mtc.stop; } diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index e65c5501..921ac59b 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -202,9 +202,8 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); + mtc.stop; } /* resolve component reference by CIC */ @@ -216,9 +215,8 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by MGCP Transaction ID ", tid); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by MGCP Transaction ID ", tid); + mtc.stop; } private function f_comp_store_mgcp_tid(BSSAP_ConnHdlr client, MgcpTransId tid) @@ -230,9 +228,8 @@ runs on BSSMAP_Emulation_CT { return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_comp_by_cic(integer cic) @@ -243,9 +240,8 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by CIC ", cic); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by CIC ", cic); + mtc.stop; } private function f_comp_store_cic(BSSAP_ConnHdlr client, integer cic) @@ -257,8 +253,8 @@ runs on BSSMAP_Emulation_CT { return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve connection ID by component reference */ @@ -269,9 +265,8 @@ runs on BSSMAP_Emulation_CT return integer { return ConnectionTable[i].sccp_conn_id; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve ConnectionTable index component reference */ @@ -282,9 +277,8 @@ runs on BSSMAP_Emulation_CT return integer { return i; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_gen_conn_id() @@ -325,9 +319,7 @@ runs on BSSMAP_Emulation_CT { return; } } - log("BSSMAP Connection table full!"); - setverdict(fail); - self.stop; + testcase.stop("BSSMAP Connection table full!"); } private function f_conn_table_del(integer sccp_conn_id) @@ -341,9 +333,8 @@ runs on BSSMAP_Emulation_CT { return } } - log("BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); + mtc.stop; } private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) @@ -501,7 +492,8 @@ private function f_bssap_wait_for_reset() runs on BSSMAP_Emulation_CT { repeat; } [] T.timeout { - setverdict(fail); + setverdict(fail, "Timeout waiting for BSSAP RESET"); + mtc.stop; } } } @@ -517,7 +509,10 @@ function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on BSSM } [] as_reset_ack(); [] BSSAP.receive { repeat }; - [] T.timeout { setverdict(fail, "Waiting for RESET-ACK after sending RESET"); } + [] T.timeout { + setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; + } } } @@ -763,6 +758,7 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { if (not ischosen(conn_ind.userData.pdu.bssmap.completeLayer3Information)) { setverdict(fail, "N-CONNECT.ind with L3 != COMPLETE L3"); + mtc.stop; return ret; } l3_info := conn_ind.userData.pdu.bssmap.completeLayer3Information.layer3Information.layer3info; @@ -782,6 +778,7 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { } } setverdict(fail, "Couldn't find Expect for incoming connection ", conn_ind); + mtc.stop; return ret; } @@ -796,7 +793,7 @@ runs on BSSMAP_Emulation_CT { return; } } - setverdict(fail, "No space left in ExpectTable"); + testcase.stop("No space left in ExpectTable"); } private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) @@ -810,8 +807,7 @@ runs on BSSMAP_Emulation_CT { return; } } - setverdict(fail, "No space left in ImsiTable"); - self.stop; + testcase.stop("No space left in ImsiTable"); } diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 2000b4a3..59ccb763 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -34,6 +34,7 @@ module GSM_Types { case (CS3) { return 52 } case else { setverdict(fail, "Invalid GPRS CS ", cs); + mtc.stop; return -1; } } diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn index 7cf16568..86859baa 100644 --- a/library/GSUP_Emulation.ttcn +++ b/library/GSUP_Emulation.ttcn @@ -98,9 +98,8 @@ runs on GSUP_Emulation_CT return GSUP_ConnHdlr { return GsupImsiTable[i].comp_ref; } } - log("GSUP IMSI table not found by IMSI ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by IMSI ", imsi); + mtc.stop; } /* resolve connection ID by component reference */ @@ -111,9 +110,8 @@ runs on GSUP_Emulation_CT return charstring { return GsupImsiTable[i].imsi; } } - log("GSUP IMSI table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by component ", client); + mtc.stop; } private function f_imsi_table_init() @@ -142,9 +140,7 @@ runs on GSUP_Emulation_CT { return; } } - log("GSUP IMSI table full!"); - setverdict(fail); - self.stop; + testcase.stop("GSUP IMSI table full!"); } private function f_imsi_table_del(charstring imsi) @@ -158,9 +154,8 @@ runs on GSUP_Emulation_CT { return } } - log("GSUP IMSI table attempt to delete non-existant ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table attempt to delete non-existant ", imsi); + mtc.stop; } @@ -190,7 +185,7 @@ function main(GsupOps ops, charstring id) runs on GSUP_Emulation_CT { [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_UP}) { repeat; } [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_DOWN}) { setverdict(fail, "GSUP Connection Lost"); - self.stop; + mtc.stop; } /* GSUP -> Client: call related messages */ @@ -272,6 +267,7 @@ runs on GSUP_Emulation_CT return GSUP_ConnHdlr { } } setverdict(fail, "Couldn't find GsupExpect for incoming imsi ", imsi); + mtc.stop; return ret; } @@ -287,7 +283,7 @@ runs on GSUP_Emulation_CT { return; } } - setverdict(fail, "No space left in GsupExpectTable"); + testcase.stop("No space left in GsupExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index 615309a8..4368a8a7 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -62,7 +62,7 @@ private function f_comp_by_teid(OCT4 teid) runs on GTP_Emulation_CT return GTP_C } } setverdict(fail, "No Component for TEID ", teid); - self.stop; + mtc.stop; } private function f_comp_by_imsi(hexstring imsi) runs on GTP_Emulation_CT return GTP_ConnHdlr { @@ -73,7 +73,7 @@ private function f_comp_by_imsi(hexstring imsi) runs on GTP_Emulation_CT return } } setverdict(fail, "No Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tid_tbl_add(OCT4 teid, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -85,8 +85,7 @@ private function f_tid_tbl_add(OCT4 teid, GTP_ConnHdlr vc_conn) runs on GTP_Emul return; } } - setverdict(fail, "No Space in TidTable for ", teid); - self.stop; + testcase.stop("No Space in TidTable for ", teid); } private function f_imsi_tbl_add(hexstring imsi, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -98,8 +97,7 @@ private function f_imsi_tbl_add(hexstring imsi, GTP_ConnHdlr vc_conn) runs on GT return; } } - setverdict(fail, "No Space in IMSI Table for ", imsi); - self.stop; + testcase.stop("No Space in IMSI Table for ", imsi); } function f_gtpc_extract_imsi(PDU_GTPC gtp) return template (omit) hexstring { diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index d0a87e3d..018f6dae 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -464,7 +464,8 @@ module GTP_Templates { } } } - setverdict(fail); + setverdict(fail, "Could not extract protocol payload from protocol ", protocol); + mtc.stop; return ''O; } diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp index df2b15e4..a271f2d8 100644 --- a/library/IPA_Emulation.ttcnpp +++ b/library/IPA_Emulation.ttcnpp @@ -203,7 +203,7 @@ function f_connect(charstring remote_host, IPL4asp_Types.PortNumber remote_port, local_host, local_port, 0, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -218,7 +218,7 @@ function f_bind(charstring local_host, IPL4asp_Types.PortNumber local_port, local_host, local_port, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -507,7 +507,7 @@ private function ScanEvents() runs on IPA_Emulation_CT { } case else { setverdict(fail, "Unknown mode"); - self.stop; + mtc.stop; } } } diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn index 77cd7393..752b8977 100644 --- a/library/IuUP_Emulation.ttcn +++ b/library/IuUP_Emulation.ttcn @@ -80,6 +80,7 @@ function f_IuUP_Em_rx_decaps(inout IuUP_Entity st, octetstring inp) return octet return pdu.type_0.payload; } else { setverdict(fail, "PDU Type 0 received but 1 configured"); + mtc.stop; } } else if (ischosen(pdu.type_1)) { if (st.cfg.data_pdu_type_0 == false) { @@ -88,11 +89,13 @@ function f_IuUP_Em_rx_decaps(inout IuUP_Entity st, octetstring inp) return octet return pdu.type_1.payload; } else { setverdict(fail, "PDU Type 1 received but 0 configured"); + mtc.stop; } } else if (ischosen(pdu.type_14)) { if (match(pdu, tr_IuUP_INIT)) { if (st.cfg.active_init == true) { setverdict(fail, "INIT received in ACTIVE role"); + mtc.stop; } else { /* store an INIT_ACK to be transmitted later */ st.pending_tx_pdu := valueof(ts_IuUP_INIT_ACK(pdu.type_14.frame_nr, @@ -104,11 +107,13 @@ function f_IuUP_Em_rx_decaps(inout IuUP_Entity st, octetstring inp) return octet st.state := ST_DATA_TRANSFER_READY; } else { setverdict(fail, "INIT_ACK received in PASSIVE role"); + mtc.stop; } } return ''O; } else { setverdict(fail, "Impossible IuUP PDU decoded from ", inp); + mtc.stop; } self.stop; } diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index ba9c2b5a..14a059c2 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -41,7 +41,7 @@ module L1CTL_PortType { [] pt.receive(tr_L1CTL_FBSB_CONF(0)) { return; }; [i >= 9] pt.receive(tr_L1CTL_FBSB_CONF(?)) { setverdict(fail, "FBSB Failed with non-zero return code"); - self.stop; + mtc.stop; }; [] pt.receive(tr_L1CTL_FBSB_CONF(?)) { f_sleep(1.0); @@ -49,7 +49,7 @@ module L1CTL_PortType { [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in FBSB") - self.stop; + mtc.stop; }; } } @@ -64,7 +64,7 @@ module L1CTL_PortType { [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout in CCH_MODE"); - self.stop; + mtc.stop; } } } @@ -80,7 +80,7 @@ module L1CTL_PortType { [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in RACH"); - self.stop; + mtc.stop; } } return fn; @@ -108,7 +108,7 @@ module L1CTL_PortType { [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -133,7 +133,7 @@ module L1CTL_PortType { [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -149,7 +149,7 @@ module L1CTL_PortType { [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for TBF-CFG.conf"); - self.stop; + mtc.stop; }; } T.stop; @@ -174,7 +174,7 @@ module L1CTL_PortType { [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RESET.conf"); - self.stop; + mtc.stop; } } } diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 2b396213..bf7818af 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -70,7 +70,7 @@ function f_gprs_tlli_type(OCT4 tlli) return TlliType { return TLLI_RAND_G_RNTI; } else { setverdict(fail, "Unknonw TLLI Type ", tllib); - self.stop; + mtc.stop; } } diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index bdfc50bf..6b8f9fb3 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -320,7 +320,7 @@ module LAPDm_RAW_PT { var TBF_UL_establish_res res; if (isvalue(g_tbf_ul[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish UL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } f_establish_tbf(tbf_ul_req.ra); if (ph_state == PH_STATE_TBF) { @@ -340,7 +340,7 @@ module LAPDm_RAW_PT { var TbfNr tbf_nr := tbf_dl_req.tbf_nr; if (isvalue(g_tbf_dl[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish DL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } g_tbf_dl[tbf_nr] := tbf_dl_req.pars; f_L1CTL_TBF_CFG(L1CTL, false, tbf_dl_req.pars.tfi); diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 0863511e..c3d09b93 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -134,9 +134,8 @@ runs on MGCP_Emulation_CT return MGCP_ConnHdlr { return MgcpEndpointTable[i].comp_ref; } } - log("MGCP Endpoint Table not found by Endpoint", ep); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by Endpoint", ep); + mtc.stop; } private function f_ep_by_comp(MGCP_ConnHdlr client) @@ -147,9 +146,8 @@ runs on MGCP_Emulation_CT return MgcpEndpoint { return MgcpEndpointTable[i].endpoint; } } - log("MGCP Endpoint Table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by component ", client); + mtc.stop; } private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -162,8 +160,7 @@ runs on MGCP_Emulation_CT { return; } } - setverdict(fail, "MGCP Endpoint Table full!"); - self.stop; + testcase.stop("MGCP Endpoint Table full!"); } private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -178,7 +175,7 @@ runs on MGCP_Emulation_CT { } } setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!"); - self.stop; + mtc.stop; } @@ -211,7 +208,7 @@ function f_mgcp_ep(MgcpMessage msg) return MgcpEndpoint { var MgcpEndpoint ep; if (f_mgcp_find_param(msg, "Z", ep) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", msg); - self.stop; + mtc.stop; } return ep; } @@ -239,7 +236,7 @@ function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_E } if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } g_mgcp_conn_id := res.connId; @@ -273,7 +270,7 @@ function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_E res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } } if (ischosen(mrf.msg.command)) { @@ -302,7 +299,7 @@ function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_E } } else { setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); - self.stop; + mtc.stop; } } [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { @@ -387,6 +384,7 @@ runs on MGCP_Emulation_CT return MGCP_ConnHdlr { } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); + mtc.stop; return ret; } @@ -398,7 +396,7 @@ runs on MGCP_Emulation_CT { for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { if (crit == MgcpExpectTable[i].crit) { setverdict(fail, "Crit already present", crit); - self.stop; + mtc.stop; } } for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { @@ -409,7 +407,7 @@ runs on MGCP_Emulation_CT { return; } } - setverdict(fail, "No space left in MgcpExpectTable") + testcase.stop("No space left in MgcpExpectTable") } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ @@ -459,7 +457,8 @@ function f_encoding_name_from_pt(SDP_FIELD_PayloadType pt) return charstring { return "AMR-WB"; } - setverdict(fail); + setverdict(fail, "Unknown payload type ", pt); + mtc.stop; return ""; } diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 9d6dea66..afdc33d6 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -294,7 +294,7 @@ module MGCP_Templates { return par.val; } } - setverdict(fail); + setverdict(fail, "Could not extract parameters for code ", code); return ""; } diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index d9b7c791..94ed1c48 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -116,9 +116,8 @@ runs on MNCC_Emulation_CT return MNCC_ConnHdlr { return MnccCallTable[i].comp_ref; } } - log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by MNCC Call ID ", mncc_call_id); + mtc.stop; } /* resolve connection ID by component reference */ @@ -129,9 +128,8 @@ runs on MNCC_Emulation_CT return integer { return MnccCallTable[i].mncc_call_id; } } - log("MNCC Call table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by component ", client); + mtc.stop; } private function f_gen_call_id() @@ -171,9 +169,7 @@ runs on MNCC_Emulation_CT { return; } } - log("MNCC Call table full!"); - setverdict(fail); - self.stop; + testcase.stop("MNCC Call table full!"); } private function f_call_table_del(uint32_t mncc_call_id) @@ -187,9 +183,8 @@ runs on MNCC_Emulation_CT { return } } - log("MNCC Call table attempt to delete non-existant ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table attempt to delete non-existant ", mncc_call_id); + mtc.stop; } @@ -203,14 +198,14 @@ private function f_connect(charstring sock) runs on MNCC_Emulation_CT { [] MNCC.receive(UD_connect_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error connecting to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to MNCC socket"); - self.stop; + mtc.stop; } } } @@ -226,14 +221,14 @@ private function f_listen(charstring sock) runs on MNCC_Emulation_CT { [] MNCC.receive(UD_listen_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error listening to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout listening to MNCC socket"); - self.stop; + mtc.stop; } } @@ -244,7 +239,7 @@ private function f_listen(charstring sock) runs on MNCC_Emulation_CT { } [] T.timeout { setverdict(fail, "Timeout waiting for MNCC connection"); - self.stop; + mtc.stop; } } } @@ -393,6 +388,7 @@ runs on MNCC_Emulation_CT return MNCC_ConnHdlr { if (not ischosen(conn_ind.u.signal) or (conn_ind.msg_type != MNCC_SETUP_IND and conn_ind.msg_type != MNCC_SETUP_REQ)) { setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_{IND,REQ}"); + mtc.stop; return ret; } dest_number := conn_ind.u.signal.called.number; @@ -412,6 +408,7 @@ runs on MNCC_Emulation_CT return MNCC_ConnHdlr { } } setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + mtc.stop; return ret; } @@ -427,7 +424,7 @@ runs on MNCC_Emulation_CT { return; } } - setverdict(fail, "No space left in MnccMnccExpectTable"); + testcase.stop("No space left in MnccMnccExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 19af2369..157457a6 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1922,7 +1922,7 @@ function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t { return pdu.u.signal.callref; } else { setverdict(fail, "Unable to determine Callref for MNCC", pdu); - self.stop + mtc.stop } } diff --git a/library/NS_Emulation.ttcn b/library/NS_Emulation.ttcn index d43d15c1..01d45b42 100644 --- a/library/NS_Emulation.ttcn +++ b/library/NS_Emulation.ttcn @@ -83,7 +83,7 @@ module NS_Emulation { res := f_IPL4_connect(NSCP, mp_remote_ip, mp_remote_udp_port, mp_local_ip, mp_local_udp_port, 0, { udp := {}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect NS UDP socket, check your configuration"); - self.stop; + mtc.stop; } g_conn_id := res.connId; f_change_state(NSE_S_DEAD_BLOCKED); diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn index 22195c89..a98ac295 100644 --- a/library/Osmocom_CTRL_Adapter.ttcn +++ b/library/Osmocom_CTRL_Adapter.ttcn @@ -38,7 +38,7 @@ runs on CTRL_Adapter_CT { [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } [] T.timeout { setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); - self.stop; + mtc.stop; } } } diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn index 70885c92..da3b80de 100644 --- a/library/Osmocom_CTRL_Functions.ttcn +++ b/library/Osmocom_CTRL_Functions.ttcn @@ -40,10 +40,12 @@ module Osmocom_CTRL_Functions { [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; return "FAIL"; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL GET REPLY ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -62,9 +64,11 @@ module Osmocom_CTRL_Functions { [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL SET REPLY ", variable); + mtc.stop; } } } @@ -80,6 +84,7 @@ module Osmocom_CTRL_Functions { } [] T.timeout { setverdict(fail, "Timeout waiting for TRAP ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -92,6 +97,7 @@ module Osmocom_CTRL_Functions { ctrl_resp := f_ctrl_get(pt, variable); if (not match(ctrl_resp, exp)) { setverdict(fail, "Unexpected " & variable & ":" & ctrl_resp); + mtc.stop; } } @@ -111,6 +117,7 @@ module Osmocom_CTRL_Functions { ctrl_resp := f_ctrl_get(pt, variable); if (not match(str2int(ctrl_resp), exp)) { setverdict(fail, variable & " value " & ctrl_resp & " didn't match ", exp); + mtc.stop; } } diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index d01fe378..90b27585 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -95,8 +95,6 @@ function bool2bit_tmpl(template boolean inp) return template BIT1 { return '0'B; } } - setverdict(fail, "Unsupported template", inp); - self.stop; } type record of integer IntegerRecord; diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index c7f44414..6e4eb74c 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -59,7 +59,7 @@ module Osmocom_VTY_Functions { [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); - self.stop; + mtc.stop; }; } T.stop; @@ -132,7 +132,7 @@ function f_vty_transceive_match(TELNETasp_PT pt, charstring cmd, template charst var charstring ret := f_vty_transceive_ret(pt, cmd); if (not match(ret, exp_ret)) { setverdict(fail, "Non-matching VTY response: ", ret); - self.stop; + mtc.stop; } } @@ -140,7 +140,7 @@ function f_vty_transceive_not_match(TELNETasp_PT pt, charstring cmd, template ch var charstring ret := f_vty_transceive_ret(pt, cmd); if (match(ret, exp_ret)) { setverdict(fail, "Unexpected matching VTY response: ", ret); - self.stop; + mtc.stop; } } diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index c6422028..389c5ca6 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -70,14 +70,14 @@ function f_pcuif_connect(PCUIF_CODEC_PT pt, charstring sock) return integer { } else { setverdict(fail, "Error connecting to PCU socket"); } - self.stop; + mtc.stop; } else { return res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to PCU socket"); - self.stop; + mtc.stop; } } return -23; @@ -106,7 +106,7 @@ function f_PCUIF_tx_imm_ass_pch(PCUIF_CODEC_PT pt, integer conn_id, octetstring [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU DATA.cnf"); - self.stop; + mtc.stop; } } return 0; diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 325f22e9..3c035e90 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -90,11 +90,11 @@ private function f_rx_or_fail(template RSL_Message exp_rx) runs on RSL_DchanHdlr } [] RSL.receive { setverdict(fail, "Unexpected RSL message on DCHAN"); - self.stop; + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for RSL on DCHAN"); - self.stop; + mtc.stop; } } /* never reached */ @@ -361,7 +361,7 @@ function main(boolean bts_role := true) runs on RSL_Emulation_CT { cid := f_cid_by_ra_fn(ra, fn); if (cid == -1) { setverdict(fail, "IMM ASS for unknown DChan"); - self.stop; + mtc.stop; } /* update client with trx_nr */ ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); @@ -421,12 +421,13 @@ function main(boolean bts_role := true) runs on RSL_Emulation_CT { CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; } else { setverdict(fail, "RSL for unknown Dchan"); + mtc.stop; } } [not dchan_suspended] IPA_PT.receive { setverdict(fail, "Received unknown primitive from IPA"); - self.stop; + mtc.stop; } [bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn { diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 475b4785..71cd8dbb 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -303,7 +303,7 @@ function f_main() runs on RTP_Emulation_CT g_local_port, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtp_conn_id := res.connId; tr_rtp.connId := g_rtp_conn_id; @@ -311,7 +311,7 @@ function f_main() runs on RTP_Emulation_CT g_local_port+1, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTCP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtcp_conn_id := res.connId; tr_rtcp.connId := g_rtcp_conn_id; @@ -329,7 +329,7 @@ function f_main() runs on RTP_Emulation_CT g_rtp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTP socket, check your configuration"); - self.stop; + mtc.stop; } res := RTP_CodecPort_CtrlFunct.f_IPL4_connect(RTCP, g_remote_host, g_remote_port+1, @@ -337,7 +337,7 @@ function f_main() runs on RTP_Emulation_CT g_rtcp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTCP socket, check your configuration"); - self.stop; + mtc.stop; } CTRL.reply(RTPEM_connect:{g_remote_host, g_remote_port}); } @@ -426,9 +426,11 @@ function f_main() runs on RTP_Emulation_CT /* fail on any unexpected messages */ [] RTP.receive { setverdict(fail, "Received unexpected type from RTP"); + mtc.stop; } [] RTCP.receive { setverdict(fail, "Received unexpected type from RTCP"); + mtc.stop; } } } diff --git a/library/SIP_Emulation.ttcn b/library/SIP_Emulation.ttcn index 3957b8f1..98f73710 100644 --- a/library/SIP_Emulation.ttcn +++ b/library/SIP_Emulation.ttcn @@ -155,7 +155,7 @@ runs on SIP_Emulation_CT return SIP_ConnHdlr { } } setverdict(fail, "SIP Call table not found by SIP Call ID ", call_id); - self.stop; + mtc.stop; } /* resolve connection ID by component reference */ @@ -167,7 +167,7 @@ runs on SIP_Emulation_CT return CallidString { } } setverdict(fail, "SIP Call table not found by component ", client); - self.stop; + mtc.stop; } private function f_expect_table_init() @@ -196,8 +196,7 @@ runs on SIP_Emulation_CT { return; } } - setverdict(fail, "SIP Call table full"); - self.stop; + testcase.stop("SIP Call table full"); } private function f_call_table_del(CallidString call_id) @@ -211,7 +210,7 @@ runs on SIP_Emulation_CT { } } setverdict(fail, "SIP Call table attempt to delete non-existant ", call_id); - self.stop; + mtc.stop; } /* call-back type, to be provided by specific implementation; called when new call connection @@ -270,7 +269,7 @@ runs on SIP_Emulation_CT { CLIENT.send(sip_req) to vc_conn; } else { setverdict(fail, "SIP Request for unknown call ", call_id); - self.stop; + mtc.stop; } } /* SIP response was received on SIP socket/port */ @@ -281,7 +280,7 @@ runs on SIP_Emulation_CT { CLIENT.send(sip_resp) to vc_conn; } else { setverdict(fail, "SIP Response for unknown call ", call_id); - self.stop; + mtc.stop; } } @@ -344,6 +343,7 @@ runs on SIP_Emulation_CT return SIP_ConnHdlr { if (sip_req.requestLine.method != INVITE_E) { setverdict(fail, "SIP ExpectedCreateCallback needs INVITE"); + mtc.stop return ret; } sip_to := sip_req.msgHeader.toField.addressField.nameAddr.addrSpec; @@ -378,6 +378,7 @@ runs on SIP_Emulation_CT return SIP_ConnHdlr { } setverdict(fail, "Couldn't find SipExpect for incoming call ", sip_to); + mtc.stop return ret; } @@ -393,7 +394,7 @@ runs on SIP_Emulation_CT { return; } } - setverdict(fail, "No space left in SipExpectTable"); + testcase.stop("No space left in SipExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/SMPP_Emulation.ttcn b/library/SMPP_Emulation.ttcn index 27876dc0..6dc78e9d 100644 --- a/library/SMPP_Emulation.ttcn +++ b/library/SMPP_Emulation.ttcn @@ -88,7 +88,7 @@ runs on SMPP_Emulation_CT return SMPP_ConnHdlr { } } setverdict(fail, "No componten for SMPP TID ", tid); - self.stop; + mtc.stop; } @@ -109,8 +109,7 @@ runs on SMPP_Emulation_CT { return; } } - setverdict(fail, "SMPP Trans table full!"); - self.stop; + testcase.stop("SMPP Trans table full!"); } private function f_trans_table_del(uint32_t trans_id) @@ -123,7 +122,7 @@ runs on SMPP_Emulation_CT { } } setverdict(fail, "SMPP Trans table attempt to delete non-existant ", trans_id); - self.stop; + mtc.stop; } @@ -136,7 +135,7 @@ runs on SMPP_Emulation_CT { local_host, local_port, 0, { tcp :={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to SMPP port, check your configuration"); - self.stop; + mtc.stop; } g_smpp_conn_id := res.connId; } @@ -187,7 +186,7 @@ private function f_rx_smpp(template SMPP_PDU pdu) runs on SMPP_Emulation_CT { [] SMPP_PORT.receive(tr_SMPP_Recv(g_smpp_conn_id, pdu)) { } [] T_wait.timeout { setverdict(fail, "Timeout waiting for ", pdu); - self.stop; + mtc.stop; } } } @@ -211,7 +210,7 @@ private altstep as_smpp() runs on SMPP_Emulation_CT { } [] SMPP_PORT.receive { setverdict(fail, "Unexpected SMPP from peer"); - self.stop; + mtc.stop; } } @@ -371,8 +370,7 @@ runs on SMPP_Emulation_CT { return; } } - setverdict(fail, "No space left in SmppExpectTable"); - self.stop; + testcase.stop("No space left in SmppExpectTable"); } private function f_exp_lookup(SMPP_TON ton, SMPP_NPI npi, charstring dst) diff --git a/library/TRXC_CodecPort.ttcn b/library/TRXC_CodecPort.ttcn index 774b6746..09b29775 100644 --- a/library/TRXC_CodecPort.ttcn +++ b/library/TRXC_CodecPort.ttcn @@ -81,6 +81,7 @@ function f_TRXC_transceive(TRXC_CODEC_PT pt, ConnectionId conn_id, TrxcMessage t } [] T.timeout { setverdict(fail, "Timeout waiting for ", tr, " on ", pt); + mtc.stop; } } return rf.msg; -- cgit v1.2.3