-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
395 additions
and
310 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright (c) 2023-2025 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 flow tracking tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
|
||
class FlowTracker(BaseModel): | ||
"""Flow Tracking model representing the tracker details.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
name: str | ||
"""The name of the flow tracker.""" | ||
record_export: RecordExport | None = None | ||
"""Configuration for record export, specifying details about timeouts.""" | ||
exporters: list[Exporter] | None = None | ||
"""A list of exporters associated with the flow tracker.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the FlowTracker for reporting. | ||
Examples | ||
-------- | ||
Flow Tracker: FLOW-TRACKER | ||
""" | ||
return f"Flow Tracker: {self.name}" | ||
|
||
|
||
class RecordExport(BaseModel): | ||
"""Model representing the record export configuration for a flow tracker.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
on_inactive_timeout: int | ||
"""The timeout in milliseconds for exporting flow records when the flow becomes inactive.""" | ||
on_interval: int | ||
"""The interval in milliseconds for exporting flow records.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the RecordExport for reporting. | ||
Examples | ||
-------- | ||
Inactive Timeout: 60000, Active Interval: 300000 | ||
""" | ||
return f"Inactive Timeout: {self.on_inactive_timeout}, Active Interval: {self.on_interval}" | ||
|
||
|
||
class Exporter(BaseModel): | ||
"""Model representing the exporter used for flow record export.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
name: str | ||
"""The name of the exporter.""" | ||
local_interface: str | ||
"""The local interface used by the exporter to send flow records.""" | ||
template_interval: int | ||
"""The template interval, in milliseconds, for the exporter to refresh the flow template.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the Exporter for reporting. | ||
Examples | ||
-------- | ||
Exporter: CVP-TELEMETRY | ||
""" | ||
return f"Exporter: {self.name}" |
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-2025 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 path-selection tests.""" | ||
|
||
from __future__ import annotations | ||
|
||
from ipaddress import IPv4Address | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
|
||
class DpsPath(BaseModel): | ||
"""Model for a list of DPS path entries.""" | ||
|
||
model_config = ConfigDict(extra="forbid") | ||
peer: IPv4Address | ||
"""Static peer IPv4 address.""" | ||
path_group: str | ||
"""Router path group name.""" | ||
source_address: IPv4Address | ||
"""Source IPv4 address of path.""" | ||
destination_address: IPv4Address | ||
"""Destination IPv4 address of path.""" | ||
|
||
def __str__(self) -> str: | ||
"""Return a human-readable string representation of the DpsPath for reporting.""" | ||
return f"Peer: {self.peer}, PathGroup: {self.path_group}, Source: {self.source_address}, Destination: {self.destination_address}" |
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.