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


Change subject: stp: Fix recent regression introduced in 
TC_ipa_to_m3ua_patch_sccp
......................................................................

stp: Fix recent regression introduced in TC_ipa_to_m3ua_patch_sccp

The introduced function f_SCCP_UDT() had the calling+called param order
swapped with regards to previous templates. Change the order to first
have "calling" (src) and then "called" (dst) as already done in
ts_SCCP_UDT.
While at it, change the ts_SCCP_UDT params to accept template (value) to
make it easier for callers.

Change-Id: I0e158557dabdb7e94d1c00a6d67126f2d85bb4cd
---
M library/SCCP_Templates.ttcn
M stp/STP_Tests_Common.ttcn
M stp/STP_Tests_IPA_M3UA.ttcn
3 files changed, 11 insertions(+), 10 deletions(-)



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

diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn
index 8f84d83..6135af3 100644
--- a/library/SCCP_Templates.ttcn
+++ b/library/SCCP_Templates.ttcn
@@ -192,7 +192,8 @@
        }
 }

-template (value) PDU_SCCP ts_SCCP_UDT(SCCP_PAR_Address calling, 
SCCP_PAR_Address called,
+template (value) PDU_SCCP ts_SCCP_UDT(template (value) SCCP_PAR_Address 
calling,
+                                     template (value) SCCP_PAR_Address called,
                                      template (value) octetstring data,
                                      template (value) BIT4 msg_hdl := '0000'B) 
:= {
        unitdata := {
@@ -201,8 +202,8 @@
                pointer1 := 0,  /* overwritten */
                pointer2 := 0,  /* overwritten */
                pointer3 := 0,  /* overwritten */
-               calledPAddress := ConvertASPAddressToEncodedAddress_itu(called),
-               callingPAddress := 
ConvertASPAddressToEncodedAddress_itu(calling),
+               calledPAddress := 
ConvertASPAddressToEncodedAddress_itu(valueof(called)),
+               callingPAddress := 
ConvertASPAddressToEncodedAddress_itu(valueof(calling)),
                data := {
                        paramLength := 0,
                        data := data
diff --git a/stp/STP_Tests_Common.ttcn b/stp/STP_Tests_Common.ttcn
index 01e9ab6..557fa29 100644
--- a/stp/STP_Tests_Common.ttcn
+++ b/stp/STP_Tests_Common.ttcn
@@ -27,14 +27,14 @@
 import from SCCPasp_Types all;
 import from SCCP_Emulation all;

-function f_SCCP_UDT(template (value) SCCP_PAR_Address called := 
ts_SccpAddr_GT('1234'H),
-                   template (value) SCCP_PAR_Address calling := 
ts_SccpAddr_GT('5678'H),
+function f_SCCP_UDT(template (value) SCCP_PAR_Address calling := 
ts_SccpAddr_GT('5678'H),
+                   template (value) SCCP_PAR_Address called := 
ts_SccpAddr_GT('1234'H),
                    template (omit) octetstring data := omit) return octetstring
 {
        if (istemplatekind(data, "omit")) {
                data := f_rnd_octstring_rnd_len(100);
        }
-       var PDU_SCCP sccp := valueof(ts_SCCP_UDT(valueof(called), 
valueof(calling), valueof(data)));
+       var PDU_SCCP sccp := valueof(ts_SCCP_UDT(calling, called, 
valueof(data)));
        var octetstring sccp_enc := enc_PDU_SCCP(sccp);
        return sccp_enc;
 }
diff --git a/stp/STP_Tests_IPA_M3UA.ttcn b/stp/STP_Tests_IPA_M3UA.ttcn
index 1e45372..1def77f 100644
--- a/stp/STP_Tests_IPA_M3UA.ttcn
+++ b/stp/STP_Tests_IPA_M3UA.ttcn
@@ -154,16 +154,16 @@
        f_M3UA_asp_up_act(0, omit, rctx_receiver);

        /* send a well-formed, encoded SCCP message via IPA */
-       var octetstring data := f_rnd_octstring_rnd_len(100);
-       var SCCP_PAR_Address called := valueof(ts_SccpAddr_GT('1234'H));
        var SCCP_PAR_Address calling := valueof(ts_SccpAddr_GT('5678'H));
-       var octetstring sccp_enc := f_SCCP_UDT(called, calling, data);
+       var SCCP_PAR_Address called := valueof(ts_SccpAddr_GT('1234'H));
+       var octetstring data := f_rnd_octstring_rnd_len(100);
+       var octetstring sccp_enc := f_SCCP_UDT(calling, called, data);
        f_IPA_send(0, sccp_enc);

        /* patch point codes into addresses */
        called := valueof(ts_SccpAddr_PC_GT(oct2int(pc_receiver), '83'O, 
"mtp3_itu", '1234'H));
        calling := valueof(ts_SccpAddr_PC_GT(oct2int(pc_sender), '83'O, 
"mtp3_itu", '5678'H));
-       sccp_enc := f_SCCP_UDT(called, calling, data);
+       sccp_enc := f_SCCP_UDT(calling, called, data);

        /* expect to receive it via M3UA */
        var template (present) M3UA_Protocol_Data rx_pd;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40548?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: I0e158557dabdb7e94d1c00a6d67126f2d85bb4cd
Gerrit-Change-Number: 40548
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to