-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anta): Added testcases to verifying Route Type (#925)
- Loading branch information
1 parent
f702c91
commit f440b30
Showing
6 changed files
with
206 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) 2023-2024 Arista Networks, Inc. | ||
# Use of this source code is governed by the Apache License 2.0 | ||
# that can be found in the LICENSE file. | ||
"""Module containing input models for generic routing tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Network | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
from anta.custom_types import IPv4RouteType | ||
|
||
|
||
class IPv4Routes(BaseModel): | ||
"""Model for a list of IPV4 route entries.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
prefix: IPv4Network | ||
"""The IPV4 network to validate the route type.""" | ||
vrf: str = "default" | ||
"""VRF context. Defaults to `default` VRF.""" | ||
route_type: IPv4RouteType | ||
"""List of IPV4 Route type to validate the valid rout type.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the IPv4RouteType for reporting.""" | ||
return f"Prefix: {self.prefix} VRF: {self.vrf}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters