Review at  https://gerrit.osmocom.org/6889

bts: Add TC_ipa_dlcx_not_active()

Change-Id: I5c8eec8ba56b35aa8d7df87649389392ffd1a78c
---
M bts/BTS_Tests.ttcn
M library/RSL_Types.ttcn
2 files changed, 58 insertions(+), 0 deletions(-)


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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index e683da0..9deb377 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -998,6 +998,29 @@
        f_exp_err_rep(RSL_ERR_IE_CONTENT);
 }
 
+/* Send IPA DLCX to inactive lchan */
+function f_TC_ipa_dlcx_not_active(charstring id) runs on ConnHdlr {
+       timer T := 3.0;
+       RSL.send(ts_RSL_IPA_DLCX(g_chan_nr));
+       T.start;
+       alt {
+       [] RSL.receive(tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?)) {
+               setverdict(pass);
+               }
+       [] RSL.receive(tr_RSL_IPA_DLCX_NACK(g_chan_nr, ?)) {
+               setverdict(fail);
+               }
+       [] T.timeout {
+               setverdict(fail, "Timeout expecting RF_CHAN_REL_ACK");
+               }
+       }
+}
+testcase TC_ipa_dlcx_not_active() runs on test_CT {
+       var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), 
ts_RSL_ChanMode_SIGN));
+       f_init(testcasename());
+       var ConnHdlr vc_conn := 
f_start_handler(refers(f_TC_ipa_dlcx_not_active), pars);
+       vc_conn.done;
+}
 
 /* TODO Areas:
 
@@ -1049,6 +1072,7 @@
        execute( TC_rsl_protocol_error() );
        execute( TC_rsl_mand_ie_error() );
        execute( TC_rsl_ie_content_error() );
+       execute( TC_ipa_dlcx_not_active() );
 }
 
 
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index ba467c6..79f5920 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1409,6 +1409,15 @@
                }
        }
 
+       template RSL_Message ts_RSL_IPA_DLCX(RslChannelNr chan_nr,
+                                            template (omit) uint16_t 
ipa_conn_id := omit) := {
+               msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+               msg_type := RSL_MT_IPAC_DLCX,
+               ies := {
+                       t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr})
+                       /* FIXME: optional conn_id */
+               }
+       }
        template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
                                             template uint16_t ipa_conn_id := 
omit) := {
                msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
@@ -1430,6 +1439,19 @@
                        t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats 
:= stats})
                }
        }
+       template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
+                                                template uint16_t ipa_conn_id,
+                                                template 
RSL_IE_IPA_ConnectionStats stats) := {
+               msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+               msg_type := RSL_MT_IPAC_DLCX_ACK,
+               ies := {
+                       tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+                       tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+                       tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
+               }
+       }
+
+
 
        template RSL_Message ts_RSL_IPA_DLCX_NACK(RslChannelNr chan_nr, 
RSL_Cause cause,
                                                  template uint16_t 
ipa_conn_id) := {
@@ -1442,6 +1464,18 @@
                        t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := 
ts_RSL_IE_Cause(cause)})
                }
        }
+       template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
+                                                 template RSL_Cause cause) := {
+               msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+               msg_type := RSL_MT_IPAC_DLCX_NACK,
+               ies := {
+                       tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+                       /* optional connection ID */
+                       *,
+                       tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+               }
+       }
+
 
        template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) 
:= {
                msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),

-- 
To view, visit https://gerrit.osmocom.org/6889
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c8eec8ba56b35aa8d7df87649389392ffd1a78c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to