From b015416198809f4cb380bacca93de3c735dccffb Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 4 Jun 2020 15:25:50 +0200 Subject: RSL_Emulation: logging tweaks Change-Id: I8ca105d1d5280cff9b88ce5a2bb9c98a3f1e7527 --- library/RSL_Emulation.ttcn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 2fcb96ca..3427fc64 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -129,10 +129,12 @@ private function f_rx_or_fail(template RSL_Message exp_rx) runs on RSL_DchanHdlr return rx_rsl; } [] RSL.receive { + log("Error: expected: ", exp_rx); setverdict(fail, "Unexpected RSL message on DCHAN"); mtc.stop; } [] T.timeout { + log("Error: timeout, but expected: ", exp_rx); setverdict(fail, "Timeout waiting for RSL on DCHAN"); mtc.stop; } @@ -200,7 +202,9 @@ private function f_cid_by_chan_nr(uint8_t trx_nr, RslChannelNr chan_nr) runs on RSL_Emulation_CT return integer { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { - if (ispresent(ConnectionTable[i].chan_nr) and + log("Checking Dchan handler for trx_nr=", trx_nr, " chan_nr=", chan_nr, ": [",i,"] = ", + ConnectionTable[i]); + if (ispresent(ConnectionTable[i].chan_nr) and ConnectionTable[i].chan_nr == chan_nr and ConnectionTable[i].trx_nr == trx_nr) { return i; } @@ -253,6 +257,7 @@ runs on RSL_Emulation_CT { ConnectionTable[i].ra_fn := omit; } ConnectionTable[i].comp_ref := comp_ref; + log("Created Dchan handler [", i, "] = ", ConnectionTable[i]); return; } } @@ -270,6 +275,7 @@ runs on RSL_Emulation_CT { ConnectionTable[i].trx_nr := trx_nr; ConnectionTable[i].chan_nr := chan_nr; ConnectionTable[i].comp_ref := comp_ref; + log("Created Dchan handler [", i, "] = ", ConnectionTable[i]); return; } } @@ -288,6 +294,7 @@ runs on RSL_Emulation_CT return integer { if (ConnectionTable[i].stream_id == stream_id and ConnectionTable[i].chan_nr == chan_nr and ConnectionTable[i].comp_ref == comp_ref) { + log("Clearing Dchan handler [", i, "] = ", ConnectionTable[i]); f_cid_clear(i); } } @@ -550,6 +557,7 @@ function main(boolean bts_role := true) runs on RSL_Emulation_CT { /* TODO: add timer to time-out ConnectionTable entries which * never get followed-up to */ CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; + log("Modified Dchan handler [", cid, "] = ", ConnectionTable[cid]); } else if (ischosen(rr.payload.imm_ass_rej)) { for (i := 0; i < sizeof(rr.payload.imm_ass_rej.payload); i := i + 1) { ra := bit2oct(rr.payload.imm_ass_rej.payload[i].req_ref.ra); @@ -619,7 +627,8 @@ function main(boolean bts_role := true) runs on RSL_Emulation_CT { log("Storing an RSL message in the waiting queue"); WaitingQueue := WaitingQueue & { rx_rsl }; } else { - setverdict(fail, "RSL for unknown Dchan"); + setverdict(fail, "RSL for unknown Dchan (streamId ", rx_rsl.streamId, ", chan_nr ", + rx_rsl.rsl.ies[0].body.chan_nr, "): ", rx_rsl); mtc.stop; } } -- cgit v1.2.3