Skip to content

[debug dump util] portchannel module added#1777

Closed
vivekrnv wants to merge 4 commits intosonic-net:masterfrom
vivekrnv:dump_module_lag
Closed

[debug dump util] portchannel module added#1777
vivekrnv wants to merge 4 commits intosonic-net:masterfrom
vivekrnv:dump_module_lag

Conversation

@vivekrnv
Copy link
Copy Markdown
Contributor

Signed-off-by: Vivek Reddy Karri [email protected]

What I did

HLD for Dump Utility: HLD.

  • Added the portchannel Module to the Debug Dump Utility
  • Added the Corresponding UT's

How I did it

How to verify it

collected 1148 items / 1144 deselected                                                                                                                                                                            

tests/dump_tests/module_tests/portchannel_test.py::TestPortChannelModule::test_get_all_args PASSED                                                                                                          [ 25%]
tests/dump_tests/module_tests/portchannel_test.py::TestPortChannelModule::test_lag_with_members PASSED                                                                                                      [ 50%]
tests/dump_tests/module_tests/portchannel_test.py::TestPortChannelModule::test_lag_with_no_members PASSED                                                                                                   [ 75%]
tests/dump_tests/module_tests/portchannel_test.py::TestPortChannelModule::test_missing_appl_state PASSED   

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

admin@sonic:~$ dump state portchannel PortChannel001
{
    "PortChannel001": {
        "CONFIG_DB": {
            "keys": [
                {
                    "PORTCHANNEL|PortChannel001": {
                        "admin_status": "up",
                        "lacp_key": "auto",
                        "min_links": "1",
                        "mtu": "9100"
                    }
                }
            ],
            "tables_not_found": [
                "PORTCHANNEL_MEMBER"
            ]
        },
        "APPL_DB": {
            "keys": [
                {
                    "LAG_TABLE:PortChannel001": {
                        "admin_status": "up",
                        "mtu": "9100",
                        "oper_status": "down"
                    }
                }
            ],
            "tables_not_found": [
                "LAG_MEMBER_TABLE"
            ]
        },
        "ASIC_DB": {
            "keys": [],
            "tables_not_found": [
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER",
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG"
            ]
        },
        "STATE_DB": {
            "keys": [
                {
                    "LAG_TABLE|PortChannel001": {
                        "runner.active": "true",
                        "runner.fallback": "false",
                        "runner.fast_rate": "false",
                        "setup.kernel_team_mode_name": "loadbalance",
                        "setup.pid": "28",
                        "state": "ok",
                        "team_device.ifinfo.dev_addr": "1c:34:da:23:45:00",
                        "team_device.ifinfo.ifindex": "77"
                    }
                }
            ],
            "tables_not_found": [
                "LAG_MEMBER_TABLE"
            ]
        }
    }
}

admin@sonic:~$ dump state portchannel PortChannel002 --key-map
{
    "PortChannel002": {
        "CONFIG_DB": {
            "keys": [
                "PORTCHANNEL|PortChannel002",
                "PORTCHANNEL_MEMBER|PortChannel002|Ethernet24",
                "PORTCHANNEL_MEMBER|PortChannel002|Ethernet16",
                "PORTCHANNEL_MEMBER|PortChannel002|Ethernet8"
            ],
            "tables_not_found": []
        },
        "APPL_DB": {
            "keys": [
                "LAG_TABLE:PortChannel002",
                "LAG_MEMBER_TABLE:PortChannel002:Ethernet24",
                "LAG_MEMBER_TABLE:PortChannel002:Ethernet8",
                "LAG_MEMBER_TABLE:PortChannel002:Ethernet16"
            ],
            "tables_not_found": []
        },
        "ASIC_DB": {
            "keys": [
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER:oid:0x1b0000000007e1",
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER:oid:0x1b0000000007e0",
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER:oid:0x1b0000000007df",
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG:oid:0x20000000007de"
            ],
            "tables_not_found": [],
            "vidtorid": {
                "oid:0x1b0000000007e1": "oid:0x165000001001b",
                "oid:0x1b0000000007e0": "oid:0x161000001001b",
                "oid:0x1b0000000007df": "oid:0x16d000001001b",
                "oid:0x20000000007de": "oid:0x8100000002"
            }
        },
        "STATE_DB": {
            "keys": [
                "LAG_TABLE|PortChannel002",
                "LAG_MEMBER_TABLE|PortChannel002|Ethernet16",
                "LAG_MEMBER_TABLE|PortChannel002|Ethernet8",
                "LAG_MEMBER_TABLE|PortChannel002|Ethernet24"
            ],
            "tables_not_found": []
        }
    }
}

vivekrnv added 3 commits July 26, 2021 16:52
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Aug 21, 2021

This pull request introduces 1 alert when merging d2ebee8 into c03342f - view on LGTM.com

new alerts:

  • 1 for Unused import

@liat-grozovik
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Copy Markdown
Collaborator

@vivekreddynv could you please update command reference guide with this addition and any other coming on this cli command?

@vivekrnv
Copy link
Copy Markdown
Contributor Author

@vivekreddynv could you please update command reference guide with this addition and any other coming on this cli command?

I can do so, once this PR is merged, #1668 (This PR already updates the command reference guide with the existing commands). i'm pretty sure there'll be merge conflicts, if i add it here anyway. So, i'll rather wait until that PR gets merged.

Also, on a side note, should the command reference guide be updated for every module which is coming in?

@liat-grozovik
Copy link
Copy Markdown
Collaborator

@vivekreddynv could you please update command reference guide with this addition and any other coming on this cli command?

I can do so, once this PR is merged, #1668 (This PR already updates the command reference guide with the existing commands). i'm pretty sure there'll be merge conflicts, if i add it here anyway. So, i'll rather wait until that PR gets merged.

Also, on a side note, should the command reference guide be updated for every module which is coming in?

It is a good question. I think the command reference should be general and not per each but once all is in I would suggest to review again and see if it can be improved. Other than that LGTM

@vivekrnv
Copy link
Copy Markdown
Contributor Author

@vivekreddynv could you please update command reference guide with this addition and any other coming on this cli command?

I can do so, once this PR is merged, #1668 (This PR already updates the command reference guide with the existing commands). i'm pretty sure there'll be merge conflicts, if i add it here anyway. So, i'll rather wait until that PR gets merged.
Also, on a side note, should the command reference guide be updated for every module which is coming in?

It is a good question. I think the command reference should be general and not per each but once all is in I would suggest to review again and see if it can be improved. Other than that LGTM

Updated, Thank you

@vivekrnv
Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Copy Markdown
Contributor Author

vivekrnv commented Sep 7, 2021

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv vivekrnv closed this Sep 15, 2021
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.

3 participants