WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@YufengXin
Copy link
Collaborator

@YufengXin YufengXin commented Jul 13, 2025

Resolves: #485

@YufengXin YufengXin self-assigned this Jul 13, 2025
@YufengXin YufengXin linked an issue Jul 13, 2025 that may be closed by this pull request
@YufengXin YufengXin marked this pull request as draft July 13, 2025 05:22
@coveralls
Copy link

coveralls commented Jul 14, 2025

Pull Request Test Coverage Report for Build 17332100181

Details

  • 86 of 114 (75.44%) changed or added relevant lines in 2 files are covered.
  • 10 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.3%) to 54.904%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sdx_controller/handlers/lc_message_handler.py 0 2 0.0%
sdx_controller/handlers/connection_handler.py 86 112 76.79%
Files with Coverage Reduction New Missed Lines %
sdx_controller/handlers/connection_handler.py 1 64.55%
sdx_controller/models/l2vpn_service_id_body.py 9 0.0%
Totals Coverage Status
Change from base Build 17231799867: -0.3%
Covered Lines: 1198
Relevant Lines: 2182

💛 - Coveralls

@YufengXin
Copy link
Collaborator Author

@congwang09 @italovalcy I finished the implementation and unittest. Somehow my end-to-end tests in a Fabric node produces many failures in other unrelated tests. I'll try again later in a clean environment.

If you happen to run end-to-end tests in your environment, please give this PR a try and let me know your results. Thx

Merge branch 'main' into 456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down
@YufengXin YufengXin requested a review from gretelliz July 18, 2025 03:06
@YufengXin YufengXin marked this pull request as ready for review July 18, 2025 03:06
@congwang09
Copy link
Contributor

@congwang09 @italovalcy I finished the implementation and unittest. Somehow my end-to-end tests in a Fabric node produces many failures in other unrelated tests. I'll try again later in a clean environment.

If you happen to run end-to-end tests in your environment, please give this PR a try and let me know your results. Thx

Hi @YufengXin yes, the e2e tests failed when I try this branch.

$ docker compose exec -it mininet python3 -m pytest tests/
==================================================================== test session starts ====================================================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 82 items

tests/test_01_topology.py .....                                                                                                                       [  6%]
tests/test_05_l2vpn.py ......F.                                                                                                                       [ 15%]
tests/test_06_l2vpn_return_codes.py FFFFF.............F..FFF..F...F...                                                                                [ 57%]
tests/test_07_l2vpn_return_codes.py EEEEEEEEEEEEEEEEEEEEEEE                                                                                           [ 85%]
tests/test_08_l2vpn_return_codes.py ..FF..                                                                                                            [ 92%]
tests/test_20_use_case_topology.py xxx                                                                                                                [ 96%]
tests/test_99_topology_big_changes.py ...                                                                                                             [100%]

@YufengXin
Copy link
Collaborator Author

@congwang09 @italovalcy I finished the implementation and unittest. Somehow my end-to-end tests in a Fabric node produces many failures in other unrelated tests. I'll try again later in a clean environment.
If you happen to run end-to-end tests in your environment, please give this PR a try and let me know your results. Thx

Hi @YufengXin yes, the e2e tests failed when I try this branch.

$ docker compose exec -it mininet python3 -m pytest tests/
==================================================================== test session starts ====================================================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 82 items

tests/test_01_topology.py .....                                                                                                                       [  6%]
tests/test_05_l2vpn.py ......F.                                                                                                                       [ 15%]
tests/test_06_l2vpn_return_codes.py FFFFF.............F..FFF..F...F...                                                                                [ 57%]
tests/test_07_l2vpn_return_codes.py EEEEEEEEEEEEEEEEEEEEEEE                                                                                           [ 85%]
tests/test_08_l2vpn_return_codes.py ..FF..                                                                                                            [ 92%]
tests/test_20_use_case_topology.py xxx                                                                                                                [ 96%]
tests/test_99_topology_big_changes.py ...                                                                                                             [100%]

@congwang09 Thx. Better than my previous test using the 'e2e_test_use_cases', where the even the 'test_01_topology.py' failed. Which branch of sdx-end-to-end-tests did you use, the main or e2e_test_use_cases? I'll go ever the 'F' (Failed?) and 'E' (Error?) tests one by one.

@YufengXin
Copy link
Collaborator Author

My test results on the main branch of end-to-end test:

tests/test_01_topology.py ..... [ 5%]
tests/test_05_l2vpn.py ......F. [ 14%]
tests/test_06_l2vpn_return_codes.py .................................. [ 51%]
tests/test_07_l2vpn_return_codes.py ....................... [ 76%]
tests/test_08_l2vpn_return_codes.py ...... [ 82%]
tests/test_20_use_case_topology.py xxFXFxxF.xEEE [ 96%]
tests/test_99_topology_big_changes.py ... [100%]

=========================== short test summary info ============================
FAILED tests/test_05_l2vpn.py::TestE2EL2VPN::test_060_link_convergency_with_l2vpn_with_alternative_paths
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_020_port_in_inter_domain_link_down
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_030_uni_port_down
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_060_port_up_uni
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_081_link_missing_with_alternate_path
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_100_vlan_range_change
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_110_service_no_longer_supported
== 4 failed, 79 passed, 5 xfailed, 1 xpassed, 3 errors in 1562.85s (0:26:02) ===

@congwang09
Copy link
Contributor

Hi @YufengXin after the PCE update, all the tests have passed.

collected 92 items

tests/test_01_topology.py .....                                                                                                                                                                                                      [  5%]
tests/test_05_l2vpn.py ........                                                                                                                                                                                                      [ 14%]
tests/test_06_l2vpn_return_codes.py ..................................                                                                                                                                                               [ 51%]
tests/test_07_l2vpn_return_codes.py .......................                                                                                                                                                                          [ 76%]
tests/test_08_l2vpn_return_codes.py ......                                                                                                                                                                                           [ 82%]
tests/test_20_use_case_topology.py xx.x.xx..x...                                                                                                                                                                                     [ 96%]
tests/test_99_topology_big_changes.py ...                                                                                                                                                                                            [100%]

------------------------------------------------------------------------------------------------------------- start/stop times -------------------------------------------------------------------------------------------------------------
================================================================================================ 86 passed, 6 xfailed in 1736.85s (0:28:56) ================================================================================================

@YufengXin
Copy link
Collaborator Author

Thanks, @congwang09

atlanticwave-sdx/pce#295

is ready for review/merge, which will resolve multiple issues related to port and link (inter- and intra-) failure handling and status reporting.

Copy link
Contributor

@italovalcy italovalcy left a comment

Choose a reason for hiding this comment

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

Hello @YufengXin please fix the regression errors introduced by this PR as showed below:

============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 92 items

tests/test_01_topology.py .....                                          [  5%]
tests/test_05_l2vpn.py ........                                          [ 14%]
tests/test_06_l2vpn_return_codes.py ..................................   [ 51%]
tests/test_07_l2vpn_return_codes.py .......................              [ 76%]
tests/test_08_l2vpn_return_codes.py ......                               [ 82%]
tests/test_20_use_case_topology.py xx.xFxxF.xEEE                         [ 96%]
tests/test_99_topology_big_changes.py ...                                [100%]

==================================== ERRORS ====================================
_ ERROR at setup of TestE2ETopologyUseCases.test_081_link_missing_with_alternate_path _

cls = <class 'test_20_use_case_topology.TestE2ETopologyUseCases'>

    @classmethod
    def setup_method(cls):
        """Reset network configuration before each test."""
        api_url = SDX_CONTROLLER + '/l2vpn/1.0'
        response = requests.get(api_url)
        assert response.status_code == 200, response.text
        response_json = response.json()
        for l2vpn in response_json:
            response = requests.delete(api_url+f'/{l2vpn}')
>           assert response.status_code == 200, response.text
E           AssertionError: "Failed, reason: Unknown connection request (ID: 63fd714b-147d-454c-b8b0-f9335868af64)"
E
E           assert 500 == 200
E            +  where 500 = <Response [500]>.status_code

tests/test_20_use_case_topology.py:63: AssertionError
_____ ERROR at setup of TestE2ETopologyUseCases.test_100_vlan_range_change _____

cls = <class 'test_20_use_case_topology.TestE2ETopologyUseCases'>

    @classmethod
    def setup_method(cls):
        """Reset network configuration before each test."""
        api_url = SDX_CONTROLLER + '/l2vpn/1.0'
        response = requests.get(api_url)
        assert response.status_code == 200, response.text
        response_json = response.json()
        for l2vpn in response_json:
            response = requests.delete(api_url+f'/{l2vpn}')
>           assert response.status_code == 200, response.text
E           AssertionError: "Failed, reason: Unknown connection request (ID: 63fd714b-147d-454c-b8b0-f9335868af64)"
E
E           assert 500 == 200
E            +  where 500 = <Response [500]>.status_code

tests/test_20_use_case_topology.py:63: AssertionError
_ ERROR at setup of TestE2ETopologyUseCases.test_110_service_no_longer_supported _

cls = <class 'test_20_use_case_topology.TestE2ETopologyUseCases'>

    @classmethod
    def setup_method(cls):
        """Reset network configuration before each test."""
        api_url = SDX_CONTROLLER + '/l2vpn/1.0'
        response = requests.get(api_url)
        assert response.status_code == 200, response.text
        response_json = response.json()
        for l2vpn in response_json:
            response = requests.delete(api_url+f'/{l2vpn}')
>           assert response.status_code == 200, response.text
E           AssertionError: "Failed, reason: Unknown connection request (ID: 63fd714b-147d-454c-b8b0-f9335868af64)"
E
E           assert 500 == 200
E            +  where 500 = <Response [500]>.status_code

tests/test_20_use_case_topology.py:63: AssertionError
=================================== FAILURES ===================================
________________ TestE2ETopologyUseCases.test_030_uni_port_down ________________

self = <test_20_use_case_topology.TestE2ETopologyUseCases object at 0x7fe8603f95d0>

    def test_030_uni_port_down(self):
        """
        Use case 3: OXPO sends a topology update with a Port Down and that port is an UNI for some L2VPN.
        """
        l2vpn_data = self.create_new_l2vpn(vlan='300')
        l2vpn_id = l2vpn_data['id']

        # Get UNI ports
        port = 'urn:sdx:port:tenet.ac.za:Tenet01:50'
        response = requests.get(API_URL_TOPO)
        data = response.json()
        ports = {port["id"] for node in data["nodes"] for port in node["ports"] if port['nni'] == ''}
        assert port in ports

        Tenet01 = self.net.net.get('Tenet01')
        Tenet01.intf('Tenet01-eth50').ifconfig('down')

        time.sleep(15)

        data = requests.get(API_URL).json()
>       assert data[l2vpn_id]["status"] == "down"
E       AssertionError: assert 'up' == 'down'
E         - down
E         + up

tests/test_20_use_case_topology.py:324: AssertionError
_________________ TestE2ETopologyUseCases.test_060_port_up_uni _________________

self = <test_20_use_case_topology.TestE2ETopologyUseCases object at 0x7fe8603fb390>

    def test_060_port_up_uni(self):
        """
        Use Case 6: OXPO sends a topology update with a Port UP and that port is UNI for some L2VPNs.

        Expected behavior:
        SDX Controller: update the statuses involved. Use Case 3 is explicit saying the configs should not be removed in case of a Port Down
        which means the data plane config is already there.
        """

        l2vpn_data = self.create_new_l2vpn(vlan='600')
        l2vpn_id = l2vpn_data['id']

        # Simulate UNI port going down
        ampath_node = self.net.net.get('Ampath1')
        ampath_node.intf('Ampath1-eth50').ifconfig('down')

        time.sleep(15)

        # Verify L2VPN status is down
        response = requests.get(API_URL)
        assert response.status_code == 200, response.text
        l2vpn_response = response.json()
        assert l2vpn_id in l2vpn_response
>       assert l2vpn_response.get(l2vpn_id).get("status") == "down", str(l2vpn_response)
E       AssertionError: {'91d7037c-3f2b-438b-9c64-140e6cfb2ec6': {'archived_date': 0, 'current_path': [{'port_id': 'urn:sdx:port:ampath.net:Ampath1:50', 'vlan': '600'}, {'port_id': 'urn:sdx:port:ampath.net:Ampath1:40', 'vlan': '1'}, {'port_id': 'urn:sdx:port:sax.net:Sax01:40', 'vlan': '1'}, {'port_id': 'urn:sdx:port:sax.net:Sax01:41', 'vlan': '1'}, {'port_id': 'urn:sdx:port:tenet.ac.za:Tenet01:41', 'vlan': '1'}, {'port_id': 'urn:sdx:port:tenet.ac.za:Tenet01:50', 'vlan': '600'}], 'description': None, 'endpoints': [{'port_id': 'urn:sdx:port:ampath.net:Ampath1:50', 'vlan': '600'}, {'port_id': 'urn:sdx:port:tenet.ac.za:Tenet01:50', 'vlan': '600'}], 'name': 'Test L2VPN', 'oxp_response': {'ampath.net': [200, {'circuit_id': 'f86e6cea00c043', 'deployed': True}], 'sax.net': [200, {'circuit_id': '4b981bd301804d', 'deployed': True}], 'tenet.ac.za': [200, {'circuit_id': '7eebdbc670b14c', 'deployed': True}]}, 'service_id': '91d7037c-3f2b-438b-9c64-140e6cfb2ec6', 'status': 'up'}}
E       assert 'up' == 'down'
E         - down
E         + up

tests/test_20_use_case_topology.py:469: AssertionError
------------------------------- start/stop times -------------------------------
tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_030_uni_port_down: 2025-08-06,19:48:22.789116 - 2025-08-06,19:48:46.040081
tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_060_port_up_uni: 2025-08-06,19:50:03.276855 - 2025-08-06,19:50:26.508738
=========================== short test summary info ============================
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_030_uni_port_down
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_060_port_up_uni
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_081_link_missing_with_alternate_path
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_100_vlan_range_change
ERROR tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_110_service_no_longer_supported
======== 2 failed, 81 passed, 6 xfailed, 3 errors in 1565.49s (0:26:05) ========

@YufengXin
Copy link
Collaborator Author

YufengXin commented Aug 8, 2025

@italovalcy Thanks for the review. Were you using the main branch or another branch of end-to-end-test?
I tested against the main branch and every test passed before opening it up to you.

LMK so I can fix the tests quickly.

@italovalcy I see @gretelliz recently made new merges in end-to-end-test after my test in this PR, particularly in the test_20_use_case_topology.py that caused these new errors.

@gretelliz could you pls confirm that these new test cases were passed with the main branch of sdx-controller, or not?
Thx.

Yufeng Xin added 8 commits August 12, 2025 18:51
Merge remote-tracking branch 'origin/main' into 456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down
@YufengXin YufengXin force-pushed the 456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down branch from 5355791 to 45e43a4 Compare August 22, 2025 22:49
@YufengXin YufengXin marked this pull request as ready for review August 23, 2025 18:59
@YufengXin
Copy link
Collaborator Author

YufengXin commented Aug 23, 2025

@italovalcy @gretelliz I decided to complete this PR by fixing the last bit on returning connections status. While this PR was originally for processing the "intra-domain" link failures, the changes are mostly about streamlining the workflow in identifying failed elements and process. The accompanying PR in PCE is here:

atlanticwave-sdx/pce#295

Following is the end-to-end-test (main branch) results:

Executing cd ~/awsdx/sdx-end-to-end-tests && ./wait-mininet-ready.sh
Executing cd ~/awsdx/sdx-end-to-end-tests && docker compose exec -it mininet python3 -m pytest | tee /tmp/docker-compose-exec-pytest.out
============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 95 items

tests/test_01_topology.py ..... [ 5%]
tests/test_05_l2vpn.py ........ [ 13%]
tests/test_06_l2vpn_return_codes.py .................................. [ 49%]
tests/test_07_l2vpn_return_codes.py ....................... [ 73%]
tests/test_08_l2vpn_return_codes.py ...... [ 80%]
tests/test_20_use_case_topology.py Xx.x.xx...x [ 92%]
tests/test_21_use_case_topology.py x.xx [ 96%]
tests/test_99_topology_big_changes.py ... [100%]

------------------------------- start/stop times -------------------------------
============ 86 passed, 8 xfailed, 1 xpassed in 1653.31s (0:27:33) =============

@italovalcy
Copy link
Contributor

@YufengXin thanks for providing the update on this PR! End-to-end tests seems fine, however using your branch seems to raise exception when restarting the controller, an issue that was already fixed on datamodel -> pce -> sdx-controller. Can you please rebase your branch with latest changes from main on those repos? This PR here for instance is showing conflicts on pyproject.toml and also connection_handler.py

Once you rebase your changes and update with main branches, please let me know and I will redo the tests.

Here is the error I'm facing after restart the controller (once again: this issue was already fixed on datamodel, we just need you to rebase your code with main branch):

sdx-controller-1  | 2025-08-29T13:17:38.971373484Z Exception in thread Thread-2 (start_sdx_consumer):
sdx-controller-1  | 2025-08-29T13:17:38.971383772Z Traceback (most recent call last):
sdx-controller-1  | 2025-08-29T13:17:38.971389175Z   File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
sdx-controller-1  | 2025-08-29T13:17:38.971639230Z     self.run()
sdx-controller-1  | 2025-08-29T13:17:38.971660221Z   File "/usr/local/lib/python3.11/threading.py", line 982, in run
sdx-controller-1  | 2025-08-29T13:17:38.971868206Z     self._target(*self._args, **self._kwargs)
sdx-controller-1  | 2025-08-29T13:17:38.971911480Z   File "/opt/venv/lib/python3.11/site-packages/sdx_controller/messaging/rpc_queue_consumer.py", line 125, in start_sdx_consumer
sdx-controller-1  | 2025-08-29T13:17:38.971982281Z     self.te_manager.add_topology(topology)
sdx-controller-1  | 2025-08-29T13:17:38.972007963Z   File "/opt/venv/lib/python3.11/site-packages/sdx_pce/topology/temanager.py", line 91, in add_topology
sdx-controller-1  | 2025-08-29T13:17:38.972075056Z     self.topology_manager.add_topology(topology_data)
sdx-controller-1  | 2025-08-29T13:17:38.972089543Z   File "/opt/venv/lib/python3.11/site-packages/sdx_pce/topology/manager.py", line 119, in add_topology
sdx-controller-1  | 2025-08-29T13:17:38.972148845Z     topology = TopologyHandler().import_topology_data(data)
sdx-controller-1  | 2025-08-29T13:17:38.972172231Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972185325Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/parsing/topologyhandler.py", line 27, in import_topology_data
sdx-controller-1  | 2025-08-29T13:17:38.972248590Z     return Topology(
sdx-controller-1  | 2025-08-29T13:17:38.972257458Z            ^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972262065Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/models/topology.py", line 96, in __init__
sdx-controller-1  | 2025-08-29T13:17:38.972320790Z     self._nodes = self.set_nodes(nodes)
sdx-controller-1  | 2025-08-29T13:17:38.972338607Z                   ^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972347492Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/models/topology.py", line 308, in set_nodes
sdx-controller-1  | 2025-08-29T13:17:38.972439775Z     node_obj = node_handler.import_node_data(node)
sdx-controller-1  | 2025-08-29T13:17:38.972466086Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972478515Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/parsing/nodehandler.py", line 28, in import_node_data
sdx-controller-1  | 2025-08-29T13:17:38.972513682Z     return Node(
sdx-controller-1  | 2025-08-29T13:17:38.972522645Z            ^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972527885Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/models/node.py", line 83, in __init__
sdx-controller-1  | 2025-08-29T13:17:38.972583130Z     self._ports = self.set_ports(ports)
sdx-controller-1  | 2025-08-29T13:17:38.972607446Z                   ^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972612810Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/models/node.py", line 300, in set_ports
sdx-controller-1  | 2025-08-29T13:17:38.972689452Z     port_obj = port_handler.import_port_data(port)
sdx-controller-1  | 2025-08-29T13:17:38.972713802Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972725870Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/parsing/porthandler.py", line 49, in import_port_data
sdx-controller-1  | 2025-08-29T13:17:38.972777410Z     services = self._validate_l2vpn_services(
sdx-controller-1  | 2025-08-29T13:17:38.972786397Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972791621Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/parsing/porthandler.py", line 110, in _validate_l2vpn_services
sdx-controller-1  | 2025-08-29T13:17:38.972842907Z     l2vpn_ptmp_vlan_range = self._validate_vlan_range(vlan_range)
sdx-controller-1  | 2025-08-29T13:17:38.972875595Z                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sdx-controller-1  | 2025-08-29T13:17:38.972884670Z   File "/opt/venv/lib/python3.11/site-packages/sdx_datamodel/parsing/porthandler.py", line 140, in _validate_vlan_range
sdx-controller-1  | 2025-08-29T13:17:38.972977377Z     raise InvalidVlanRangeException(
sdx-controller-1  | 2025-08-29T13:17:38.972989142Z sdx_datamodel.parsing.exceptions.InvalidVlanRangeException: VLAN range (None) must be a list, but is <class 'NoneType'>

@YufengXin
Copy link
Collaborator Author

@italovalcy Thanks a lot for the test. I merged main along the chain: only a minor conflict in that port in DB function (add a few logs), which I merged the one in main.

@italovalcy
Copy link
Contributor

Hi Yufeng,

@italovalcy Thanks a lot for the test. I merged main along the chain: only a minor conflict in that port in DB function (add a few logs), which I merged the one in main.

Tested again with your updates and I'm now getting errors on the end-to-end tests:

============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 95 items

tests/test_01_topology.py .....                                          [  5%]
tests/test_05_l2vpn.py ........                                          [ 13%]
tests/test_06_l2vpn_return_codes.py ..................................   [ 49%]
tests/test_07_l2vpn_return_codes.py .......................              [ 73%]
tests/test_08_l2vpn_return_codes.py ......                               [ 80%]
tests/test_20_use_case_topology.py Xx.xFxxF...x                          [ 92%]
tests/test_21_use_case_topology.py x.xx                                  [ 96%]
tests/test_99_topology_big_changes.py ...                                [100%]

=================================== FAILURES ===================================
=========================== short test summary info ============================
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_030_uni_port_down
FAILED tests/test_20_use_case_topology.py::TestE2ETopologyUseCases::test_060_port_up_uni
======= 2 failed, 84 passed, 8 xfailed, 1 xpassed in 1643.94s (0:27:23) ========

Full output attached.

end-to-end-sdx-results.txt

@YufengXin
Copy link
Collaborator Author

@italovalcy Thx, looks like my change to that function is necessary. BTW, could you just confirm that this doesn't cause the controller restart issue anymore?

I'll rerun/fix the end-to-end tests.

…DB entry format need to pair with the other two functions:handle_uni_ports_down_to_up() and handle_uni_ports_up_to_down()
@YufengXin
Copy link
Collaborator Author

@italovalcy I reversed the merge, "reverse the change to connection_handler.py._process_port(), since the DB entry format needs to match that in the other two pairing functions:handle_uni_ports_down_to_up() and handle_uni_ports_up_to_down()"
Note, I've already used the db.get_value_from_db() function.
Here are the end-to-end-test results (most of the remaining xfail cases are related to node failure which hasn't been explicitly handled, which I'l; implement after this PR, pretty straightforward):

============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 95 items

tests/test_01_topology.py ..... [ 5%]
tests/test_05_l2vpn.py ........ [ 13%]
tests/test_06_l2vpn_return_codes.py .................................. [ 49%]
tests/test_07_l2vpn_return_codes.py ....................... [ 73%]
tests/test_08_l2vpn_return_codes.py ...... [ 80%]
tests/test_20_use_case_topology.py Xx.x.xx....x [ 92%]
tests/test_21_use_case_topology.py x.xx [ 96%]
tests/test_99_topology_big_changes.py ... [100%]

------------------------------- start/stop times -------------------------------
============ 86 passed, 8 xfailed, 1 xpassed in 1658.78s (0:27:38) =============

@italovalcy
Copy link
Contributor

I've executed a new review on the end-to-end tests and results are going well so far:

$ git log -1
commit 335dd36929597b7d2618b9ab2d92a4de91287a3a (HEAD -> 456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down, origin/456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down)
Author: Yufeng Xin <[email protected]>
Date:   Fri Aug 29 15:02:53 2025 -0400

    reverse the change to connection_handler.py._process_port, since the DB entry format need to pair with the other two functions:handle_uni_ports_down_to_up() and handle_uni_ports_up_to_down()

============================= test session starts ==============================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sdx-end-to-end-tests
plugins: unordered-0.7.0
collected 100 items

tests/test_01_topology.py .....                                          [  5%]
tests/test_05_l2vpn.py ........                                          [ 13%]
tests/test_06_l2vpn_return_codes.py ..................................   [ 47%]
tests/test_07_l2vpn_return_codes.py .......................              [ 70%]
tests/test_08_l2vpn_return_codes.py ......                               [ 76%]
tests/test_20_use_case_topology.py Xx.x.xx..xxxxxxxx                     [ 93%]
tests/test_21_use_case_topology.py x.xx                                  [ 97%]
tests/test_99_topology_big_changes.py ...                                [100%]

------------------------------- start/stop times -------------------------------
============ 84 passed, 15 xfailed, 1 xpassed in 1694.24s (0:28:14) ============

@italovalcy
Copy link
Contributor

@YufengXin I believe this PR will also fix #485

@congwang09 congwang09 merged commit 6e003a5 into main Sep 9, 2025
7 checks passed
@congwang09 congwang09 deleted the 456-l2vpn-status-fails-to-change-after-an-intra-domain-link-is-down branch September 9, 2025 19:59
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.

Failed to delete L2VPNs after restarting the controller L2VPN status fails to change after an intra-domain link is down

6 participants