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

Conversation

Pterosaur
Copy link
Contributor

@Pterosaur Pterosaur commented Aug 17, 2023

What I did

  1. For outbound routing, I fix a bug that vnet name will lose in vnet_direct case.
  2. 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

  1. 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;
...
    }
  }
  1. 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 ========================================

Details if related

…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 Pterosaur marked this pull request as ready for review August 17, 2023 02:26
@Pterosaur Pterosaur changed the title [Fixbug]: Fix vnet attribute miss if route action is vnet_direct and … [Fixbug]: Fix vnet attribute miss if route action is vnet_direct and vnet test cases Aug 17, 2023
@Pterosaur
Copy link
Contributor Author

This PR is cherry-picked from #2873. @lguohan Please help to merge it.

@lguohan
Copy link
Contributor

lguohan commented Aug 17, 2023

@Pterosaur , test is failing, can you check?

@lguohan lguohan merged commit 7102220 into sonic-net:master Aug 22, 2023
15 checks passed
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.

2 participants