diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 106115133574..2ed16e6a3eb9 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1087,7 +1087,8 @@ "local_addr": "10.0.0.2", "name":"PEER1", "nhopself":"0", - "rrclient":"0" + "rrclient":"0", + "admin_status":"up" }, "default|192.168.1.1": { "local_asn": "65200", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json index 596a3343e53d..16863ae253c2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json @@ -24,6 +24,11 @@ "desc": "Referring non-existing BGP neighbor table.", "eStrKey" : "LeafRef" }, + "BGP_NEIGHBOR_NEG_INVALID_ADMIN_STATUS": { + "desc": "Incorrect admin status.", + "eStrKey": "InvalidValue", + "eStr": ["admin_status"] + }, "BGP_NEIGHBOR_NEG_INVALID_NAME": { "desc": "Incorrect neighbor name.", "eStrKey": "InvalidValue", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json index d537c97c9c53..30b8d76b345d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json @@ -133,6 +133,19 @@ }, "sonic-bgp-neighbor:sonic-bgp-neighbor": { "sonic-bgp-neighbor:BGP_NEIGHBOR": { + "BGP_NEIGHBOR_TEMPLATE_LIST": [ + { + "neighbor": "10.0.0.1", + "asn": "65200", + "holdtime": "180", + "keepalive": "60", + "local_addr": "10.0.0.2", + "name":"PEER1", + "nhopself":"0", + "rrclient":"0", + "admin_status":"up" + } + ], "BGP_NEIGHBOR_LIST": [ { "vrf_name": "default", @@ -434,6 +447,29 @@ } }, + "BGP_NEIGHBOR_NEG_INVALID_ADMIN_STATUS": { + "sonic-bgp-global:sonic-bgp-global": { + "sonic-bgp-global:BGP_GLOBALS": { + "BGP_GLOBALS_LIST": [ + { + "vrf_name": "default", + "local_asn": 65001 + } + ] + } + }, + "sonic-bgp-neighbor:sonic-bgp-neighbor": { + "sonic-bgp-neighbor:BGP_NEIGHBOR": { + "BGP_NEIGHBOR_TEMPLATE_LIST": [ + { + "neighbor": "11.12.13.14", + "admin_status": "right" + } + ] + } + } + }, + "BGP_NEIGHBOR_NEG_INVALID_NAME": { "sonic-bgp-global:sonic-bgp-global": { "sonic-bgp-global:BGP_GLOBALS": { diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang index 8e0e3f4cc803..d103cb92e58a 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang @@ -7,6 +7,10 @@ module sonic-bgp-neighbor { prefix inet; } + import sonic-types { + prefix stypes; + } + import sonic-bgp-common { prefix bgpcmn; } @@ -97,6 +101,11 @@ module sonic-bgp-neighbor { } description "Route reflector client"; } + + leaf admin_status { + type stypes:admin_status; + description "Admin status of BGP peer"; + } } list BGP_NEIGHBOR_LIST {