Skip to content

Commit

Permalink
Addressed review comment: updated doc, unit test eos data
Browse files Browse the repository at this point in the history
  • Loading branch information
vitthalmagadum committed Dec 19, 2024
1 parent 224b1e7 commit 9b7c946
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions anta/tests/routing/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ class VerifyBGPRouteOrigin(AntaTest):
"""Verifies BGP route origin.
This test performs the following checks for each specified bgp route entry:
1. Checks whether the specified BGP route entries exist.
1. Checks whether the specified BGP route entry exists.
2. Confirms that the path exists and corresponds to the next-hop address.
3. Verifies that the origin type of the BGP route matches the expected type.
Expand All @@ -1425,7 +1425,7 @@ class VerifyBGPRouteOrigin(AntaTest):
route_entries:
- prefix: 10.100.0.128/31
vrf: default
route_paths:
paths:
- nexthop: 10.100.0.10
origin: Igp
- nexthop: 10.100.4.5
Expand Down Expand Up @@ -1463,5 +1463,5 @@ def test(self) -> None:
self.result.is_failure(f"{route} {path} - path not found")
continue

if (actual_origin := route_path.get("routeDetail", {}).get("origin", "Not Found")) != origin:
if (actual_origin := route_path.get("routeType", {}).get("origin", "Not Found")) != origin:
self.result.is_failure(f"{route} {path} - Origin mismatch - Expected: {origin} Actual: {actual_origin}")
2 changes: 1 addition & 1 deletion examples/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ anta.tests.routing.bgp:
route_entries:
- prefix: 10.100.0.128/31
vrf: default
route_paths:
paths:
- nexthop: 10.100.0.10
origin: Igp
- nexthop: 10.100.4.5
Expand Down
20 changes: 10 additions & 10 deletions tests/units/anta_tests/routing/test_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4509,13 +4509,13 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.10",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
{
"nextHop": "10.100.4.5",
"routeDetail": {
"routeType": {
"origin": "Incomplete",
},
},
Expand All @@ -4529,13 +4529,13 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.8",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
{
"nextHop": "10.100.0.10",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
Expand Down Expand Up @@ -4574,13 +4574,13 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.10",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
{
"nextHop": "10.100.4.5",
"routeDetail": {
"routeType": {
"origin": "Incomplete",
},
},
Expand All @@ -4594,13 +4594,13 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.8",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
{
"nextHop": "10.100.0.10",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
Expand Down Expand Up @@ -4647,7 +4647,7 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.15",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
Expand All @@ -4661,7 +4661,7 @@ def test_check_bgp_neighbor_capability(input_dict: dict[str, bool], expected: bo
"bgpRoutePaths": [
{
"nextHop": "10.100.0.15",
"routeDetail": {
"routeType": {
"origin": "Igp",
},
},
Expand Down

0 comments on commit 9b7c946

Please sign in to comment.