aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2014-06-11 18:33:14 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2014-08-15 18:28:45 +0200
commit341689d6c51d8db73d8691e947c49ede792b6652 (patch)
treee2d44ed9bd63a3f14342960e51d96c35043485b6 /tests
parentad1fcccf603582418b38a76b215c3f37c70ffb90 (diff)
TbfTest: Make logging more verbose
Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests')
-rw-r--r--tests/tbf/TbfTest.cpp27
-rw-r--r--tests/tbf/TbfTest.err14
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index decf4d9f..911092a6 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -78,6 +78,31 @@ static void test_tbf_tlli_update()
OSMO_ASSERT(the_bts.timing_advance()->recall(0x4232) == 4);
}
+static const struct log_info_cat default_categories[] = {
+ {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0},
+ {"DL1IF", "\033[1;32m", "GPRS PCU L1 interface (L1IF)", LOGL_DEBUG, 1},
+ {"DRLCMAC", "\033[0;33m", "GPRS RLC/MAC layer (RLCMAC)", LOGL_DEBUG, 1},
+ {"DRLCMACDATA", "\033[0;33m", "GPRS RLC/MAC layer Data (RLCMAC)", LOGL_DEBUG, 1},
+ {"DRLCMACDL", "\033[1;33m", "GPRS RLC/MAC layer Downlink (RLCMAC)", LOGL_DEBUG, 1},
+ {"DRLCMACUL", "\033[1;36m", "GPRS RLC/MAC layer Uplink (RLCMAC)", LOGL_DEBUG, 1},
+ {"DRLCMACSCHED", "\033[0;36m", "GPRS RLC/MAC layer Scheduling (RLCMAC)", LOGL_DEBUG, 1},
+ {"DRLCMACMEAS", "\033[1;31m", "GPRS RLC/MAC layer Measurements (RLCMAC)", LOGL_INFO, 1},
+ {"DBSSGP","\033[1;34m", "GPRS BSS Gateway Protocol (BSSGP)", LOGL_INFO , 1},
+ {"DPCU", "\033[1;35m", "GPRS Packet Control Unit (PCU)", LOGL_NOTICE, 1},
+};
+
+static int filter_fn(const struct log_context *ctx,
+ struct log_target *tar)
+{
+ return 1;
+}
+
+const struct log_info debug_log_info = {
+ filter_fn,
+ (struct log_info_cat*)default_categories,
+ ARRAY_SIZE(default_categories),
+};
+
int main(int argc, char **argv)
{
tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile TbfTest context");
@@ -85,7 +110,7 @@ int main(int argc, char **argv)
abort();
msgb_set_talloc_ctx(tall_pcu_ctx);
- osmo_init_logging(&gprs_log_info);
+ osmo_init_logging(&debug_log_info);
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 9e2f1830..3e52da4a 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -1,3 +1,17 @@
+********** TBF starts here **********
+Allocating DL TBF: TFI=0 TRX=0 MS_CLASS=0
+Slot Allocation (Algorithm A) for class 0
+- Skipping TS 0, because not enabled
+- Skipping TS 1, because not enabled
+- Assign downlink TS=2
+- Setting Control TS 2
TBF(TFI=0 TLLI=0x00000000 DIR=DL) changing tlli from TLLI=0x00000000 TLLI=0x00002342 ul_changed=0
+********** TBF starts here **********
+Allocating UL TBF: TFI=0 TRX=0 MS_CLASS=0
+Slot Allocation (Algorithm A) for class 0
+- Skipping TS 0, because not enabled
+- Skipping TS 1, because not enabled
+- Assign uplink TS=2 USF=0
+- Setting Control TS 2
TBF(TFI=0 TLLI=0x00000000 DIR=UL) changing tlli from TLLI=0x00000000 TLLI=0x00002342 ul_changed=0
TBF(TFI=0 TLLI=0x00002342 DIR=DL) changing tlli from TLLI=0x00002342 TLLI=0x00004232 ul_changed=1