From ae510dc4a743e981b40fc5e1fdb4c109f2425e27 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 3 Oct 2017 17:46:14 +0800 Subject: rate_ctr: Enforce counter (and ctr_group) names are valid identifiers As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 --- tests/stats/stats_test.ok | 84 +++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'tests/stats') diff --git a/tests/stats/stats_test.ok b/tests/stats/stats_test.ok index a0c001b9..cb9daf22 100644 --- a/tests/stats/stats_test.ok +++ b/tests/stats/stats_test.ok @@ -2,14 +2,14 @@ Start test: test_reporting test1: open test2: open report (initial): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -19,19 +19,19 @@ report (initial): test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 global): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 peer): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -41,14 +41,14 @@ report (srep1 peer): test2: item p= g=test.one i=1 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep1 subscriber): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb @@ -59,49 +59,49 @@ report (srep1 subscriber): test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 disabled): test2: close - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=1 n=item.a v=-1 u=ma test1: item p= g=test.one i=1 n=item.b v=-1 u=kb report (srep2 enabled, no flush forced): test2: open - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=1 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=1 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test2: item p= g=test.one i=1 n=item.a v=-1 u=ma test2: item p= g=test.one i=1 n=item.b v=-1 u=kb report (should be empty): report (group 1, counter 1 update): - test2: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 - test1: counter p= g=ctr-test.one i=1 n=ctr.a v=1 d=1 + test2: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 + test1: counter p= g=ctr-test:one i=1 n=ctr:a v=1 d=1 report (group 1, item 1 update): test2: item p= g=test.one i=1 n=item.a v=10 u=ma test1: item p= g=test.one i=1 n=item.a v=10 u=ma report (remove statg1, ctrg1): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 - test1: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 + test1: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test1: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb test1: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove srep1): test1: close - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 test2: item p= g=test.one i=2 n=item.a v=-1 u=ma test2: item p= g=test.one i=2 n=item.b v=-1 u=kb report (remove statg2): - test2: counter p= g=ctr-test.one i=2 n=ctr.a v=0 d=0 - test2: counter p= g=ctr-test.one i=2 n=ctr.b v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:a v=0 d=0 + test2: counter p= g=ctr-test:one i=2 n=ctr:b v=0 d=0 report (remove srep2): test2: close report (remove ctrg2, should be empty): -- cgit v1.2.3