-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mcsClientMounts
- Loading branch information
Showing
79 changed files
with
936 additions
and
743 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 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. | ||
"""Package related to all ANTA tests input models.""" |
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,41 @@ | ||
# 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 connectivity tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Address | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
from anta.custom_types import Interface | ||
|
||
|
||
class Host(BaseModel): | ||
"""Model for a remote host to ping.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
destination: IPv4Address | ||
"""IPv4 address to ping.""" | ||
source: IPv4Address | Interface | ||
"""IPv4 address source IP or egress interface to use.""" | ||
vrf: str = "default" | ||
"""VRF context. Defaults to `default`.""" | ||
repeat: int = 2 | ||
"""Number of ping repetition. Defaults to 2.""" | ||
size: int = 100 | ||
"""Specify datagram size. Defaults to 100.""" | ||
df_bit: bool = False | ||
"""Enable do not fragment bit in IP header. Defaults to False.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the Host for reporting. | ||
Examples | ||
-------- | ||
Host 10.1.1.1 (src: 10.2.2.2, vrf: mgmt, size: 100B, repeat: 2) | ||
""" | ||
df_status = ", df-bit: enabled" if self.df_bit else "" | ||
return f"Host {self.destination} (src: {self.source}, vrf: {self.vrf}, size: {self.size}B, repeat: {self.repeat}{df_status})" |
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,23 @@ | ||
# 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 interface tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Literal | ||
|
||
from pydantic import BaseModel | ||
|
||
from anta.custom_types import Interface | ||
|
||
|
||
class InterfaceState(BaseModel): | ||
"""Model for an interface state.""" | ||
|
||
name: Interface | ||
"""Interface to validate.""" | ||
status: Literal["up", "down", "adminDown"] | ||
"""Expected status of the interface.""" | ||
line_protocol_status: Literal["up", "down", "testing", "unknown", "dormant", "notPresent", "lowerLayerDown"] | None = None | ||
"""Expected line protocol status of the interface.""" |
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,31 @@ | ||
# 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 system tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Address | ||
|
||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
from anta.custom_types import Hostname | ||
|
||
|
||
class NTPServer(BaseModel): | ||
"""Model for a NTP server.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
server_address: Hostname | IPv4Address | ||
"""The NTP server address as an IPv4 address or hostname. The NTP server name defined in the running configuration | ||
of the device may change during DNS resolution, which is not handled in ANTA. Please provide the DNS-resolved server name. | ||
For example, 'ntp.example.com' in the configuration might resolve to 'ntp3.example.com' in the device output.""" | ||
preferred: bool = False | ||
"""Optional preferred for NTP server. If not provided, it defaults to `False`.""" | ||
stratum: int = Field(ge=0, le=16) | ||
"""NTP stratum level (0 to 15) where 0 is the reference clock and 16 indicates unsynchronized. | ||
Values should be between 0 and 15 for valid synchronization and 16 represents an out-of-sync state.""" | ||
|
||
def __str__(self) -> str: | ||
"""Representation of the NTPServer model.""" | ||
return f"{self.server_address} (Preferred: {self.preferred}, Stratum: {self.stratum})" |
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
Oops, something went wrong.