pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28999 )
Change subject: bsc: Fix CBSP expectancies when receiving ETWS write-replace response ......................................................................
bsc: Fix CBSP expectancies when receiving ETWS write-replace response
BSC_Tests_CBSP was sending an ETWS message but using non-ETWS templates to match the response, which may differ from an ETWS one (for instance, ETWS related messages have no channel_ind).
Change-Id: I42941655081af6d5b04b1e061e6259d8dee94665 --- M bsc/BSC_Tests_CBSP.ttcn M library/CBSP_Templates.ttcn 2 files changed, 63 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/99/28999/1
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn index 5fa8881..c07b605 100644 --- a/bsc/BSC_Tests_CBSP.ttcn +++ b/bsc/BSC_Tests_CBSP.ttcn @@ -281,9 +281,9 @@ tx := ts_CBSP_WRITE_EMERG(msg_id, ser_no, cell_list, emerg_ind, warn_type, warn_per); CBSP[0].send(ts_CBSP_Send(g_cbsp_conn_id[0], tx)); if (istemplatekind(fail_list, "omit")) { - rx := tr_CBSP_WRITE_CBS_COMPL(msg_id, ser_no, success_list, omit); + rx := tr_CBSP_WRITE_EMERG_COMPL(msg_id, ser_no, success_list); } else { - rx := tr_CBSP_WRITE_CBS_FAIL(msg_id, ser_no, fail_list, *, success_list, omit); + rx := tr_CBSP_WRITE_EMERG_FAIL(msg_id, ser_no, fail_list, *, success_list); } alt { [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) { @@ -341,9 +341,9 @@ tx := ts_CBSP_REPLACE_EMERG(msg_id, new_ser_no, old_ser_no, cell_list, emerg_ind, warn_type, warn_per); CBSP[0].send(ts_CBSP_Send(g_cbsp_conn_id[0], tx)); if (istemplatekind(fail_list, "omit")) { - rx := tr_CBSP_REPLACE_CBS_COMPL(msg_id, new_ser_no, old_ser_no, omit, success_list, omit); + rx := tr_CBSP_REPLACE_EMERG_COMPL(msg_id, new_ser_no, old_ser_no, success_list); } else { - rx := tr_CBSP_REPLACE_CBS_FAIL(msg_id, new_ser_no, old_ser_no, fail_list, omit, success_list, omit); + rx := tr_CBSP_REPLACE_EMERG_FAIL(msg_id, new_ser_no, old_ser_no, fail_list, omit, success_list); } alt { [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) { diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn index bcbb7be..e598566 100644 --- a/library/CBSP_Templates.ttcn +++ b/library/CBSP_Templates.ttcn @@ -396,7 +396,7 @@
function tr_CBSP_WRITE_CBS_COMPL(template uint16_t msg_id, template uint16_t new_ser_nr, template BSSMAP_FIELD_CellIdentificationList cell_list, - template uint8_t channel_ind) + template (present) uint8_t channel_ind) return template CBSP_PDU { var template CBSP_IEs ies := { tr_CbspMsgId(msg_id), @@ -466,7 +466,7 @@ template uint16_t old_ser_nr, template CBSP_IE_NumBcastComplList compl_list, template BSSMAP_FIELD_CellIdentificationList cell_list, - template uint8_t channel_ind) + template (present) uint8_t channel_ind) return template CBSP_PDU { var template CBSP_IEs ies := { tr_CbspMsgId(msg_id), @@ -542,7 +542,7 @@ template CBSP_FailureListItems fail_list, template CBSP_IE_NumBcastComplList compl_list, template BSSMAP_FIELD_CellIdentificationList cell_list, - template uint8_t channel_ind) + template (present) uint8_t channel_ind) return template CBSP_PDU { var template CBSP_IEs ies := { tr_CbspMsgId(msg_id), @@ -564,8 +564,33 @@ } else if (not istemplatekind(cell_list, "omit")) { ies[lengthof(ies)] := tr_CbspCellList(cell_list); } - if (not istemplatekind(channel_ind, "omit")) { - ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); + ies[lengthof(ies)] := ts_CbspChannelInd(channel_ind); + return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); +} +function tr_CBSP_WRITE_EMERG_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr, + template CBSP_FailureListItems fail_list, + template CBSP_IE_NumBcastComplList compl_list, + template BSSMAP_FIELD_CellIdentificationList cell_list) +return template CBSP_PDU { + var template CBSP_IEs ies := { + tr_CbspMsgId(msg_id), + tr_NewSerNo(new_ser_nr), + tr_CbspFailList(fail_list) + }; + if (istemplatekind(compl_list, "*")) { + //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent; + } else if (istemplatekind(compl_list, "?")) { + ies[lengthof(ies)] := tr_CbspNumComplList(?); + } else if (not istemplatekind(compl_list, "omit")) { + ies[lengthof(ies)] := tr_CbspNumComplList(compl_list); + } + if (istemplatekind(cell_list, "*")) { + testcase.stop("TITAN > 6.5.0 doesn't support this"); + //ies[lengthof(ies)] := tr_CbspCellList ifpresent; + } else if (istemplatekind(cell_list, "?")) { + ies[lengthof(ies)] := tr_CbspCellList(?); + } else if (not istemplatekind(cell_list, "omit")) { + ies[lengthof(ies)] := tr_CbspCellList(cell_list); } return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); } @@ -597,7 +622,7 @@ template CBSP_FailureListItems fail_list, template CBSP_IE_NumBcastComplList compl_list, template BSSMAP_FIELD_CellIdentificationList cell_list, - template uint8_t channel_ind) + template (present) uint8_t channel_ind) return template CBSP_PDU { var template CBSP_IEs ies := { tr_CbspMsgId(msg_id), @@ -622,6 +647,34 @@ ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind); return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); } +function tr_CBSP_REPLACE_EMERG_FAIL(template uint16_t msg_id, template uint16_t new_ser_nr, + template uint16_t old_ser_nr, + template CBSP_FailureListItems fail_list, + template CBSP_IE_NumBcastComplList compl_list, + template BSSMAP_FIELD_CellIdentificationList cell_list) +return template CBSP_PDU { + var template CBSP_IEs ies := { + tr_CbspMsgId(msg_id), + tr_NewSerNo(new_ser_nr), + tr_OldSerNo(old_ser_nr), + tr_CbspFailList(fail_list) + }; + if (istemplatekind(compl_list, "*")) { + //ies[lengthof(ies)] := tr_CbspCellList ifpresent; + } else if (istemplatekind(compl_list, "?")) { + ies[lengthof(ies)] := tr_CbspNumComplList(?); + } else if (not istemplatekind(compl_list, "omit")) { + ies[lengthof(ies)] := tr_CbspNumComplList(compl_list); + } + if (istemplatekind(cell_list, "*")) { + //ies[lengthof(ies)] := tr_CbspCellList ifpresent; + } else if (istemplatekind(cell_list, "?")) { + ies[lengthof(ies)] := tr_CbspCellList(?); + } else if (not istemplatekind(cell_list, "omit")) { + ies[lengthof(ies)] := tr_CbspCellList(cell_list); + } + return tr_CBSP(CBSP_MSGT_WRITE_REPLACE_FAIL, ies); +}
/* 8.1.3.4 KILL */ function ts_CBSP_KILL(template (value) uint16_t msg_id,