Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix device type and add cluster in DEVICE_NEIGHBOR_METADATA yang model #17049

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/simple-sample-graph-case.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
<a:IPPrefix>10.7.0.196/26</a:IPPrefix>
</ManagementAddress>
<Hostname>switch2-t0</Hostname>
<ClusterName>DB5PrdApp11</ClusterName>
<HwSku>Force10-S6000</HwSku>
</Device>
<Device i:type="LeafRouter">
Expand All @@ -360,6 +361,7 @@
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
<a:IPPrefix>10.7.0.196/26</a:IPPrefix>
</ManagementAddress>
<ClusterName>DB5PrdApp11</ClusterName>
<HwSku>Force10-S6000</HwSku>
</Device>
<Device i:type="SmartCable">
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/test_minigraph_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def test_minigraph_neighbor_metadata(self):

expected_table = {
'switch2-t0': {
'cluster': 'DB5PrdApp11',
'lo_addr': '25.1.1.10/32',
'mgmt_addr': '10.7.0.196/26',
'hwsku': 'Force10-S6000',
Expand All @@ -228,6 +229,7 @@ def test_minigraph_neighbor_metadata(self):
'type': 'Server'
},
'switch-01t1': {
'cluster': 'DB5PrdApp11',
'lo_addr': '10.1.0.186/32',
'deployment_id': '2',
'hwsku': 'Force10-S6000',
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,14 @@ instance is supported in SONiC.
{
"DEVICE_NEIGHBOR_METADATA": {
"ARISTA01T1": {
"cluster": "AAA00PrdStr00",
"lo_addr": "None",
"mgmt_addr": "10.11.150.45",
"hwsku": "Arista-VM",
"type": "LeafRouter"
},
"ARISTA02T1": {
"cluster": "AAA00PrdStr00",
"lo_addr": "None",
"mgmt_addr": "10.11.150.46",
"hwsku": "Arista-VM",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@
"DEVICE_NEIGHBOR_METADATA_TABLE": {
"desc": "DEVICE_NEIGHBOR_METADATA_TABLE config pattern."
},
"DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN": {
"desc": "DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN pattern failure.",
"eStrKey" : "Pattern"
},
"DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN": {
"desc": "DEVICE_NEIGHBOR_METADATA correct value for Type field"
},
"DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN_BMC": {
"desc": "DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN pattern failure with IncorrectTypeBmc.",
"eStrKey" : "Pattern"
},
"DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN_BMC": {
"desc": "DEVICE_NEIGHBOR_METADATA correct value for type field for Bmc"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,4 @@
{
"DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN": {
"sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": {
"sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": {
"DEVICE_NEIGHBOR_METADATA_LIST": [
{
"name": "Ethernet116",
"hwsku": "Arista",
"type": "ToRrouter"
}
]
}
}
},
"DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN": {
"sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": {
"sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": {
"DEVICE_NEIGHBOR_METADATA_LIST": [
{
"name": "Ethernet116",
"hwsku": "Arista",
"type": "BackEndToRRouter"
}
]
}
}
},
"DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN_BMC": {
"sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": {
"sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": {
"DEVICE_NEIGHBOR_METADATA_LIST": [
{
"name": "Ethernet116",
"hwsku": "DUMMY_BMC_SKU",
"type": "IncorrectTypeBmc"
}
]
}
}
},
"DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN_BMC": {
"sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": {
"sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": {
Expand Down Expand Up @@ -69,6 +30,7 @@
"sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": {
"DEVICE_NEIGHBOR_METADATA_LIST": [
{
"cluster": "AAA00PrdStr00",
"lo_addr": "25.77.193.11/32",
"mgmt_addr": "0.0.0.0/0",
"name": "dccsw01.nw",
Expand All @@ -77,6 +39,7 @@
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"lo_addr": "0.0.0.0/0",
"mgmt_addr": "10.11.150.46/26",
"name": "dccsw02.nw",
Expand All @@ -85,6 +48,7 @@
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"lo_addr_v6": "2a04:5555:40:a709::2/126",
"mgmt_addr": "10.11.150.47/26",
"name": "dccsw03.nw",
Expand All @@ -93,33 +57,38 @@
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"name": "dccsw04.nw",
"mgmt_addr_v6": "2a04:5555:40:a708::2/126",
"hwsku": "Arista",
"type": "LeafRouter",
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"name": "dccsw05.nw",
"hwsku": "Arista",
"type": "LeafRouter",
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"lo_addr_v6": "2a04:5555:40:a710::2/126",
"name": "dccsw06.nw",
"hwsku": "Arista",
"type": "LeafRouter",
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"lo_addr": "25.77.193.11/32",
"name": "dccsw07.nw",
"hwsku": "Arista",
"type": "LeafRouter",
"deployment_id": "1"
},
{
"cluster": "AAA00PrdStr00",
"mgmt_addr": "10.11.150.48/26",
"name": "dccsw08.nw",
"hwsku": "Arista",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ module sonic-device_neighbor_metadata {
}
}

leaf cluster {
description "The switch is a member of this cluster";
type string;
}

leaf hwsku {
type stypes:hwsku;
}
Expand Down Expand Up @@ -82,9 +87,7 @@ module sonic-device_neighbor_metadata {

leaf type {
description "Network element type";
type string {
pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|Asic|Supervior|MgmtToRRouter|MgmtLeafRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|Server|Bmc|MiniPower|SmartCable|Ixia|EdgeZoneAggregator|not-provisioned";
}
type string;
}

leaf deployment_id {
Expand Down