From 9220f6336e0716849ab4ebaa35b71adfe179da8d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 23 May 2018 20:27:02 +0200 Subject: Print more self-explanatory error message on bind/connect failures When sockets cannot be bound or connected, the existing TTCN-3 code prints the following rather cryptic error messages: "IPA-CTRL-IPA(47)@f70ff1fd5cfd: Dynamic test case error: Using the value of an optional field containing omit. (Transport endpoint is not connected)" The "Transport endpoint is not connected" sort-of gives it away, but let's make it more explicit by introducing explicit checks for the res.connId and manual setverdict(fail) statements with proper error message. Change-Id: Id22a1b5189d81c4fca03d5e7aff60ffdd1ad56bf --- bts/BTS_Tests.ttcn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bts/BTS_Tests.ttcn') diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 49bf45e3..bc3f1869 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -396,6 +396,10 @@ private function f_trxc_connect() runs on ConnHdlr { var Result res; res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port, "", -1, -1, {udp:={}}, {}); + if (not ispresent(res.connId)) { + setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); + self.stop; + } g_bb_trxc_conn_id := res.connId; } @@ -1043,6 +1047,10 @@ private function f_main_trxc_connect() runs on test_CT { var Result res; res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port, "", -1, -1, {udp:={}}, {}); + if (not ispresent(res.connId)) { + setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); + self.stop; + } g_bb_trxc_conn_id := res.connId; } -- cgit v1.2.3