osmocom-bb/src/target/trx_toolkit
Vadim Yanitskiy 0a6e083e8a trx_toolkit/data_dump.py: fix return value of parse_msg()
Jenkins build #2516 has uncovered a problem in DATADumpFile.parse_msg():

  ======================================================================
  FAIL: test_parse_empty (test_data_dump.DATADump_Test)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/build/src/target/trx_toolkit/test_data_dump.py",
         line 138, in test_parse_empty
      self.assertEqual(msg, False)
  AssertionError: None != False

I did a quick investigation, and figured out that this failure
happens when trying to call parse_msg() with idx == 0, because
DATADumpFile._seek2msg() basically does nothing in this case
and thus always returns True. The None itself comes from
DATADumpFile._parse_msg().

Let's ensure that DATADumpFile.parse_msg() always returns None,
even if DATADumpFile._seek2msg() fails. Also, update the unit
test, so we always test a wide range of 'idx' values.

Change-Id: Ifcfa9c5208636a0f9309f5ba8e47d282dc6a03f4
2020-05-22 18:22:32 +07:00
..
.gitignore Rename 'fake_trx' to 'trx_toolkit' 2018-03-13 02:10:02 +07:00
README trx_toolkit/README: update fake_trx.py description 2019-01-14 23:52:31 +00:00
app_common.py trx_toolkit/app_common: add options to enable time printing 2020-04-09 04:44:49 +07:00
burst_fwd.py trx_toolkit/transceiver.py: add frequency hopping support 2020-05-17 14:36:12 +07:00
burst_gen.py trx_toolkit/burst_gen.py: basic TRXD header version 1 support 2019-07-24 05:44:19 +07:00
burst_send.py trx_toolkit: fix compatibility with Python 3: 'is' vs '==' 2019-07-24 05:44:19 +07:00
clck_gen.py trx_toolkit/clck_gen.py: drop unneeded debug print() 2019-11-24 02:24:42 +07:00
ctrl_cmd.py trx_toolkit: fix compatibility with Python 3: 'is' vs '==' 2019-07-24 05:44:19 +07:00
ctrl_if.py trx_toolkit/transceiver.py: add frequency hopping support 2020-05-17 14:36:12 +07:00
ctrl_if_trx.py trx_toolkit/transceiver.py: add frequency hopping support 2020-05-17 14:36:12 +07:00
data_dump.py trx_toolkit/data_dump.py: fix return value of parse_msg() 2020-05-22 18:22:32 +07:00
data_if.py trx_toolkit/data_msg.py: raise exceptions from validate() methods 2019-08-27 20:30:23 +02:00
data_msg.py trx_toolkit/data_msg.py: use list comprehension for bit conversion 2020-05-16 20:17:18 +00:00
fake_pm.py trx_toolkit/transceiver.py: add frequency hopping support 2020-05-17 14:36:12 +07:00
fake_trx.py trx_toolkit/fake_trx.py: send NOPE.ind in case of path loss simulation 2019-11-20 15:05:57 +00:00
gsm_shared.py trx_toolkit/gsm_shared.py: implement hopping sequence generation 2020-05-17 07:26:07 +00:00
rand_burst_gen.py trx_toolkit/rand_burst_gen.py: use list comprehension 2020-05-16 20:17:18 +00:00
test_data_dump.py trx_toolkit/data_dump.py: fix return value of parse_msg() 2020-05-22 18:22:32 +07:00
test_data_msg.py trx_toolkit/data_msg.py: rewrite unit tests to use unittest framework 2019-12-31 17:03:12 +00:00
transceiver.py trx_toolkit/transceiver.py: add frequency hopping support 2020-05-17 14:36:12 +07:00
trx_list.py target/*.py: shebang: use /usr/bin/env python 2019-07-16 22:46:12 +00:00
trx_sniff.py trx_toolkit/trx_sniff.py: add options to filter bursts by RSSI 2020-03-30 19:22:47 +07:00
udp_link.py target/*.py: shebang: use /usr/bin/env python 2019-07-16 22:46:12 +00:00

README

TRX toolkit is a set of tools intended for hacking and debugging
a TRX interface between both transceiver and L1 software, and
emulating a virtual Um-interface between OsmocomBB and OsmoBTS.

Brief description of available applications:

  - fake_trx.py - main application, that allows to connect both
    OsmocomBB and OsmoBTS without actual RF hardware. It's also
    possible to emulate more than two transceivers, so multiple
    MS and/or BTS instances can be connected.

  - clck_gen.py - a peripheral tool aimed to emulate TDMA frame
    clock generator. Could be used for testing and clock
    synchronization of multiple applications. It should be noted,
    that one relays on generic system timer (via Python), so
    a random clock jitter takes place.

  - ctrl_cmd.py - another peripheral tool, which could be used
    for sending CTRL commands directly in manual mode, and also
    for application fuzzing.

  - burst_gen.py - a tool for sending GSM bursts either to L1
    (OsmoBTS or OsmocomBB) or to TRX (OsmoTRX and GR-GSM TRX).
    Currently it is only possible to generate random bursts of
    different types: NB, FB, SB, AB.

  - burst_send.py - a tool for sending existing bursts from a
    capture file either to L1 (OsmoBTS or OsmocomBB) or to
    TRX (e.g. OsmoTRX or GR-GSM TRX).

  - trx_sniff.py - Scapy-based TRX protocol sniffer. Allows one
    to observe a single connection between TRX and L1, and vice
    versa. Also provides some capabilities for filtering bursts
    by direction, frame and timeslot numbers, and for recording
    captured messages to a binary file.

Please note that TRX toolkit is not using libosmocore's CTRL
interface, so 'CTRL' in scope of this code base actually means
control interface of TRX or control protocol. In order to avoid
possible confusion, we use 'TRXC' and 'TRXD' in logging.