fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27101 )

Change subject: GGSN_Tests: fix DTE due to passing out-of-bound values to 
int2oct()
......................................................................

GGSN_Tests: fix DTE due to passing out-of-bound values to int2oct()

This patch fixes the following DTE happening sporadically:

  04:09:29.373271 mtc GGSN_Tests.ttcn:1478 Dynamic test case error:
    The first argument of function int2oct(), which is 256, does not fit in 1 
octet.

Change-Id: I517b8e5d5872c36f7c759433a1cde338c90f16da
---
M ggsn_tests/GGSN_Tests.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 3b34c7f..ae24eeb 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -1475,7 +1475,7 @@
                var PdpContext ctxB := 
valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, 
valueof(t_EuaIPv4Dyn)));
                f_pdp_ctx_act(ctxA);

-               g_restart_ctr := int2oct(oct2int(g_restart_ctr) + 1, 1);
+               g_restart_ctr := int2oct((oct2int(g_restart_ctr) + 1) mod 256, 
1);

                log("sending 2nd CreatePDP (recovery increased)");
                f_send_gtpc(ts_GTPC_CreatePDP(g_peer_c, g_c_seq_nr, ctxB.imsi, 
g_restart_ctr,
@@ -1564,7 +1564,7 @@
                /* Wait to receive second echo request and send incremented 
Restart
                   counter. This will fake a restarted SGSN, and pdp ctx 
allocated
                   should be released by GGSN */
-               g_restart_ctr := int2oct(oct2int(g_restart_ctr) + 1, 1);
+               g_restart_ctr := int2oct((oct2int(g_restart_ctr) + 1) mod 256, 
1);
                GTPC.receive(tr_GTPC_PING(?)) -> value ud {
                        var uint16_t seq := 
oct2int(ud.gtpc.opt_part.sequenceNumber);
                        GTPC.send(ts_GTPC_PONG(ud.peer, seq, g_restart_ctr));

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I517b8e5d5872c36f7c759433a1cde338c90f16da
Gerrit-Change-Number: 27101
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to