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

FDB tests need to be modified in order to pass on setup with L2 configuration #3934

Closed
slutati1536 opened this issue Aug 3, 2021 · 3 comments · Fixed by #4093
Closed

FDB tests need to be modified in order to pass on setup with L2 configuration #3934

slutati1536 opened this issue Aug 3, 2021 · 3 comments · Fixed by #4093

Comments

@slutati1536
Copy link
Contributor

Description

on a setup with L2 configuration and Microsoft hwsku (BSL setup) FDB test are failing.
test_fdb.py failed because after configuring "sonic-clear fdb all" the fdb table should get clean but not all the entries get removed,
For a BSL DUT, all the ports are added into the same VLAN as L2 ports, but on a T0 topology, the ports ‘connected’ to VMs are all L3 LAG interfaces, MAC learning is disabled.

So the packets sent from the Arista VMs will continually trigger mac learning on a BSL DUT, but not for a normal T0 DUT.

This is the reason why you see FDB test behaved differently on BSL and normal T0 testbed.

So my conclusion is that, the “MAC address cannot be cleared issue” is an issue of test case or test flow. The test case was designed for T0 topology, to run it on a different BSL configuration, some change has to be made.

I can suggest two possible ways to make it compatible with BSL:

  1. Change the VM configuration before the test and restore it afterward.
    for the 4 relevant Arista VMs, I disabled the LLDP, BGP and port-channel on them, like below:

ARISTA03T1#config t

ARISTA03T1(config)#no router bgp

ARISTA03T1(config)#no lldp run

ARISTA03T1(config)#interface port-Channel 1

ARISTA03T1(config-if-Po1)#shutdown

ARISTA03T1(config-if-Po1)#exit

ARISTA03T1(config)#exit

And then run the FDB test, the test was passing.

  1. Change the test case to have more accurate mac address verification, only focus on the mac addresses generated by the test case itself, ignore the mac address triggered by other none relevant packets.

Steps to reproduce the issue:

  1. deploy t0 topo
  2. deploy L2 on the switch with Microsoft HWSKU: https://github.com/Azure/SONiC/wiki/L2-Switch-mode
  3. run the FDB tests fdb/test_fdb.py and receive the following results:
def test_fdb(ansible_adhoc, ptfadapter, duthosts, rand_one_dut_hostname, ptfhost, pkt_type, toggle_all_simulator_ports_to_rand_selected_tor): 



       # Perform FDB clean up before each test and at the end of the final test 

>       fdb_cleanup(duthosts, rand_one_dut_hostname) 



ansible_adhoc = <function init_host_mgr at 0x7feae428eed0> 

duthosts   = <tests.common.devices.duthosts.DutHosts object at 0x7feae3fd0a90> 

pkt_type   = 'arp_reply' 

ptfadapter = <tests.common.plugins.ptfadapter.ptfadapter.PtfTestAdapter testMethod=runTest> 

ptfhost    = <tests.common.devices.ptf.PTFHost object at 0x7feae199df50> 

rand_one_dut_hostname = 'arc-switch1004' 

toggle_all_simulator_ports_to_rand_selected_tor = None 



fdb/test_fdb.py:192: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 



duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7feae3fd0a90> 

rand_one_dut_hostname = 'arc-switch1004' 



   def fdb_cleanup(duthosts, rand_one_dut_hostname): 

       """ cleanup FDB before and after test run """ 

       duthost = duthosts[rand_one_dut_hostname] 

       if fdb_table_has_no_dynamic_macs(duthost): 

           return 

       else: 

           duthost.command('sonic-clear fdb all') 

>           pytest_assert(wait_until(20, 2, fdb_table_has_no_dynamic_macs, duthost), "FDB Table Cleanup failed") 

E           Failed: FDB Table Cleanup failed 

Describe the results you received:

Actual output: "show mac" output on DUT after running "sonic-clear fdb all":

[u' No. Vlan MacAddress Port Type',

u'----- ------ ----------------- ---------- -------',

u' 1 1000 52:54:00:5D:F3:56 Ethernet32 Dynamic',

u' 2 1000 52:54:00:73:1A:54 Ethernet8 Dynamic',

u' 3 1000 52:54:00:AF:D4:66 Ethernet36 Dynamic',

u' 4 1000 52:54:00:D2:4D:FD Ethernet10 Dynamic',

u' 5 1000 52:54:00:31:68:E3 Ethernet4 Dynamic',

u' 6 1000 52:54:00:1E:A7:F8 Ethernet24 Dynamic',

u' 7 1000 52:54:00:F9:8A:7F Ethernet16 Dynamic',

u' 8 1000 52:54:00:9D:26:DE Ethernet6 Dynamic',

u' 9 1000 52:54:00:E6:79:96 Ethernet20 Dynamic',

u' 10 1000 52:54:00:0E:FB:60 Ethernet22 Dynamic',

u' 11 1000 52:54:00:3F:6D:48 Ethernet28 Dynamic',

u'Total number of entries 11']

Describe the results you expected:
Expected output: "show mac" output on DUT after running "sonic-clear fdb all" :

[u'No. Vlan MacAddress Port Type',

u'----- ------ ------------ ------ ------',

u'Total number of entries 0']

Additional information you deem important:

**Output of `show version`:**

SONiC-OS-202012.131-01efb5454_Internal

**Attach debug file `sudo generate_dump`:**

sonic_dump_arc-switch1025_20210721_124251.tar.gz

@roy-sror
Copy link
Contributor

@qiluo-msft - can you please help in assigning this issue, it is blocking the BSL automation.

@qiluo-msft
Copy link
Contributor

qiluo-msft commented Aug 20, 2021

Suggestion 1 seems reasonable. In general concept, we don't need Arsita VM as BGP neighbors in BSL test cases. So I think we need another topo instead of using topo_t0.

@bingwang-ms
Copy link
Collaborator

I workaround the failure by PR #4093 . The MAC populated by VMs are ignored when checking if fdb table is cleared. Please help to review. Thanks

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 a pull request may close this issue.

4 participants