[yang]: Update DEVICE_METADATA yang models to support 'sub_role' (#10161)

#### Why I did it
Fix https://github.com/Azure/sonic-buildimage/issues/9591
#### How I did it
Add 'sub_role' to device_metadata yang models.
#### How to verify it
Run UT for sonc-yang-models.
This commit is contained in:
jingwenxie 2022-03-10 14:42:43 -08:00 committed by GitHub
parent a89f294fd5
commit 861ea26d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 2 deletions

View File

@ -302,7 +302,8 @@
"asic_name": "Asic0", "asic_name": "Asic0",
"switch_id": "2", "switch_id": "2",
"switch_type": "voq", "switch_type": "voq",
"max_cores": "8" "max_cores": "8",
"sub_role": "FrondEnd"
} }
}, },
"VLAN": { "VLAN": {

View File

@ -100,6 +100,9 @@
}, },
"DEVICE_METADATA_CORRECT_VOQ_CONFIG": { "DEVICE_METADATA_CORRECT_VOQ_CONFIG": {
"desc": "Verifying VOQ configuration." "desc": "Verifying VOQ configuration."
} },
"DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": {
"desc": "Verifying valid sub_role configuration."
}
} }

View File

@ -274,5 +274,14 @@
} }
} }
} }
},
"DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"sub_role": "FrontEnd"
}
}
}
} }
} }

View File

@ -127,6 +127,11 @@ module sonic-device_metadata {
type string; type string;
} }
leaf sub_role {
type string;
description "sub_role indicates if ASIC is FrondEnd or BackEnd.";
}
leaf downstream_subrole { leaf downstream_subrole {
type string; type string;
} }