aboutsummaryrefslogtreecommitdiffstats
path: root/library/MGCP_Emulation.ttcn
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-07-05 17:35:03 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-07-24 09:54:18 +0000
commite4ff537f9baacc94242407041f30de1994316622 (patch)
tree962ab05f96641d2983012df8ac80b03098cc81e4 /library/MGCP_Emulation.ttcn
parentfcf27c9f24a2a9e636c5d9006f732b9bcbf0cea8 (diff)
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
Diffstat (limited to 'library/MGCP_Emulation.ttcn')
-rw-r--r--library/MGCP_Emulation.ttcn31
1 files changed, 15 insertions, 16 deletions
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 "";
}