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

[debug dump util] Portchannel module added #1853

Merged
merged 8 commits into from
Nov 10, 2021

Conversation

vivekrnv
Copy link
Contributor

@vivekrnv vivekrnv commented Oct 2, 2021

What I did

  • Added the PortChannel and PortChannel_Member Modules to the Debug Dump Utility
  • Added the Corresponding UT's

Note: Portchannel member accepts the keys of PORTCHANNEL_MEMBER table as the Identifier and since the key contains this character ("|"), this should be escaped using single quotes while using the utility i.e.

dump state portchannel_member 'PortChannel001|Ethernet4,PortChannel001|Ethernet8'

How I did it

How to verify it

tests/dump_tests/module_tests/portchannel_member_test.py ...                                                                                                                                                       [ 93%]
tests/dump_tests/module_tests/portchannel_test.py ....                                                                                                                                                             [100%]

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)

root@sonic:~# dump state portchannel PortChannel001 --key-map --table
+--------------------+-----------+--------------------------------------------------------+
| portchannel_name   | DB_NAME   | DUMP                                                   |
+====================+===========+========================================================+
| PortChannel001     | CONFIG_DB | +----------------------------+                         |
|                    |           | | Keys Collected             |                         |
|                    |           | +============================+                         |
|                    |           | | PORTCHANNEL|PortChannel001 |                         |
|                    |           | +----------------------------+                         |
+--------------------+-----------+--------------------------------------------------------+
| PortChannel001     | APPL_DB   | +--------------------------+                           |
|                    |           | | Keys Collected           |                           |
|                    |           | +==========================+                           |
|                    |           | | LAG_TABLE:PortChannel001 |                           |
|                    |           | +--------------------------+                           |
+--------------------+-----------+--------------------------------------------------------+
| PortChannel001     | ASIC_DB   | +----------------------------------------------------+ |
|                    |           | | Keys Collected                                     | |
|                    |           | +====================================================+ |
|                    |           | | ASIC_STATE:SAI_OBJECT_TYPE_LAG:oid:0x2000000007b52 | |
|                    |           | +----------------------------------------------------+ |
|                    |           | +---------------------+------------------+             |
|                    |           | | vid                 | rid              |             |
|                    |           | +=====================+==================+             |
|                    |           | | oid:0x2000000007b52 | oid:0x8200000002 |             |
|                    |           | +---------------------+------------------+             |
+--------------------+-----------+--------------------------------------------------------+
| PortChannel001     | STATE_DB  | +--------------------------+                           |
|                    |           | | Keys Collected           |                           |
|                    |           | +==========================+                           |
|                    |           | | LAG_TABLE|PortChannel001 |                           |
|                    |           | +--------------------------+                           |
+--------------------+-----------+--------------------------------------------------------+

root@sonic:~# dump state portchannel_member 'PortChannel001|Ethernet4,PortChannel001|Ethernet8' --key-map
{
    "PortChannel001|Ethernet4": {
        "CONFIG_DB": {
            "keys": [
                "PORTCHANNEL_MEMBER|PortChannel001|Ethernet4"
            ],
            "tables_not_found": []
        },
        "APPL_DB": {
            "keys": [
                "LAG_MEMBER_TABLE:PortChannel001:Ethernet4"
            ],
            "tables_not_found": []
        },
        "ASIC_DB": {
            "keys": [
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER:oid:0x1b000000007b53"
            ],
            "tables_not_found": [],
            "vidtorid": {
                "oid:0x1b000000007b53": "oid:0x16a000002001b"
            }
        },
        "STATE_DB": {
            "keys": [
                "LAG_MEMBER_TABLE|PortChannel001|Ethernet4"
            ],
            "tables_not_found": []
        }
    },
    "PortChannel001|Ethernet8": {
        "CONFIG_DB": {
            "keys": [
                "PORTCHANNEL_MEMBER|PortChannel001|Ethernet8"
            ],
            "tables_not_found": []
        },
        "APPL_DB": {
            "keys": [
                "LAG_MEMBER_TABLE:PortChannel001:Ethernet8"
            ],
            "tables_not_found": []
        },
        "ASIC_DB": {
            "keys": [
                "ASIC_STATE:SAI_OBJECT_TYPE_LAG_MEMBER:oid:0x1b000000007b54"
            ],
            "tables_not_found": [],
            "vidtorid": {
                "oid:0x1b000000007b54": "oid:0x131000002001b"
            }
        },
        "STATE_DB": {
            "keys": [
                "LAG_MEMBER_TABLE|PortChannel001|Ethernet8"
            ],
            "tables_not_found": []
        }
    }
}

@lgtm-com
Copy link

lgtm-com bot commented Oct 2, 2021

This pull request introduces 1 alert when merging 179a092 into 5bdf270 - view on LGTM.com

new alerts:

  • 1 for Unused import

@dgsudharsan
Copy link
Collaborator

@SuvarnaMeenakshi Can you please review?

@liat-grozovik
Copy link
Collaborator

@SuvarnaMeenakshi could you please help review?

@vivekrnv
Copy link
Contributor Author

@SuvarnaMeenakshi, That should be possible, I'll raise a separate PR covering all the modules at once. That'll be a cleaner way. What do you think?

Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

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

lgtm

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.

4 participants