From ead6345cb4ab23f3277155a611483edace536a46 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 25 Mar 2021 10:34:40 +0100 Subject: parser: fix scope closure of COUNTER token It is closed after allocation, which is too early: this stopped 'packets' and 'bytes' from getting parsed correctly. Also add a test case for this. Signed-off-by: Florian Westphal --- tests/py/any/counter.t.payload | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/py/any/counter.t.payload (limited to 'tests/py/any/counter.t.payload') diff --git a/tests/py/any/counter.t.payload b/tests/py/any/counter.t.payload new file mode 100644 index 00000000..23e96bae --- /dev/null +++ b/tests/py/any/counter.t.payload @@ -0,0 +1,15 @@ +# counter +ip + [ counter pkts 0 bytes 0 ] + +# counter packets 0 bytes 0 +ip + [ counter pkts 0 bytes 0 ] + +# counter packets 2 bytes 1 +ip + [ counter pkts 2 bytes 1 ] + +# counter bytes 1024 packets 1 +ip + [ counter pkts 1 bytes 1024 ] -- cgit v1.2.3