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

feature: Added support to list[list[int]] input #428

Merged
merged 13 commits into from
Nov 22, 2023
Merged

Conversation

Alopalao
Copy link

@Alopalao Alopalao commented Oct 30, 2023

Closes #427

Summary

  • Added range_addition(). Its presence is not final but is used in the meantime.

  • Added exceptions KytosInvalidRanges, KytosTagsAreNotAvailable and KytosTagsNotInTagRanges

  • Added support for input list[list[int]] to use_tags() and make_tags_available()

  • These methods also have changed their return. For use_tags() there is no longer a return value, instead, it raises KytosTagsAreNotAvailable for any errors. make_tags_available() returns any conflicting values, this does not stop the addition process. It can also raise KytosTagsNotInTagRanges.

  • Created the file tag_ranges.py that contains every Interface range-related method that was static.

  • Created TAGRange class for tags that have a list of ranges of tags.

  • Moved get_tag_ranges() and map_singular_values() to tag_ranges.py so it can be used for other, currently mef_eline and topology are planned to use it.

Local Tests

  • Need to modify some unit tests.
  • Using these changes in vlan_range development

End-To-End Tests

============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-7.2.0, pluggy-1.3.0
rootdir: /tests
plugins: timeout-2.1.0, rerunfailures-10.2, anyio-3.6.2
collected 244 items

tests/test_e2e_01_kytos_startup.py ..                                    [  0%]
tests/test_e2e_05_topology.py ..................                         [  8%]
tests/test_e2e_10_mef_eline.py ..........ss.....x.....x................  [ 24%]
tests/test_e2e_11_mef_eline.py ......                                    [ 27%]
tests/test_e2e_12_mef_eline.py .....Xx.                                  [ 30%]
tests/test_e2e_13_mef_eline.py ....Xs.s.....Xs.s.XXxX.xxxx..X........... [ 47%]
.                                                                        [ 47%]
tests/test_e2e_14_mef_eline.py x                                         [ 47%]
tests/test_e2e_15_mef_eline.py ....                                      [ 49%]
tests/test_e2e_20_flow_manager.py .....................                  [ 58%]
tests/test_e2e_21_flow_manager.py ...                                    [ 59%]
tests/test_e2e_22_flow_manager.py ...............                        [ 65%]
tests/test_e2e_23_flow_manager.py ..............                         [ 71%]
tests/test_e2e_30_of_lldp.py ....                                        [ 72%]
tests/test_e2e_31_of_lldp.py ...                                         [ 74%]
tests/test_e2e_32_of_lldp.py ...                                         [ 75%]
tests/test_e2e_40_sdntrace.py .............                              [ 80%]
tests/test_e2e_41_kytos_auth.py ........                                 [ 84%]
tests/test_e2e_42_sdntrace.py ..                                         [ 84%]
tests/test_e2e_50_maintenance.py ........................                [ 94%]
tests/test_e2e_60_of_multi_table.py .....                                [ 96%]
tests/test_e2e_70_kytos_stats.py ........                                [100%]

- Moved get_tag_ranges()
@Alopalao Alopalao marked this pull request as ready for review November 6, 2023 19:17
@Alopalao Alopalao requested a review from a team as a code owner November 6, 2023 19:17
kytos/core/interface.py Outdated Show resolved Hide resolved
Copy link
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's shaping up well all things considered that have been discussed on the issue discussion too. I've done a first review pass, I'll do another one in the future.

@Alopalao I'll also wait for a future PR with mef_eline using this PR, just so it's also easier to test in practice with a NApp using it for real (as you're already doing locally that you mentioned). At that time you can also ship the new e2e tests covering how the uni vlan range will be used.

kytos/core/exceptions.py Outdated Show resolved Hide resolved
kytos/core/exceptions.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Show resolved Hide resolved
kytos/core/interface.py Show resolved Hide resolved
kytos/core/link.py Outdated Show resolved Hide resolved
@viniarck viniarck requested a review from a team November 6, 2023 22:42
Copy link
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, @Alopalao, I've just done a second pass, and it was great to also explore it a bit with mef_eline PR. I've raised a few minor points that we need to sort out. Finally, let's update the changelog too after these open threads are addressed.

Let's also make sure e2e are passing as you mentioned, it'd be great to also have the new mef_eline vlan ranges e2e too.

Final observation, I haven't stress tested it, as you've done it, but regarding the low digit ms worst case scenarios let's also explore it again and see if locks and anything else might get impacted.

kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
@viniarck viniarck requested a review from a team November 7, 2023 21:19
kytos/core/exceptions.py Outdated Show resolved Hide resolved
Copy link
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, @Alopalao, this is pretty much ready to land. I've opened a few minor threads though. Also, changelog hasn't been updated.

kytos/core/tag_ranges.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/interface.py Show resolved Hide resolved
kytos/core/interface.py Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
kytos/core/link.py Outdated Show resolved Hide resolved
kytos/core/interface.py Outdated Show resolved Hide resolved
@viniarck viniarck self-requested a review November 21, 2023 14:40
Copy link
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alopalao appreciated your updates, it's pretty much ready to land, if you could address the last thread that I opened and also update the changelog, after that I'll approve this PR. This is a fantastic contribution unlocking vlan range usage.

@viniarck viniarck self-requested a review November 21, 2023 16:58
Copy link
Member

@viniarck viniarck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img

It'll get merged in the next hour or so. Let's ship it.

@viniarck viniarck merged commit b4cfefc into master Nov 22, 2023
2 checks passed
@viniarck viniarck deleted the epic/vlan_range branch November 22, 2023 12:50
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.

Improve Interface related methods
2 participants