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

[show] Update show run all to cover all asic config in multiasic #3148

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

wen587
Copy link
Contributor

@wen587 wen587 commented Feb 2, 2024

ADO: 26574293

What I did

Update show runningconfiguration all to cover asics config

How I did it

Loop host and each asic to get config, then combine into one.

How to verify it

Unit test

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

admin@str3-7800-lc3-1:~$ show runningconfiguration all
{
    "ACL_TABLE": {
        ...
    },
    ...
}

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

admin@str3-7800-lc3-1:~$ show runningconfiguration all
{
    "localhost": {
        "ACL_TABLE": {
             ...
        },
        ...
    },
    "asic0": {
        "ACL_TABLE": {
            ...
        },
        ...
    },
    ...
}

show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
@qiluo-msft
Copy link
Contributor

qiluo-msft commented Feb 5, 2024

let's not using "masic" as terminology, please update PR title. #Closed

@wen587 wen587 changed the title [show] Update show run all to cover all asic config in masic [show] Update show run all to cover all asic config in multiasic Feb 7, 2024
@wen587 wen587 marked this pull request as ready for review February 18, 2024 03:51
@rlhui
Copy link
Contributor

rlhui commented Feb 20, 2024

What I did
Update show runningconfiguration all to cover asics config

How I did it
Loop host and each asic to get config, then combine into one.

@rlhui rlhui merged commit 1c094d3 into sonic-net:master Feb 20, 2024
5 checks passed
@gechiang
Copy link
Contributor

Manually cherry-picked to azure/sonic-utilities.msft/202205:
sonic-net/sonic-utilities.msft#45

@gechiang gechiang added the included in chassis for 202205 branch indicate that this PR got merged into the "chassis for 202205 branch" label Feb 23, 2024
@StormLiangMS
Copy link
Contributor

@wen587 could you run test with 202305 image and single asic devices?

@wen587
Copy link
Contributor Author

wen587 commented Feb 24, 2024

Hi @StormLiangMS , sure. It will not impact the single devices output.
Tested in single asic device of 202305 image below.

admin@bjw-can-7215-6:~$ show ver

SONiC Software Version: SONiC.20230531.18
SONiC OS Version: 11
Distribution: Debian 11.8
Kernel: 5.10.0-23-2-armmp
Build commit: 9b53f6dc0a
Build date: Thu Feb  8 03:51:40 UTC 2024
Built by: cloudtest@53fdd4e2c000000

Platform: armhf-nokia_ixs7215_52x-r0
HwSKU: Nokia-M0-7215
ASIC: marvell
ASIC Count: 1
Serial Number: NK223210818
Model Number: 3HE16794AARD01
Hardware Revision: 4
Uptime: 07:00:11 up 1 day, 12:22,  1 user,  load average: 5.03, 4.63, 4.62
Date: Sat 24 Feb 2024 07:00:11
...

admin@bjw-can-7215-6:~$ show run all
{
    "ACL_TABLE": {
        "DATAACL": {
            "policy_desc": "DATAACL",
            "ports": [
                "PortChannel106",
                "PortChannel101",
                "Ethernet47",
                "Ethernet46",
                "PortChannel105",
                "PortChannel103"
            ],
            "stage": "ingress",
            "type": "L3"
        },
...

@gechiang
Copy link
Contributor

gechiang commented Mar 7, 2024

@wen587 This change is breaking the tests when I picked it up for the chassis 202205 branch.
It is causing TPID Test failures:

2024-03-07T03:56:13.2964218Z tests/tpid_test.py::TestTpid::test_tpid_config_bad_tpid PASSED           [ 70%]
2024-03-07T03:56:13.2964410Z tests/tpid_test.py::TestTpid::test_tpid_config_lag_mbr PASSED            [ 70%]
2024-03-07T03:56:13.2964622Z tests/tpid_test.py::TestTpid::test_tpid_add_lag_mbr_with_non_default_tpid PASSED [ 70%]
2024-03-07T03:56:13.2964841Z tests/tpid_test.py::TestTpid::test_tpid_config_port_interface PASSED     [ 70%]
2024-03-07T03:56:13.2965047Z tests/tpid_test.py::TestTpid::test_tpid_config_portchannel_interface PASSED [ 71%]
2024-03-07T03:56:13.2965254Z tests/tpid_test.py::TestTpid::test_show_tpid FAILED                      [ 71%]
2024-03-07T03:56:13.2965437Z tests/tpid_test.py::TestTpid::test_show_tpid_ethernet0 FAILED            [ 71%]
...
2024-03-07T03:56:13.3148041Z 
2024-03-07T03:56:13.3148195Z =================================== FAILURES ===================================
2024-03-07T03:56:13.3148392Z ___________________________ TestTpid.test_show_tpid ____________________________
2024-03-07T03:56:13.3148490Z 
2024-03-07T03:56:13.3148615Z self = <tests.tpid_test.TestTpid object at 0x7f23b61a5e20>
2024-03-07T03:56:13.3148691Z 
2024-03-07T03:56:13.3148807Z     def test_show_tpid(self):
2024-03-07T03:56:13.3148933Z         runner = CliRunner()
2024-03-07T03:56:13.3149088Z         result = runner.invoke(show.cli.commands["interfaces"].commands["tpid"], [])
2024-03-07T03:56:13.3149252Z         print(result.exit_code)
2024-03-07T03:56:13.3149372Z         print(result.output)
2024-03-07T03:56:13.3149500Z         assert result.exit_code == 0
2024-03-07T03:56:13.3149642Z >       assert result.output == show_interface_tpid_output
2024-03-07T03:56:13.3151793Z E       AssertionError: assert ('      Interface           Alias    Oper    Admin    TPID\n'\n '---------------  --------------  ------  -------  ------\n'\n '      Ethernet0     Ethernet1/1      up       up     N/A\n'\n '      Ethernet4     Ethernet1/2      up       up     N/A\n'\n '     Ethernet64    Ethernet1/17      up       up     N/A\n'\n '   Ethernet-BP0    Ethernet-BP0      up       up     N/A\n'\n '   Ethernet-BP4    Ethernet-BP4      up       up     N/A\n'\n ' Ethernet-BP256  Ethernet-BP256      up       up     N/A\n'\n ' Ethernet-BP260  Ethernet-BP260      up       up     N/A\n'\n 'PortChannel1002             N/A      up       up  0x8100\n'\n 'PortChannel4001             N/A      up       up  0x8100\n'\n 'PortChannel4009             N/A      up       up  0x8100\n') == ('      Interface      Alias    Oper    Admin    TPID\n'\n '---------------  ---------  ------  -------  ------\n'\n '      Ethernet0  Ethernet0    down       up  0x9200\n'\n '     Ethernet16       etp5      up       up     N/A\n'\n '     Ethernet24       etp6      up       up  0x8100\n'\n '     Ethernet28       etp8      up       up     N/A\n'\n '     Ethernet32       etp9      up       up  0x8100\n'\n '     Ethernet36      etp10      up       up  0x8100\n'\n '    Ethernet112      etp29      up       up  0x8100\n'\n '    Ethernet116      etp30      up       up  0x8100\n'\n '    Ethernet120      etp31      up       up  0x8100\n'\n '    Ethernet124      etp32      up       up  0x8100\n'\n 'PortChannel0001        N/A    down       up  0x8100\n'\n 'PortChannel0002        N/A      up       up  0x8100\n'\n 'PortChannel0003        N/A      up       up  0x8100\n'\n 'PortChannel0004        N/A      up       up  0x8100\n'\n 'PortChannel1001        N/A     N/A      N/A  0x8100\n')
2024-03-07T03:56:13.3152819Z E         -       Interface      Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3152963Z E         +       Interface           Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3153097Z E         ?                      +++++
2024-03-07T03:56:13.3153376Z E         - ---------------  ---------  ------  -------  ------
2024-03-07T03:56:13.3153612Z E         + ---------------  --------------  ------  -------  ------
2024-03-07T03:56:13.3153758Z E         ?                           +++++
2024-03-07T03:56:13.3153957Z E         -       Ethernet0  Ethernet0    down       up  0x9200
2024-03-07T03:56:13.3154179Z E         -      Ethernet16       etp5      up       up     N/A
2024-03-07T03:56:13.3154383Z E         -      Ethernet24       etp6      up       up  0x8100
2024-03-07T03:56:13.3154596Z E         -      Ethernet28       etp8      up       up     N/A
2024-03-07T03:56:13.3154717Z E         ?              ^^^^^^^^^  ^^
2024-03-07T03:56:13.3154838Z E         +       Ethernet0     Ethernet1/1      up       up     N/A
2024-03-07T03:56:13.3154961Z E         ? +             ^^^^^^^^^^^^  ^^^
2024-03-07T03:56:13.3155081Z E         +       Ethernet4     Ethernet1/2      up       up     N/A
2024-03-07T03:56:13.3155282Z E         +      Ethernet64    Ethernet1/17      up       up     N/A
2024-03-07T03:56:13.3155510Z E         +    Ethernet-BP0    Ethernet-BP0      up       up     N/A
2024-03-07T03:56:13.3155726Z E         +    Ethernet-BP4    Ethernet-BP4      up       up     N/A
2024-03-07T03:56:13.3155956Z E         +  Ethernet-BP256  Ethernet-BP256      up       up     N/A
2024-03-07T03:56:13.3156178Z E         +  Ethernet-BP260  Ethernet-BP260      up       up     N/A
2024-03-07T03:56:13.3156405Z E         -      Ethernet32       etp9      up       up  0x8100
2024-03-07T03:56:13.3156611Z E         -      Ethernet36      etp10      up       up  0x8100
2024-03-07T03:56:13.3156836Z E         -     Ethernet112      etp29      up       up  0x8100
2024-03-07T03:56:13.3157052Z E         -     Ethernet116      etp30      up       up  0x8100
2024-03-07T03:56:13.3157261Z E         -     Ethernet120      etp31      up       up  0x8100
2024-03-07T03:56:13.3157477Z E         -     Ethernet124      etp32      up       up  0x8100
2024-03-07T03:56:13.3157692Z E         - PortChannel0001        N/A    down       up  0x8100
2024-03-07T03:56:13.3157910Z E         - PortChannel0002        N/A      up       up  0x8100
2024-03-07T03:56:13.3158037Z E         ?            ^
2024-03-07T03:56:13.3158156Z E         + PortChannel1002             N/A      up       up  0x8100
2024-03-07T03:56:13.3158288Z E         ?            ^           +++++
2024-03-07T03:56:13.3158481Z E         - PortChannel0003        N/A      up       up  0x8100
2024-03-07T03:56:13.3158604Z E         ?              ^^
2024-03-07T03:56:13.3158723Z E         + PortChannel4001             N/A      up       up  0x8100
2024-03-07T03:56:13.3158848Z E         ?            +  ^^^^^^
2024-03-07T03:56:13.3159050Z E         - PortChannel0004        N/A      up       up  0x8100
2024-03-07T03:56:13.3159165Z E         ?              ^^
2024-03-07T03:56:13.3159291Z E         + PortChannel4009             N/A      up       up  0x8100
2024-03-07T03:56:13.3159405Z E         ?            +  ^^^^^^
2024-03-07T03:56:13.3159609Z E         - PortChannel1001        N/A     N/A      N/A  0x8100
2024-03-07T03:56:13.3159670Z 
2024-03-07T03:56:13.3159798Z tests/tpid_test.py:179: AssertionError
2024-03-07T03:56:13.3160052Z ----------------------------- Captured stdout call -----------------------------
2024-03-07T03:56:13.3160206Z 0
2024-03-07T03:56:13.3160321Z       Interface           Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3160549Z ---------------  --------------  ------  -------  ------
2024-03-07T03:56:13.3160707Z       Ethernet0     Ethernet1/1      up       up     N/A
2024-03-07T03:56:13.3160842Z       Ethernet4     Ethernet1/2      up       up     N/A
2024-03-07T03:56:13.3160986Z      Ethernet64    Ethernet1/17      up       up     N/A
2024-03-07T03:56:13.3161189Z    Ethernet-BP0    Ethernet-BP0      up       up     N/A
2024-03-07T03:56:13.3161403Z    Ethernet-BP4    Ethernet-BP4      up       up     N/A
2024-03-07T03:56:13.3161611Z  Ethernet-BP256  Ethernet-BP256      up       up     N/A
2024-03-07T03:56:13.3161883Z  Ethernet-BP260  Ethernet-BP260      up       up     N/A
2024-03-07T03:56:13.3162030Z PortChannel1002             N/A      up       up  0x8100
2024-03-07T03:56:13.3162162Z PortChannel4001             N/A      up       up  0x8100
2024-03-07T03:56:13.3162300Z PortChannel4009             N/A      up       up  0x8100
2024-03-07T03:56:13.3162357Z 
2024-03-07T03:56:13.3162510Z ______________________ TestTpid.test_show_tpid_ethernet0 _______________________
2024-03-07T03:56:13.3162604Z 
2024-03-07T03:56:13.3162727Z self = <tests.tpid_test.TestTpid object at 0x7f23b61a5b50>
2024-03-07T03:56:13.3162811Z 
2024-03-07T03:56:13.3162921Z     def test_show_tpid_ethernet0(self):
2024-03-07T03:56:13.3163056Z         runner = CliRunner()
2024-03-07T03:56:13.3163215Z         result = runner.invoke(show.cli.commands["interfaces"].commands["tpid"], ["Ethernet0"])
2024-03-07T03:56:13.3163384Z         print(result.exit_code)
2024-03-07T03:56:13.3163503Z         print(result.output)
2024-03-07T03:56:13.3163681Z         assert result.exit_code == 0
2024-03-07T03:56:13.3163842Z >       assert result.output == show_interface_tpid_ethernet0_output
2024-03-07T03:56:13.3164422Z E       AssertionError: assert ('  Interface        Alias    Oper    Admin    TPID\n'\n '-----------  -----------  ------  -------  ------\n'\n '  Ethernet0  Ethernet1/1      up       up     N/A\n') == ('  Interface      Alias    Oper    Admin    TPID\n'\n '-----------  ---------  ------  -------  ------\n'\n '  Ethernet0  Ethernet0    down       up  0x9200\n')
2024-03-07T03:56:13.3164812Z E         -   Interface      Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3164962Z E         +   Interface        Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3165084Z E         ?                  ++
2024-03-07T03:56:13.3165289Z E         - -----------  ---------  ------  -------  ------
2024-03-07T03:56:13.3165510Z E         + -----------  -----------  ------  -------  ------
2024-03-07T03:56:13.3165647Z E         ?                       ++
2024-03-07T03:56:13.3165846Z E         -   Ethernet0  Ethernet0    down       up  0x9200
2024-03-07T03:56:13.3165996Z E         +   Ethernet0  Ethernet1/1      up       up     N/A
2024-03-07T03:56:13.3166056Z 
2024-03-07T03:56:13.3166182Z tests/tpid_test.py:187: AssertionError
2024-03-07T03:56:13.3166429Z ----------------------------- Captured stdout call -----------------------------
2024-03-07T03:56:13.3166579Z 0
2024-03-07T03:56:13.3166700Z   Interface        Alias    Oper    Admin    TPID
2024-03-07T03:56:13.3166906Z -----------  -----------  ------  -------  ------
2024-03-07T03:56:13.3167053Z   Ethernet0  Ethernet1/1      up       up     N/A
2024-03-07T03:56:13.3167115Z 
2024-03-07T03:56:13.3167334Z --------------------------- Captured stdout teardown ---------------------------
2024-03-07T03:56:13.3167492Z TEARDOWN
2024-03-07T03:56:13.3167652Z =============================== warnings summary ===============================
...
2024-03-07T03:56:13.3214511Z 
2024-03-07T03:56:13.3214661Z =========================== short test summary info ============================
2024-03-07T03:56:13.3214952Z FAILED tests/tpid_test.py::TestTpid::test_show_tpid - AssertionError: assert ...
2024-03-07T03:56:13.3215255Z FAILED tests/tpid_test.py::TestTpid::test_show_tpid_ethernet0 - AssertionErro...
2024-03-07T03:56:13.3215482Z ====== 2 failed, 2162 passed, 3 skipped, 9 warnings in 757.60s (0:12:37) =======
2024-03-07T03:56:13.3215783Z [  FAIL LOG END  ] [ target/python-wheels/bullseye/sonic_utilities-1.2-py3-none-any.whl ]
2024-03-07T03:56:13.3216109Z make: *** [slave.mk:776: target/python-wheels/bullseye/sonic_utilities-1.2-py3-none-any.whl] Error 1
2024-03-07T03:56:13.3216294Z make: *** Waiting for unfinished jobs....

Can you please address this failure?

@wen587
Copy link
Contributor Author

wen587 commented Mar 7, 2024

Hi @gechiang , the error seems not related to this PR. Could you share the build link?

@gechiang
Copy link
Contributor

gechiang commented Mar 7, 2024

Hi @gechiang , the error seems not related to this PR. Could you share the build link?

Shared offline... will always look at other possibilities in parallel in case this is not the root causing issue...

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 11, 2024
…ic-net#3148)

* [show] Update show run all to cover all asic config in masic

* per comment
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #3205

liushilongbuaa pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 13, 2024
…ic-net#3148)

* [show] Update show run all to cover all asic config in masic

* per comment
liushilongbuaa pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 13, 2024
…ic-net#3148)

* [show] Update show run all to cover all asic config in masic

* per comment
liushilongbuaa pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 15, 2024
…ic-net#3148)

* [show] Update show run all to cover all asic config in masic

* per comment
mssonicbld pushed a commit that referenced this pull request Mar 15, 2024
* [show] Update show run all to cover all asic config in masic

* per comment
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 21, 2024
…ic-net#3148)

* [show] Update show run all to cover all asic config in masic

* per comment
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3224

yxieca pushed a commit that referenced this pull request Mar 21, 2024
…) (#3224)

* [show] Update show run all to cover all asic config in masic

* per comment

Co-authored-by: jingwenxie <jingwenxie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants