Skip to content

Commit

Permalink
improve decode option doc and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Nov 11, 2021
1 parent 8f037b9 commit 63e797e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion qa/bin/decode
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 63e797e

Please sign in to comment.