laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve
trau2rtp unit test: add patterns that showcase BFI=1 SID=0

The previous patch added special handling for the corner case
in which the BTS indicates BFI=1 SID=0, but the bit pattern is
still SID by the bit counting rules of GSM 06.31 or 06.81
section 6.1.1. The selection of test patterns in the unit test
already had some frames that exhibit this effect, taken from
actual Abis output of Nokia InSite BTS, but the exact effect
of our handling becomes more visible when the bit pattern forms
a perfect (not corrupted) SID frame, which I haven't been able
to produce with the InSite. Therefore, add some hand-crafted
test frames that fully showcase the effect of our transform.

Change-Id: Ic6a0ad289864fe3e11192d158e3bbe221994eaaa
---
M tests/trau_conv/trau16_efr.in
M tests/trau_conv/trau16_efr_std.ok
M tests/trau_conv/trau16_efr_twts001.ok
M tests/trau_conv/trau16_fr.in
M tests/trau_conv/trau16_fr_std.ok
M tests/trau_conv/trau16_fr_twts001.ok
6 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/tests/trau_conv/trau16_efr.in b/tests/trau_conv/trau16_efr.in
index a0a3fa0..b4bdb02 100644
--- a/tests/trau_conv/trau16_efr.in
+++ b/tests/trau_conv/trau16_efr.in
@@ -66,3 +66,15 @@
0000ebead10eba68ada886f7fbfca494ca8cfffffe4ba04ac07ffffff0048491fffcffe0a485c2ff
ID efr-dtx-dtmf.bin frame 0x53af1
0000ebe8cf05b311adada617fbfca494c87afffffe4ba04ac214fffff00484affffcffe0a485deff
+
+# The following two frames have been constructed by hand, starting with
+# efr-dtx.bin frame 0x3cad1 and editing the hex string for desired effect.
+# The first constructed frame is a perfect SID that has BFI=1 set,
+# the second constructed frame is the same with C13 cleared.
+# The intent is to showcase the effect of the hacky logic that "breaks"
+# the SID bit pattern when the metadata bits indicate BFI=1 SID=0.
+
+ID perfect SID with BFI=1
+0000ebecca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
+ID perfect SID with BFI=1 SID=0
+0000ebe8ca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
diff --git a/tests/trau_conv/trau16_efr_std.ok b/tests/trau_conv/trau16_efr_std.ok
index 1f09a0b..8fff73a 100644
--- a/tests/trau_conv/trau16_efr_std.ok
+++ b/tests/trau_conv/trau16_efr_std.ok
@@ -108,3 +108,11 @@
0000ebe8cf05b311adada617fbfca494c87afffffe4ba04ac214fffff00484affffcffe0a485deff
TRAU frame type: EFR
osmo_trau2rtp() result: 0
+ID perfect SID with BFI=1
+0000ebecca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
+ TRAU frame type: EFR
+ osmo_trau2rtp() result: 0
+ID perfect SID with BFI=1 SID=0
+0000ebe8ca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
+ TRAU frame type: EFR
+ osmo_trau2rtp() result: 0
diff --git a/tests/trau_conv/trau16_efr_twts001.ok b/tests/trau_conv/trau16_efr_twts001.ok
index 761f03b..2b11d14 100644
--- a/tests/trau_conv/trau16_efr_twts001.ok
+++ b/tests/trau_conv/trau16_efr_twts001.ok
@@ -202,3 +202,27 @@
16 8 7 15 15 15 14 0 0 1 0 0 18
60 12 15 12 15 15 12 0 2 2 2 0 22
SID recompute: 0
+ID perfect SID with BFI=1
+0000ebecca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
+ TRAU frame type: EFR
+ osmo_trau2rtp() result: 32
+ TW-TS-001 TEH octet: 0xE2
+ EFR frame:
+ LPC 20 54 191 155 17
+ 3 7 15 15 15 15 12 0 0 0 0 0 17
+ 7 7 15 15 15 15 12 0 0 0 0 0 17
+ 3 15 15 15 15 15 12 0 0 0 0 0 17
+ 15 15 15 12 15 15 12 0 0 0 0 0 19
+ SID recompute: 2
+ID perfect SID with BFI=1 SID=0
+0000ebe8ca1b97f3b45086fffffc8000c68efffffe008046c07fffffe0008451fffcffe08004e2ff
+ TRAU frame type: EFR
+ osmo_trau2rtp() result: 32
+ TW-TS-001 TEH octet: 0xE2
+ EFR frame:
+ LPC 20 54 191 155 17
+ 0 4 15 15 15 15 12 0 0 0 0 0 17
+ 4 4 15 15 15 15 12 0 0 0 0 0 17
+ 0 12 15 15 15 15 12 0 0 0 0 0 17
+ 12 12 15 12 15 15 12 0 0 0 0 0 19
+ SID recompute: 0
diff --git a/tests/trau_conv/trau16_fr.in b/tests/trau_conv/trau16_fr.in
index 2b3f20a..1153e34 100644
--- a/tests/trau_conv/trau16_fr.in
+++ b/tests/trau_conv/trau16_fr.in
@@ -55,3 +55,15 @@

ID fr1-dtx.bin frame 0x104d1
000088b8ee49c3b2e00691e58000800080f1889fa000800086948004c8008000821b90009000caff
+
+# The following two frames have been constructed by hand, starting with
+# fr1-dtx.bin frame 0x8051 and editing the hex string for desired effect.
+# The first constructed frame is a perfect SID that has BFI=1 set,
+# the second constructed frame is the same with C13 cleared.
+# The intent is to showcase the effect of the hacky logic that "breaks"
+# the SID bit pattern when the metadata bits indicate BFI=1 SID=0.
+
+ID perfect SID with BFI=1
+000088bcb58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
+ID perfect SID with BFI=1 SID=0
+000088b8b58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
diff --git a/tests/trau_conv/trau16_fr_std.ok b/tests/trau_conv/trau16_fr_std.ok
index 584bade..baad06f 100644
--- a/tests/trau_conv/trau16_fr_std.ok
+++ b/tests/trau_conv/trau16_fr_std.ok
@@ -92,3 +92,11 @@
000088b8ee49c3b2e00691e58000800080f1889fa000800086948004c8008000821b90009000caff
TRAU frame type: FR
osmo_trau2rtp() result: 0
+ID perfect SID with BFI=1
+000088bcb58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
+ TRAU frame type: FR
+ osmo_trau2rtp() result: 0
+ID perfect SID with BFI=1 SID=0
+000088b8b58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
+ TRAU frame type: FR
+ osmo_trau2rtp() result: 0
diff --git a/tests/trau_conv/trau16_fr_twts001.ok b/tests/trau_conv/trau16_fr_twts001.ok
index 5cef573..bc31762 100644
--- a/tests/trau_conv/trau16_fr_twts001.ok
+++ b/tests/trau_conv/trau16_fr_twts001.ok
@@ -154,3 +154,27 @@
64 1 1 10 2 2 2 2 1 1 1 0 0 0 0 0 0
0 0 0 33 7 3 3 2 0 0 0 1 0 0 0 2 2
SID recompute: 0
+ID perfect SID with BFI=1
+000088bcb58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
+ TRAU frame type: FR
+ osmo_trau2rtp() result: 34
+ TW-TS-001 TEH octet: 0xE2
+ FR frame:
+ LARc 22 35 27 12 7 7 4 4
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ SID recompute: 2
+ID perfect SID with BFI=1 SID=0
+000088b8b58ee6ee92008000800080008000800080008000800080008000800080008000800082ff
+ TRAU frame type: FR
+ osmo_trau2rtp() result: 34
+ TW-TS-001 TEH octet: 0xE2
+ FR frame:
+ LARc 22 35 27 12 7 7 4 4
+ 0 0 0 0 2 2 2 2 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 2 2 2 2 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 2 2 2 2 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 2 2 2 2 0 0 0 0 0 0 0 0 0
+ SID recompute: 0

To view, visit change 38183. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ic6a0ad289864fe3e11192d158e3bbe221994eaaa
Gerrit-Change-Number: 38183
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>