Skip to content

Commit

Permalink
Skip the lanes for host config DB for multi asic VS (sonic-net#20727)
Browse files Browse the repository at this point in the history
How I did it
Skip the lanes for host config DB for multi asic VS and add UT

How to verify it
UT and compile yang_mgmt and yang_model wheel package
  • Loading branch information
arlakshm authored Nov 8, 2024
1 parent 3fa9890 commit 2964b71
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
},
"PORT_VOQ_CHASSIS_WITH_LANES": {
"desc": "PORT_VOQ_CHASSIS_WITH_LANES no failure."
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS": {
"desc": "PORT_WITH_NO_LANES_ON_MULT_ASIC_VS no failure."
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2": {
"desc": "PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2 no failure."
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -952,5 +952,72 @@
]
}
}
},
"PORT_FABRIC_WITH_NO_LANES": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"switch_type": "fabric"
}
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"alias": "etp1a",
"speed": 100000,
"role": "Int"

}
]
}
}
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"hwsku": "msft_multi_asic_vs"
}
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"alias": "etp1a",
"speed": 100000,
"role": "Int"

}
]
}
}
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"hwsku": "msft_four_asic_vs"
}
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"alias": "etp1a",
"speed": 100000,
"role": "Int"

}
]
}
}
}

}
4 changes: 3 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ module sonic-port{
when "not(not(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:asic_name) and
((/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='voq') or
(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='chassis-packet') or
(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='fabric')))";
(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='fabric') or
(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:hwsku='msft_four_asic_vs') or
(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:hwsku='msft_multi_asic_vs')))";

description "Number of hardware lanes for the port. This is mandatory for all devices except for chassis devices";
mandatory true;
Expand Down

0 comments on commit 2964b71

Please sign in to comment.