sonic-net / sonic-buildimage

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

[yang-models] vlan validation issue #9570

Closed ganglyu closed 2 years ago

ganglyu commented 2 years ago

Description

'VLAN': {'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2'], 'mac': '00:aa:bb:cc:dd:ee', 'vlanid': '1000'}, 'Vlan2000': {'alias': 'ab2', 'dhcp_servers': ['192.0.0.1'], 'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4'], 'vlanid': '2000'}},

Config db schema generated by minigraph can’t pass yang validation:

It seems that we need to update yang model or sonic-config-engine.

Steps to reproduce the issue:

  1. Run command 'sonic-cfggen -m tests/simple-sample-graph-case.xml --print-data'.
  2. Use sonic_yang to validate config db schema.

Describe the results you received:

Yang validation failed.

Describe the results you expected:

Yang validation should pass.

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 2 years ago

@theasianpianist https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-config-engine/tests/simple-sample-graph-case.xml#L141 Why do you add 'mac' field? If it's necessary, could you please update sonic-vlan.yang?