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

[Fix] undesired_links (logical OR) and desired_links (logical AND) filters #30

Merged
merged 8 commits into from
Oct 11, 2022

Conversation

viniarck
Copy link
Member

This PR supersedes PR #28 (it also fixes issue 29)

Fixes #20 #27 #29

  • Fixed undesired_links (logical OR) and desired_links filters (logical AND)
  • Subscribed to kytos/topology.topology_loaded as well to be more promptly responsive

I've explored it locally with the same topology that Italo has initially reported the issue and same request, here's a diff of the response:

❯ diff /tmp/resp_master.json /tmp/resp_fix.json
11,30d10
<         "00:00:00:00:00:00:00:02:3",
<         "00:00:00:00:00:00:00:03:2",
<         "00:00:00:00:00:00:00:03",
<         "00:00:00:00:00:00:00:03:4",
<         "00:00:00:00:00:00:00:06:5",
<         "00:00:00:00:00:00:00:06",
<         "00:00:00:00:00:00:00:06:2",
<         "00:00:00:00:00:00:00:05:3",
<         "00:00:00:00:00:00:00:05",
<         "00:00:00:00:00:00:00:05:1"
<       ]
<     },
<     {
<       "cost": 14,
<       "hops": [
<         "00:00:00:00:00:00:00:01:1",
<         "00:00:00:00:00:00:00:01",
<         "00:00:00:00:00:00:00:01:2",
<         "00:00:00:00:00:00:00:02:2",
<         "00:00:00:00:00:00:00:02",

  • If you grep for the endpoints on master branch you'd find the undesired_links included:
❯ rg "00:00:00:00:00:00:00:01:3|00:00:00:00:00:00:00:06:3|00:00:00:00:00:00:00:05:3|00:00:00:00:00:00:00:06:2" /tmp/resp_master.json
17:        "00:00:00:00:00:00:00:06:2",
18:        "00:00:00:00:00:00:00:05:3",
  • If you grep for the expected excluded links/endpoints with this branch they got excluded:
❯ rg "00:00:00:00:00:00:00:01:3|00:00:00:00:00:00:00:06:3|00:00:00:00:00:00:00:05:3|00:00:00:00:00:00:00:06:2" /tmp/resp_fix.json

I've also re-run the same example of issue #27, no longer duplicated paths are being seeing in the response, and desired_links now can be used to narrow down a set of links in the path. In the future, we might also have the logical expression being parametrized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undesired links not working as expected
1 participant