<p>Stefan Sperling has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10414">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">update DTX fill frame test expectations<br><br>Fix an off-by-one in frame number comparison: Ensure that we<br>won't stop testing until after fn + 104 has been received.<br><br>The DTX test case would never pass since the alt statement<br>was always repeated even if enough frames had been received.<br>Fix this by moving code which runs before frame fn + 104 is<br>received into an 'else' cause.<br><br>We receive SACCH frames in DTX mode so we must account for them.<br>Introduce separate counters for SACCH and non-SACCH fill frames<br>to make test failure diagnosis easier. Note that we cannot expect<br>a specific amount of SACCH frames during a particular test run<br>since their amount depends on what the current frame number window<br>happens to be. We can however add the counters for SACCH and<br>non-SACCH fill frames and obtain a meaningful result.<br><br>Change-Id: Ie573b54ab5654f027c470aa7a565d2b5b97dc74b<br>Related: OS#1950<br>---<br>M bts/BTS_Tests.ttcn<br>1 file changed, 38 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/10414/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn</span><br><span>index 890be91..923a8cc 100644</span><br><span>--- a/bts/BTS_Tests.ttcn</span><br><span>+++ b/bts/BTS_Tests.ttcn</span><br><span>@@ -3832,7 +3832,9 @@</span><br><span> var octetstring l2_fill_frame_sacch := substr(l2_fill_frame, 0, lengthof(l2_fill_frame) - 2);</span><br><span> var GsmFrameNumber first_fn;</span><br><span> var boolean is_first_frame := true;</span><br><span style="color: hsl(0, 100%, 40%);">- var integer nfill_frames := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ var integer nfill_frames_sacch := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ var integer nfill_frames_nonsacch := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ var integer expected_fill_frames := 10000; /* initial value causes test failure if not overridden */</span><br><span> const integer dtx_tchf_mod := 104;</span><br><span> /* Frames numbers (mod 104) for which a fill frame is expected on TCHF if DTX is enabled. */</span><br><span> var Integers required_tdma_frames_dtx_tchf := { 52, 53, 54, 55, 56, 57, 58, 59 };</span><br><span>@@ -3872,32 +3874,47 @@</span><br><span> f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);</span><br><span> setverdict(fail, "Received fill frame on non-TCH/F channel; DTX is only allowed on TCH/F!");</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- if (fn >= first_fn + dtx_tchf_mod) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (fn > first_fn + dtx_tchf_mod) {</span><br><span> T.stop;</span><br><span> f_rsl_chan_deact();</span><br><span> f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);</span><br><span style="color: hsl(0, 100%, 40%);">- /* With DTX enabled we can expect at least 1 fill frame every 104 frames. */</span><br><span style="color: hsl(0, 100%, 40%);">- if (nfill_frames < 1) {</span><br><span style="color: hsl(0, 100%, 40%);">- setverdict(fail);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* With DTX enabled we can expect at least 3 fill frames for every 104 frames.</span><br><span style="color: hsl(120, 100%, 40%);">+ * 2 SACCH, 1 TCH/F */</span><br><span style="color: hsl(120, 100%, 40%);">+ expected_fill_frames := 3;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (nfill_frames_sacch + nfill_frames_nonsacch < expected_fill_frames) {</span><br><span style="color: hsl(120, 100%, 40%);">+ log("received only ", nfill_frames_sacch, "+", nfill_frames_nonsacch,</span><br><span style="color: hsl(120, 100%, 40%);">+ " (SACCH+other) out of ", expected_fill_frames, " expected fill frames");</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(fail, "Not enough fill frames received");</span><br><span> } else {</span><br><span> setverdict(pass);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- for (var integer i := 0; i < lengthof(required_tdma_frames_dtx_tchf); i := i + 1) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (fn mod dtx_tchf_mod == required_tdma_frames_dtx_tchf[i]) {</span><br><span style="color: hsl(0, 100%, 40%);">- nfill_frames := nfill_frames + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (dl.dl_info.link_id.c == SACCH) {</span><br><span style="color: hsl(120, 100%, 40%);">+ nfill_frames_sacch := nfill_frames_sacch + 1;</span><br><span> repeat;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* On DTX TCH/F channels, fill frames occur only for specific frame numbers mod 104. */</span><br><span style="color: hsl(120, 100%, 40%);">+ for (var integer i := 0; i < lengthof(required_tdma_frames_dtx_tchf); i := i + 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (fn mod dtx_tchf_mod == required_tdma_frames_dtx_tchf[i]) {</span><br><span style="color: hsl(120, 100%, 40%);">+ nfill_frames_nonsacch := nfill_frames_nonsacch + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ repeat;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ log("Received DTX TCH fill frame with bad frame number: ", fn,</span><br><span style="color: hsl(120, 100%, 40%);">+ " (mod ", dtx_tchf_mod, ": ", fn mod dtx_tchf_mod, ")");</span><br><span style="color: hsl(120, 100%, 40%);">+ f_rsl_chan_deact();</span><br><span style="color: hsl(120, 100%, 40%);">+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(fail, "Unexpected L2 fill frame received on Um");</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- log("Received DTX TCH fill frame with bad frame number: ", fn,</span><br><span style="color: hsl(0, 100%, 40%);">- " (mod ", dtx_tchf_mod, ": ", fn mod dtx_tchf_mod, ")");</span><br><span style="color: hsl(0, 100%, 40%);">- f_rsl_chan_deact();</span><br><span style="color: hsl(0, 100%, 40%);">- f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);</span><br><span style="color: hsl(0, 100%, 40%);">- setverdict(fail, "Unexpected L2 fill frame received on Um");</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- nfill_frames := nfill_frames + 1;</span><br><span style="color: hsl(0, 100%, 40%);">- if (fn >= first_fn + dtx_tchf_mod) {</span><br><span style="color: hsl(0, 100%, 40%);">- var integer expected_fill_frames;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (dl.dl_info.link_id.c == SACCH) {</span><br><span style="color: hsl(120, 100%, 40%);">+ nfill_frames_sacch := nfill_frames_sacch + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ nfill_frames_nonsacch := nfill_frames_nonsacch + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (fn > first_fn + dtx_tchf_mod) {</span><br><span> T.stop;</span><br><span> if (f_g_chan_is_tchf()) {</span><br><span> /* Without DTX we can expect 25 fill frames for every 104 frames.</span><br><span>@@ -3917,9 +3934,12 @@</span><br><span> </span><br><span> f_rsl_chan_deact();</span><br><span> f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);</span><br><span style="color: hsl(0, 100%, 40%);">- if (nfill_frames >= expected_fill_frames) {</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (nfill_frames_sacch + nfill_frames_nonsacch >= expected_fill_frames) {</span><br><span> setverdict(pass);</span><br><span> } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ log("received only ", nfill_frames_sacch, "+", nfill_frames_nonsacch,</span><br><span style="color: hsl(120, 100%, 40%);">+ " (SACCH+other) out of ", expected_fill_frames, " expected fill frames");</span><br><span> setverdict(fail, "Not enough fill frames received");</span><br><span> }</span><br><span> } else {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10414">change 10414</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10414"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie573b54ab5654f027c470aa7a565d2b5b97dc74b </div>
<div style="display:none"> Gerrit-Change-Number: 10414 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>