sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
706 stars 1.35k forks source link

[Yang] Port table for multi-asic device does not match yang definition #18417

Open ganglyu opened 4 months ago

ganglyu commented 4 months ago

Description

Port table for multi-asic device is: admin@vlab-08:~$ sudo sonic-cfggen -d -v PORT {'Ethernet1/1': {'admin_status': 'up', 'description': 'ASIC0:Eth0-ASIC0', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/2': {'admin_status': 'up', 'd escription': 'ASIC0:Eth1-ASIC0', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/3': {'admin_status': 'up', 'description': 'ASIC0:Eth2-ASIC0', 'mtu': ' 9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/4': {'admin_status': 'up', 'description': 'ASIC0:Eth3-ASIC0', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000 ', 'tpid': '0x8100'}, 'Ethernet1/5': {'admin_status': 'up', 'description': 'ASIC1:Eth0-ASIC1', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/6': {'ad min_status': 'up', 'description': 'ASIC1:Eth1-ASIC1', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/7': {'admin_status': 'up', 'description': 'ASIC1: Eth2-ASIC1', 'mtu': '9100', 'pfc_asym': 'off', 'speed': '40000', 'tpid': '0x8100'}, 'Ethernet1/8': {'admin_status': 'up', 'description': 'ASIC1:Eth3-ASIC1', 'mtu': '9100', 'pfc_asym': ' off', 'speed': '40000', 'tpid': '0x8100'}}

Above ports do not have lanes, but "lanes" is a mandatory field: https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-port.yang#L49

Steps to reproduce the issue:

  1. Create virtual testbed: kvm-four-asic-t1-lag
  2. check port table

Describe the results you received:

Yang validation failed.

Describe the results you expected:

Port table should have "lanes", or "lanes" should not be mandatory.

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

ganglyu commented 4 months ago

https://stackoverflow.com/questions/65582700/yang-model-mandatory-node-only-when-condition-is-true

ganglyu commented 3 months ago

@xincunli-sonic Can you provide ETA?

abdosi commented 3 months ago

@SuvarnaMeenakshi please help check this.