neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 )


Change subject: hnbgw: add f_rua_expect()
......................................................................

hnbgw: add f_rua_expect()

End the guessing when seeing "timeout of T_guard": set a precise failure
verdict when an expected RUA message did not arrive as expected.

Change-Id: I29e6b7659ba53efee9f676197b502f79780ead7e
---
M hnbgw/HNBGW_Tests.ttcn
1 file changed, 32 insertions(+), 20 deletions(-)



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

diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 5a2c72e..b74ba51 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -509,14 +509,27 @@
        }

        BSSAP.send(tx);
-       T.start;
+
+       return f_rua_expect(exp_rx)
+}
+
+/* expect to receive a specific RUA message on Iuh */
+private function f_rua_expect(template (present) RANAP_PDU exp_rx)
+runs on ConnHdlr return RANAP_PDU {
+       var RANAP_PDU rx;
+       timer T := 5.0;

        alt {
        [] RUA.receive(exp_rx) -> value rx {
                setverdict(pass);
                }
+       [] RUA.receive(RANAP_PDU:?) {
+               setverdict(fail, "Got an unexpected RUA message, was waiting 
for ", exp_rx);
+               mtc.stop;
+               }
        [] T.timeout {
                setverdict(fail, "Timeout waiting for Iuh ", exp_rx);
+               mtc.stop;
                }
        }
        return rx;
@@ -945,19 +958,13 @@
                setverdict(fail, "Timeout waiting for MGCP");
                }
        }
+       T.stop;

        /* Expect RAB Assignment Request with IP/port from CRCX ACK via Iuh */
        rab_sml := ts_RAB_SML(t_RAB_id(23), 
f_ts_RAB_TLA(pars.mgw_conn_1.mgw_rtp_ip), 
t_RAB_binding_port(pars.mgw_conn_1.mgw_rtp_port));
        tx := valueof(ts_RANAP_RabAssReq(rab_sml));

-       alt {
-       [] RUA.receive(tx) {
-               setverdict(pass);
-               }
-       [] T.timeout {
-               setverdict(fail, "Timeout waiting for Iuh ", tx);
-               }
-       }
+       f_rua_expect(tx);
 }

 friend function f_rab_ass_resp(inout MgcpParameters pars) runs on ConnHdlr {
@@ -1119,16 +1126,9 @@
                setverdict(fail, "Timeout waiting for DLCX");
        }
        }
+       T.stop;

-       alt {
-       [] RUA.receive(tx) {
-               setverdict(pass);
-               }
-       [] T.timeout {
-               setverdict(fail, "Timeout waiting for Iuh ", tx);
-               }
-       }
-
+       f_rua_expect(tx);
 }

 testcase TC_rab_release() runs on test_CT {
@@ -1365,7 +1365,7 @@
        rab_sml := ts_RAB_SML_ps(t_RAB_id(23), 
f_ts_RAB_TLA(gtp_pars.access.local.addr),
                                 gtp_pars.access.local.teid);
        rx := valueof(ts_RANAP_RabAssReq(rab_sml));
-       RUA.receive(rx);
+       f_rua_expect(rx);

        /* Send back RAB Assignment Response via Iuh */
        var template RAB_SetupOrModifiedList rab_smdl;
@@ -1436,7 +1436,7 @@

        /* Expect on Iuh: unmodified RAB Assignment Request */
        rx := valueof(ts_RANAP_RabAssReq(rab_sml));
-       RUA.receive(rx);
+       f_rua_expect(rx);

        /* Send back RAB Assignment Response via Iuh */
        var template RAB_SetupOrModifiedList rab_smdl;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765
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: I29e6b7659ba53efee9f676197b502f79780ead7e
Gerrit-Change-Number: 31765
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-MessageType: newchange

Reply via email to