dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email )


Change subject: PCUIF: fix usage of bts number in PCUIF_TXT_IND
......................................................................

PCUIF: fix usage of bts number in PCUIF_TXT_IND

When we receive the PCU_VERSION using tr_PCUIF_TXT_IND we must ignore the
included BTS number because the PCU_VERSION is not addressed to a specific
BTS. When we send a PCU_VERSION using ts_PCUIF_TXT_IND, we should always
use the bts number 0 to be consistent (the BSC/BTS will ignore this number
anyway).

Let's fix the usage of tr_PCUIF_TXT_IND and put comments, to make clear why
the above applies.

Change-Id: I93de261fc77806b2f817e0d30cb1b0d377ed0dbb
related: OS#6507
---
M bts/BTS_Tests.ttcn
M bts/BTS_Tests_OML.ttcn
M pcu/PCUIF_Components.ttcn
M pcu/PCU_Tests_NS.ttcn
4 files changed, 10 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/64/38964/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1ba8d53..186d273 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5446,6 +5446,8 @@
        f_init();
        map(self:PCU, system:PCU);
        f_init_pcu(PCU, testcasename(), g_pcu_conn_id, g_pcu_last_info);
+       /* At this point, a real PCU would not have any BTS context yet. This 
means that the receiving process is
+        * expected to ignore the BTS number (0) we use when sending the 
PCU_VERSION. */
        PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, 
testcasename())));
 }

diff --git a/bts/BTS_Tests_OML.ttcn b/bts/BTS_Tests_OML.ttcn
index 980643a..e34a5f7 100644
--- a/bts/BTS_Tests_OML.ttcn
+++ b/bts/BTS_Tests_OML.ttcn
@@ -150,6 +150,8 @@
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout 
waiting for PCU INFO_IND");
                }
        }
+       /* At this point, a real PCU would not have any BTS context yet. This 
means that the receiving process is
+        * expected to ignore the BTS number (0) we use when sending the 
PCU_VERSION. */
        pt.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, 
testcasename())));
 }

diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 6e956ba..db181b9 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -503,8 +503,9 @@
        PCUIF.receive(tr_RAW_PCU_EV(PCU_EV_CONNECT));

        alt {
-       /* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13) */
-       [] PCUIF.receive(tr_PCUIF_TXT_IND(bts_nr, PCU_VERSION, ?)) -> value 
pcu_msg {
+       /* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13). 
Since the PCU does not have any BTS context
+        * at this point, we will ignore the BTS number in this TXT indication. 
*/
+       [] PCUIF.receive(tr_PCUIF_TXT_IND(?, PCU_VERSION, ?)) -> value pcu_msg {
                log("Rx TXT.ind from the PCU, version is ", 
pcu_msg.u.txt_ind.text);

                /* Send System Information 13 to the PCU */
diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn
index eea8d3f..fad9047 100644
--- a/pcu/PCU_Tests_NS.ttcn
+++ b/pcu/PCU_Tests_NS.ttcn
@@ -55,8 +55,9 @@
        g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path);
        PCU.receive(UD_connected:?);

-       /* Wait for PCU_VERSION and return INFO_IND */
-       PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, 
?)));
+       /* Wait for PCU_VERSION and return INFO_IND. Since the PCU does not 
have any BTS context at this point, we will
+        * ignore the BTS number in this TXT indication. */
+       PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(?, PCU_VERSION, 
?)));
        /* FIXME: make sure to use parameters from mp_gb_cfg.bvc[0].cell_id in 
the PCU INFO IND */
        var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, 
info_ind);
        PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38964?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I93de261fc77806b2f817e0d30cb1b0d377ed0dbb
Gerrit-Change-Number: 38964
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to