Skip to content

Commit

Permalink
SONiC Yang model support for LLDP
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeep-kulambi committed May 3, 2021
1 parent 262b916 commit 654c6b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 41 deletions.
5 changes: 0 additions & 5 deletions src/sonic-yang-models/tests/yang_model_tests/tests/lldp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
"LLDP_GLOBAL_TEST": {
"desc": "LLDP test global LLDP table"
},
"LLDP_GLOBAL_TEST_INVALID_ID": {
"desc": "LLDP test global table with invalid id",
"eStrKey" : "InvalidValue",
"eStr": ["id"]
},
"LLDP_GLOBAL_TEST_INVALID_HELLO": {
"desc": "LLDP test global table with invalid hello value",
"eStrKey" : "InvalidValue",
Expand Down
35 changes: 10 additions & 25 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/lldp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"LLDP_GLOBAL_TEST": {
"sonic-lldp:sonic-lldp": {
"sonic-lldp:LLDP": {
"LLDP_LIST": [
{
"id": "GLOBAL",
"sonic-lldp:GLOBAL": {
"mode": "TRANSMIT",
"enabled": "true",
"hello_time": "20",
Expand All @@ -13,17 +11,14 @@
"supp_system_capabilities_tlv": "false",
"system_name": "sonic",
"system_description": "sonic-system"
}
]
}
}
}
},
"LLDP_GLOBAL_TEST_INVALID_ID": {
"sonic-lldp:sonic-lldp": {
"sonic-lldp:LLDP": {
"LLDP_LIST": [
{
"id": "GLOBALE",
"sonic-lldp:GLOBAL": {
"mode": "TRANSMIT",
"enabled": "true",
"hello_time": "10",
Expand All @@ -32,17 +27,14 @@
"supp_system_capabilities_tlv": "false",
"system_name": "sonic",
"system_description": "sonic-system"
}
]
}
}
}
},
"LLDP_GLOBAL_TEST_INVALID_HELLO": {
"sonic-lldp:sonic-lldp": {
"sonic-lldp:LLDP": {
"LLDP_LIST": [
{
"id": "GLOBAL",
"sonic-lldp:GLOBAL": {
"mode": "TRANSMIT",
"enabled": "true",
"hello_time": "test",
Expand All @@ -51,17 +43,14 @@
"supp_system_capabilities_tlv": "false",
"system_name": "sonic",
"system_description": "sonic-system"
}
]
}
}
}
},
"LLDP_GLOBAL_TEST_INVALID_MULTIPLIER": {
"sonic-lldp:sonic-lldp": {
"sonic-lldp:LLDP": {
"LLDP_LIST": [
{
"id": "GLOBAL",
"sonic-lldp:GLOBAL": {
"mode": "TRANSMIT",
"enabled": "true",
"hello_time": "10",
Expand All @@ -70,17 +59,14 @@
"supp_system_capabilities_tlv": "false",
"system_name": "sonic",
"system_description": "sonic-system"
}
]
}
}
}
},
"LLDP_GLOBAL_TEST_DEFAULT_SUPP_MGMT_ADDR_TLV": {
"sonic-lldp:sonic-lldp": {
"sonic-lldp:LLDP": {
"LLDP_LIST": [
{
"id": "GLOBAL",
"sonic-lldp:GLOBAL": {
"mode": "TRANSMIT",
"enabled": "true",
"hello_time": "10",
Expand All @@ -89,8 +75,7 @@
"supp_system_capabilities_tlv": "false",
"system_name": "sonic",
"system_description": "sonic-system"
}
]
}
}
}
},
Expand Down
12 changes: 1 addition & 11 deletions src/sonic-yang-models/yang-models/sonic-lldp.yang
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,7 @@ module sonic-lldp {

container sonic-lldp {
container LLDP {
list LLDP_LIST {
key "id";

leaf id {
type enumeration {
enum GLOBAL;
}
description
"It's value is always GLOBAL";
}

container GLOBAL {

leaf hello_time {
type uint8 {
Expand Down

0 comments on commit 654c6b0

Please sign in to comment.