sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
201 stars 727 forks source link

Cisco qos_param_generator failure for 8111 #10283

Closed XuChen-MSFT closed 1 year ago

XuChen-MSFT commented 1 year ago

Description

8111 all qos sai test failed , as below

fixture_generator = <function dutQosConfig at 0x7f8a4efd9050>
args = (<tests.qos.test_qos_sai.TestQosSai instance at 0x7f8a4e98ba50>, [<MultiAsicSonicHost str2-8111-06>], {'all_asics': [<...00000001', 'bufferPoolVoid': 'oid:0x180000000004c4', u'dynamic_th': u'7', u'pool': u'ingress_lossless_pool', ...}, ...)
kargs = {}, it = <generator object dutQosConfig at 0x7f8a238fbeb0>
detail = AttributeError("'QosParamCisco' object has no attribute 'pause_thr'",)
@decorator.decorator
def _fixture_generator_decorator(fixture_generator, *args, **kargs):
# setup, to the first yield in fixture
logging.info("-" * 20 + (" fixture %s setup starts " % fixture_generator.__name__) + "-" * 20)
it = fixture_generator(*args, **kargs)
try:
>           res = next(it)
args       = (<tests.qos.test_qos_sai.TestQosSai instance at 0x7f8a4e98ba50>, [<MultiAsicSonicHost str2-8111-06>], {'all_asics': [<...00000001', 'bufferPoolVoid': 'oid:0x180000000004c4', u'dynamic_th': u'7', u'pool': u'ingress_lossless_pool', ...}, ...)
detail     = AttributeError("'QosParamCisco' object has no attribute 'pause_thr'",)
fixture_generator = <function dutQosConfig at 0x7f8a4efd9050>
it         = <generator object dutQosConfig at 0x7f8a238fbeb0>
kargs      = {}
[common/plugins/log_section_start/__init__.py:84:](https://dev.azure.com/mssonic/internal/_git/5380e8f7-6e2a-4154-8dee-f3be7b096894?path=common%2Fplugins%2Flog_section_start%2F__init__.py&version=GBxuchen3%2Finternal-202205%2F8111-qos&_a=contents&line=84&lineEnd=85&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[qos/qos_sai_base.py:1386: in dutQosConfig](https://dev.azure.com/mssonic/internal/_git/5380e8f7-6e2a-4154-8dee-f3be7b096894?path=qos%2Fqos_sai_base.py&version=GBxuchen3%2Finternal-202205%2F8111-qos&_a=contents&line=1386&lineEnd=1387&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
qosParams = qpm.run()
[qos/files/cisco/qos_param_generator.py:73: in run](https://dev.azure.com/mssonic/internal/_git/5380e8f7-6e2a-4154-8dee-f3be7b096894?path=qos%2Ffiles%2Fcisco%2Fqos_param_generator.py&version=GBxuchen3%2Finternal-202205%2F8111-qos&_a=contents&line=73&lineEnd=74&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)
self.__define_lossless_voq()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <qos_param_generator.QosParamCisco object at 0x7f8a2184c0d0>
def __define_lossless_voq(self):
packet_size = 1350
packet_buffs = self.get_buffer_occupancy(packet_size)
common_params = {"ecn": 1,
"pkts_num_margin": 4,
"packet_size": packet_size,
>                        "pkts_num_trig_pfc": self.pause_thr // self.buffer_size // packet_buffs}
E       AttributeError: 'QosParamCisco' object has no attribute 'pause_thr'
packet_buffs = 4
packet_size = 1350
self       = <qos_param_generator.QosParamCisco object at 0x7f8a2184c0d0>
[qos/files/cisco/qos_param_generator.py:298: AttributeError](https://dev.azure.com/mssonic/internal/_git/5380e8f7-6e2a-4154-8dee-f3be7b096894?path=qos%2Ffiles%2Fcisco%2Fqos_param_generator.py&version=GBxuchen3%2Finternal-202205%2F8111-qos&_a=contents&line=298&lineEnd=299&lineStartColumn=1&lineEndColumn=1&lineStyle=plain)

RCA: issue was introduced in PR #9420 https://github.com/sonic-net/sonic-mgmt/blob/8f043a1ee8a7cbf6e4fbe7b863c5801ac84f76ed/tests/qos/files/cisco/qos_param_generator.py#L34C1-L49C84

"self.pause_thr" is initialized only for "gb" platform, so for non-gb platform, it isn't initialized , and will encounter this issue.

Steps to reproduce the issue:

  1. run qos sai test for cisco 8111

Describe the results you received:

Describe the results you expected:

Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

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

```
(paste your output here)
```
XuChen-MSFT commented 1 year ago

resolved in PR #10248 close