Skip to content

Commit ec9f2e6

Browse files
committed
Fix: mac address change during oq watchdog test with soft_reset
<!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR Recently, a new QoS test case was added, which triggered an issue: https://migsonic.atlassian.net/browse/MIGSMSFT-1203 The root cause is that during the test case, the system MAC address is changed after a soft reset. The script that changes the MAC address was introduced in the following upstream PR: sonic-net/sonic-mgmt#8149 After debugging and discussion, it is confirmed that the script was added to fix a TD2-specific issue and is not applicable to Cisco devices. Following the discussions, we implemented a fix to skip the MAC address setting for Cisco platforms. Summary: Fixes # (issue) ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 ### Approach #### What is the motivation for this PR? #### How did you do it? #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
1 parent cfa260b commit ec9f2e6

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/saitests/py3/switch.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from ptf.thriftutils import * # noqa F403
2626
from switch_sai_thrift.ttypes import * # noqa F403
2727
from switch_sai_thrift.sai_headers import* # noqa F403
28+
import ptf.testutils as testutils
2829
from switch_sai_thrift.ttypes import sai_thrift_fdb_entry_t, sai_thrift_ip_t, sai_thrift_ip_address_t,\
2930
sai_thrift_ip_prefix_t, sai_thrift_object_list_t, sai_thrift_vlan_list_t, sai_thrift_acl_mask_t,\
3031
sai_thrift_acl_data_t, sai_thrift_acl_field_data_t, sai_thrift_attribute_value_t, sai_thrift_attribute_t,\
@@ -114,9 +115,13 @@ def _get_data_for_client(client, target):
114115

115116
# TOFIX in brcm sai: This causes the following error on td2 (a7050-qx-32s)
116117
# ERR syncd: brcm_sai_set_switch_attribute:842 updating switch mac addr failed with error -2.
117-
attr_value = sai_thrift_attribute_value_t(mac='00:77:66:55:44:33')
118-
attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_SRC_MAC_ADDRESS, value=attr_value)
119-
client.sai_thrift_set_switch_attribute(attr)
118+
test_params = testutils.test_params_get()
119+
asic_type = test_params['sonic_asic_type']
120+
print("switch_init asic_type= {}".format(asic_type))
121+
if asic_type not in ['cisco-8000']:
122+
attr_value = sai_thrift_attribute_value_t(mac='00:77:66:55:44:33')
123+
attr = sai_thrift_attribute_t(id=SAI_SWITCH_ATTR_SRC_MAC_ADDRESS, value=attr_value)
124+
client.sai_thrift_set_switch_attribute(attr)
120125

121126
# wait till the port are up
122127
time.sleep(10)

0 commit comments

Comments
 (0)