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

[Fixbug]: Fix vnet attribute miss if route action is vnet_direct and vnet test cases #2877

Merged
merged 2 commits into from
Aug 22, 2023

Commits on Aug 17, 2023

  1. [Fixbug]: Fix vnet attribute miss if route action is vnet_direct and …

    …vnet test cases (sonic-net#2873)
    
    What I did
    
    For outbound routing, I fix a bug that vnet name will lose in vnet_direct case.
    The fvs from asic db is the dict type in test cases of dash vnet, for a dict will just for its keys.
    Why I did it
    
    The vnet name in vnet and vnet_direct cases are defined in a different field.
    https://github.com/sonic-net/sonic-dash-api/blob/3f728d1bbf65d2e8c41bdc023d5c07702a7f848b/proto/route.proto#L30-L32
    message VnetDirect {
        // destination vnet name if action_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering
        string vnet = 1;
    ...
    }
    
    message Route {
        route_type.RoutingType action_type = 1;
        oneof Action {
            // destination vnet name if action_type is vnet,, a vnet other than eni's vnet means vnet peering
            string vnet = 2;
            // destination vnet name if action_type is vnet_direct,, a vnet other than eni's vnet means vnet peering
            route_lpm.VnetDirect vnet_direct = 3;
    ...
        }
      }
    Add the items after fvs to fetch each items of fvs
    How I verified it
    Add a new test case and check tests.
    
    $ sudo pytest --dvsname=vs --num-ports=32 test_dash_vnet.py  --pdb
    ====================================== test session starts ======================================
    platform linux -- Python 3.8.10, pytest-7.2.2, pluggy-1.0.0
    rootdir: /home/zegan/workspace/sonic-swss/tests
    plugins: flaky-3.7.0
    collected 8 items
    
    test_dash_vnet.py ........                                                                [100%]
    
    ======================================= warnings summary ========================================
    
    
    Signed-off-by: Ze Gan <[email protected]>
    Pterosaur committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    288d3c5 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2023

  1. Configuration menu
    Copy the full SHA
    4196752 View commit details
    Browse the repository at this point in the history