From 63e797e99ab5a456c73174ea75d13aed853515fa Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Thu, 11 Nov 2021 11:47:35 +0000 Subject: [PATCH] improve decode option doc and testing --- .github/workflows/ci.yaml | 1 + CONTRIBUTING.md | 8 ++++++++ README.md | 2 +- qa/bin/decode | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dd6a6aa03..9a547c38d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,7 @@ jobs: ./qa/bin/parsing ./qa/bin/functional run ./sbin/exabgp decode ./etc/exabgp/api-open.conf FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 + ./sbin/exabgp decode --nlri etc/exabgp/conf-bgpls.conf "00 02 FF FF 03 00 00 00 00 00 00 00 00 01 00 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 0a 0a 0a 01 01 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 02 02 02" env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py # - name: Coveralls diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fdde45182..b399411bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,6 +66,14 @@ env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py env exabgp_tcp_bind='' ./sbin/exabgp ./etc/exabgp/api-open.conf --decode FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 ``` +using master, more options are available: only decoding nlri for example: +``` +./sbin/exabgp decode --nlri etc/exabgp/conf-bgpls.conf "00 02 FF FF 03 00 00 00 00 00 00 00 00 01 00 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 0a 0a 0a 01 01 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 02 02 02" +configuration performing reload of exabgp master-8f037b9c02d4322660e4b6ada81c3e2b2f95905f +reactor loaded new configuration successfully +parser nlri json { "ls-nlri-type": "bgpls-link", "l3-routing-topology": 0, "protocol-id": 3, "local-node-descriptors": { "autonomous-system": 1, "bgp-ls-identifier": "3232266878", "ospf-area-id": "0.0.0.0", "router-id": "10.10.10.10" }, "remote-node-descriptors": { "autonomous-system": 1, "bgp-ls-identifier": "3232266878", "ospf-area-id": "0.0.0.0", "router-id": "10.2.2.2" }, "interface-address": { }, "neighbor-address": { } } +``` + ## Coding Style diff --git a/README.md b/README.md index f0e568b4c..2f4e59c25 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ The following "unsupported" options are available to help with development: ``` exabgp.debug.configuration to trace with pdb configuration parsing errors exabgp.debug.pdb enable python debugger on runtime errors (be ready to use `killall python` to handle orphaned child processes) - exabgp.debug.route similar to --decode but using the environment + exabgp.debug.route similar to using decode but using the environment ``` ### Test suite diff --git a/qa/bin/decode b/qa/bin/decode index a60a918a3..30bf56dbd 100755 --- a/qa/bin/decode +++ b/qa/bin/decode @@ -1,2 +1,4 @@ # a weird packet from Cisco 7600 with attribute not no NLRI (so not an EOR, just a junk, unless packet) -./sbin/exabgp qa/conf/simple-v4.conf --decode ffffffffffffffffffffffffffffffff004f02000000384001010040020e02030000aaaa0000aaaa0000aaaac0070800aa00aa0a0a0a0a4006004003040a0a0a0a8004040000000040050400000064 +./sbin/exabgp decode etc/exabgp/conf-new-v4.conf ffffffffffffffffffffffffffffffff004f02000000384001010040020e02030000aaaa0000aaaa0000aaaac0070800aa00aa0a0a0a0a4006004003040a0a0a0a8004040000000040050400000064 +# decoding bgp-ls +./sbin/exabgp decode --nlri etc/exabgp/conf-bgpls.conf "00 02 FF FF 03 00 00 00 00 00 00 00 00 01 00 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 0a 0a 0a 01 01 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 02 02 02"