Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] RFC2622 v6 tests and fix #598

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend-services/prefixtree/core/prefixtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ def annotate_bgp_update(self, message: Dict) -> NoReturn:
routing_key="update-with-prefix-node",
serializer="ujson",
)
# else:
# log.warning("unconfigured BGP update received '{}'".format(bgp_update))
else:
log.warning("unconfigured BGP update received '{}'".format(bgp_update))
except Exception:
log.exception("exception")

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- autoconfiguration subprefix bug in prefixtree plus new autoconf tests
- vagrant docker-compose.yaml file fix (sync with master)
- session timeout behavior
- rfc2622 fix and tests

### Removed
- TBD (removed a feature)
Expand Down
6 changes: 6 additions & 0 deletions testing/detection/configs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ prefixes:
- 10.12.0.0/16^24
test_n_m_op_16: &test_n_m_op_16
- 10.13.0.0/16^20-24
test_n_op_32: &test_n_op_32
- 2001:db8::/32^48
test_n_m_op_32: &test_n_m_op_32
- 2001:db9::/32^32-48
test_comms_24: &test_comms_24
- 10.0.20.0/24
test_as_set_24: &test_as_set_24
Expand Down Expand Up @@ -131,6 +135,8 @@ rules:
- *test_inc_op_23
- *test_n_op_16
- *test_n_m_op_16
- *test_n_op_32
- *test_n_m_op_32
origin_asns:
- *op_test_origin
neighbors:
Expand Down
6 changes: 6 additions & 0 deletions testing/detection/configs/config3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ prefixes:
- 10.12.0.0/16^24
test_n_m_op_16: &test_n_m_op_16
- 10.13.0.0/16^20-24
test_n_op_32: &test_n_op_32
- 2001:db8::/32^48
test_n_m_op_32: &test_n_m_op_32
- 2001:db9::/32^32-48
test_comms_24: &test_comms_24
- 10.0.20.0/24
test_as_set_24: &test_as_set_24
Expand Down Expand Up @@ -112,6 +116,8 @@ rules:
- *test_inc_op_23
- *test_n_op_16
- *test_n_m_op_16
- *test_n_op_32
- *test_n_m_op_32
origin_asns:
- *op_test_origin
neighbors:
Expand Down
74 changes: 74 additions & 0 deletions testing/detection/testfiles/rfc2622.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,79 @@
"num_peers_seen": 1,
"configured_prefix": "10.13.1.0/24"
}
},
{
"send": {
"key": "30",
"timestamp": 30,
"orig_path": [],
"communities": [],
"service": "a",
"type": "A",
"path": [6, 3, 2, 202],
"prefix": "2001:db8:859::/48",
"peer_asn": 6
},
"detection_update_response": {
"key": "30",
"handled": true,
"matched_prefix": "2001:db8::/48",
"origin_as": 202
},
"detection_hijack_response": {
"prefix": "2001:db8:859::/48",
"hijack_as": 202,
"type": "E|0|-|-",
"time_started": 30.0,
"configured_prefix": "2001:db8::/48"
},
"database_hijack_response": {
"type": "E|0|-|-",
"active": true,
"prefix": "2001:db8:859::/48",
"asns_inf": [2, 3, 6],
"hijack_as": 202,
"peers_seen": [6],
"num_asns_inf": 3,
"num_peers_seen": 1,
"configured_prefix": "2001:db8::/48"
}
},
{
"send": {
"key": "31",
"timestamp": 31,
"orig_path": [],
"communities": [],
"service": "b",
"type": "A",
"path": [7, 3, 2, 203],
"prefix": "2001:db9:859::/48",
"peer_asn": 7
},
"detection_update_response": {
"key": "31",
"handled": true,
"matched_prefix": "2001:db9::/48",
"origin_as": 203
},
"detection_hijack_response": {
"prefix": "2001:db9:859::/48",
"hijack_as": 203,
"type": "E|0|-|-",
"time_started": 31.0,
"configured_prefix": "2001:db9::/48"
},
"database_hijack_response": {
"type": "E|0|-|-",
"active": true,
"prefix": "2001:db9:859::/48",
"asns_inf": [2, 3, 7],
"hijack_as": 203,
"peers_seen": [7],
"num_asns_inf": 3,
"num_peers_seen": 1,
"configured_prefix": "2001:db9::/48"
}
}
]