Skip to content

Commit

Permalink
[yang]: Update DEVICE_METADATA yang models to support 'sub_role' (son…
Browse files Browse the repository at this point in the history
…ic-net#10161)

#### Why I did it
Fix sonic-net#9591
#### How I did it
Add 'sub_role' to device_metadata yang models.
#### How to verify it
Run UT for sonc-yang-models.
  • Loading branch information
wen587 authored Mar 10, 2022
1 parent a89f294 commit 861ea26
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@
"asic_name": "Asic0",
"switch_id": "2",
"switch_type": "voq",
"max_cores": "8"
"max_cores": "8",
"sub_role": "FrondEnd"
}
},
"VLAN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
},
"DEVICE_METADATA_CORRECT_VOQ_CONFIG": {
"desc": "Verifying VOQ configuration."
}
},
"DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": {
"desc": "Verifying valid sub_role configuration."
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ module sonic-device_metadata {
type string;
}

leaf sub_role {
type string;
description "sub_role indicates if ASIC is FrondEnd or BackEnd.";
}

leaf downstream_subrole {
type string;
}
Expand Down

0 comments on commit 861ea26

Please sign in to comment.