Skip to content

Commit

Permalink
Refactor: Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Sep 30, 2024
1 parent c599d83 commit 79016f7
Show file tree
Hide file tree
Showing 32 changed files with 34 additions and 413 deletions.
10 changes: 0 additions & 10 deletions anta/tests/aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ class VerifyTacacsServerGroups(AntaTest):
```
"""

name = "VerifyTacacsServerGroups"
description = "Verifies if the provided TACACS server group(s) are configured."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs", revision=1)]

Expand Down Expand Up @@ -180,8 +178,6 @@ class VerifyAuthenMethods(AntaTest):
```
"""

name = "VerifyAuthenMethods"
description = "Verifies the AAA authentication method lists for different authentication types (login, enable, dot1x)."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods authentication", revision=1)]

Expand Down Expand Up @@ -241,8 +237,6 @@ class VerifyAuthzMethods(AntaTest):
```
"""

name = "VerifyAuthzMethods"
description = "Verifies the AAA authorization method lists for different authorization types (commands, exec)."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods authorization", revision=1)]

Expand Down Expand Up @@ -297,8 +291,6 @@ class VerifyAcctDefaultMethods(AntaTest):
```
"""

name = "VerifyAcctDefaultMethods"
description = "Verifies the AAA accounting default method lists for different accounting types (system, exec, commands, dot1x)."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods accounting", revision=1)]

Expand Down Expand Up @@ -360,8 +352,6 @@ class VerifyAcctConsoleMethods(AntaTest):
```
"""

name = "VerifyAcctConsoleMethods"
description = "Verifies the AAA accounting console method lists for different accounting types (system, exec, commands, dot1x)."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods accounting", revision=1)]

Expand Down
15 changes: 3 additions & 12 deletions anta/tests/avt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@


class VerifyAVTPathHealth(AntaTest):
"""
Verifies the status of all Adaptive Virtual Topology (AVT) paths for all VRFs.
"""Verifies the status of all Adaptive Virtual Topology (AVT) paths for all VRFs.
Expected Results
----------------
Expand All @@ -34,8 +33,6 @@ class VerifyAVTPathHealth(AntaTest):
```
"""

name = "VerifyAVTPathHealth"
description = "Verifies the status of all AVT paths for all VRFs."
categories: ClassVar[list[str]] = ["avt"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show adaptive-virtual-topology path")]

Expand Down Expand Up @@ -73,8 +70,7 @@ def test(self) -> None:


class VerifyAVTSpecificPath(AntaTest):
"""
Verifies the status and type of an Adaptive Virtual Topology (AVT) path for a specified VRF.
"""Verifies the status and type of an Adaptive Virtual Topology (AVT) path for a specified VRF.
Expected Results
----------------
Expand All @@ -97,8 +93,6 @@ class VerifyAVTSpecificPath(AntaTest):
```
"""

name = "VerifyAVTSpecificPath"
description = "Verifies the status and type of an AVT path for a specified VRF."
categories: ClassVar[list[str]] = ["avt"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [
AntaTemplate(template="show adaptive-virtual-topology path vrf {vrf} avt {avt_name} destination {destination}")
Expand Down Expand Up @@ -191,8 +185,7 @@ def test(self) -> None:


class VerifyAVTRole(AntaTest):
"""
Verifies the Adaptive Virtual Topology (AVT) role of a device.
"""Verifies the Adaptive Virtual Topology (AVT) role of a device.
Expected Results
----------------
Expand All @@ -208,8 +201,6 @@ class VerifyAVTRole(AntaTest):
```
"""

name = "VerifyAVTRole"
description = "Verifies the AVT role of a device."
categories: ClassVar[list[str]] = ["avt"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show adaptive-virtual-topology path")]

Expand Down
8 changes: 0 additions & 8 deletions anta/tests/bfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class VerifyBFDSpecificPeers(AntaTest):
```
"""

name = "VerifyBFDSpecificPeers"
description = "Verifies the IPv4 BFD peer's sessions and remote disc in the specified VRF."
categories: ClassVar[list[str]] = ["bfd"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bfd peers", revision=1)]

Expand Down Expand Up @@ -123,8 +121,6 @@ class VerifyBFDPeersIntervals(AntaTest):
```
"""

name = "VerifyBFDPeersIntervals"
description = "Verifies the timers of the IPv4 BFD peers in the specified VRF."
categories: ClassVar[list[str]] = ["bfd"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bfd peers detail", revision=1)]

Expand Down Expand Up @@ -218,8 +214,6 @@ class VerifyBFDPeersHealth(AntaTest):
```
"""

name = "VerifyBFDPeersHealth"
description = "Verifies the health of all IPv4 BFD peers."
categories: ClassVar[list[str]] = ["bfd"]
# revision 1 as later revision introduces additional nesting for type
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [
Expand Down Expand Up @@ -308,8 +302,6 @@ class VerifyBFDPeersRegProtocols(AntaTest):
```
"""

name = "VerifyBFDPeersRegProtocols"
description = "Verifies that IPv4 BFD peer(s) have the specified protocol(s) registered."
categories: ClassVar[list[str]] = ["bfd"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bfd peers detail", revision=1)]

Expand Down
6 changes: 0 additions & 6 deletions anta/tests/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class VerifyZeroTouch(AntaTest):
```
"""

name = "VerifyZeroTouch"
description = "Verifies ZeroTouch is disabled"
categories: ClassVar[list[str]] = ["configuration"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show zerotouch", revision=1)]

Expand Down Expand Up @@ -64,8 +62,6 @@ class VerifyRunningConfigDiffs(AntaTest):
```
"""

name = "VerifyRunningConfigDiffs"
description = "Verifies there is no difference between the running-config and the startup-config"
categories: ClassVar[list[str]] = ["configuration"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show running-config diffs", ofmt="text")]

Expand Down Expand Up @@ -104,8 +100,6 @@ class VerifyRunningConfigLines(AntaTest):
```
"""

name = "VerifyRunningConfigLines"
description = "Search the Running-Config for the given RegEx patterns."
categories: ClassVar[list[str]] = ["configuration"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show running-config", ofmt="text")]

Expand Down
4 changes: 0 additions & 4 deletions anta/tests/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class VerifyReachability(AntaTest):
```
"""

name = "VerifyReachability"
description = "Test the network reachability to one or many destination IP(s)."
categories: ClassVar[list[str]] = ["connectivity"]
# Removing the <space> between '{size}' and '{df_bit}' to compensate the df-bit set default value
# i.e if df-bit kept disable then it will add redundant space in between the command
Expand Down Expand Up @@ -129,8 +127,6 @@ class VerifyLLDPNeighbors(AntaTest):
```
"""

name = "VerifyLLDPNeighbors"
description = "Verifies that the provided LLDP neighbors are connected properly."
categories: ClassVar[list[str]] = ["connectivity"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show lldp neighbors detail", revision=1)]

Expand Down
4 changes: 0 additions & 4 deletions anta/tests/field_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class VerifyFieldNotice44Resolution(AntaTest):
```
"""

name = "VerifyFieldNotice44Resolution"
description = "Verifies that the device is using the correct Aboot version per FN0044."
categories: ClassVar[list[str]] = ["field notices"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show version detail", revision=1)]

Expand Down Expand Up @@ -143,8 +141,6 @@ class VerifyFieldNotice72Resolution(AntaTest):
```
"""

name = "VerifyFieldNotice72Resolution"
description = "Verifies if the device is exposed to FN0072, and if the issue has been mitigated."
categories: ClassVar[list[str]] = ["field notices"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show version detail", revision=1)]

Expand Down
13 changes: 3 additions & 10 deletions anta/tests/flow_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@


def validate_record_export(record_export: dict[str, str], tracker_info: dict[str, str]) -> str:
"""
Validate the record export configuration against the tracker info.
"""Validate the record export configuration against the tracker info.
Parameters
----------
Expand All @@ -40,8 +39,7 @@ def validate_record_export(record_export: dict[str, str], tracker_info: dict[str


def validate_exporters(exporters: list[dict[str, str]], tracker_info: dict[str, str]) -> str:
"""
Validate the exporter configurations against the tracker info.
"""Validate the exporter configurations against the tracker info.
Parameters
----------
Expand Down Expand Up @@ -73,8 +71,7 @@ def validate_exporters(exporters: list[dict[str, str]], tracker_info: dict[str,


class VerifyHardwareFlowTrackerStatus(AntaTest):
"""
Verifies if hardware flow tracking is running and an input tracker is active.
"""Verifies if hardware flow tracking is running and an input tracker is active.
This test optionally verifies the tracker interval/timeout and exporter configuration.
Expand All @@ -101,10 +98,6 @@ class VerifyHardwareFlowTrackerStatus(AntaTest):
```
"""

name = "VerifyHardwareFlowTrackerStatus"
description = (
"Verifies if hardware flow tracking is running and an input tracker is active. Optionally verifies the tracker interval/timeout and exporter configuration."
)
categories: ClassVar[list[str]] = ["flow tracking"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaTemplate(template="show flow tracking hardware tracker {name}", revision=1)]

Expand Down
4 changes: 0 additions & 4 deletions anta/tests/greent.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class VerifyGreenTCounters(AntaTest):
```
"""

name = "VerifyGreenTCounters"
description = "Verifies if the GreenT counters are incremented."
categories: ClassVar[list[str]] = ["greent"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show monitor telemetry postcard counters", revision=1)]

Expand Down Expand Up @@ -61,8 +59,6 @@ class VerifyGreenT(AntaTest):
```
"""

name = "VerifyGreenT"
description = "Verifies if a GreenT policy is created."
categories: ClassVar[list[str]] = ["greent"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show monitor telemetry postcard policy profile", revision=1)]

Expand Down
14 changes: 0 additions & 14 deletions anta/tests/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class VerifyTransceiversManufacturers(AntaTest):
```
"""

name = "VerifyTransceiversManufacturers"
description = "Verifies if all transceivers come from approved manufacturers."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show inventory", revision=2)]

Expand Down Expand Up @@ -77,8 +75,6 @@ class VerifyTemperature(AntaTest):
```
"""

name = "VerifyTemperature"
description = "Verifies the device temperature."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment temperature", revision=1)]

Expand Down Expand Up @@ -110,8 +106,6 @@ class VerifyTransceiversTemperature(AntaTest):
```
"""

name = "VerifyTransceiversTemperature"
description = "Verifies the transceivers temperature."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment temperature transceiver", revision=1)]

Expand Down Expand Up @@ -151,8 +145,6 @@ class VerifyEnvironmentSystemCooling(AntaTest):
```
"""

name = "VerifyEnvironmentSystemCooling"
description = "Verifies the system cooling status."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment cooling", revision=1)]

Expand Down Expand Up @@ -185,8 +177,6 @@ class VerifyEnvironmentCooling(AntaTest):
```
"""

name = "VerifyEnvironmentCooling"
description = "Verifies the status of power supply fans and all fan trays."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment cooling", revision=1)]

Expand Down Expand Up @@ -232,8 +222,6 @@ class VerifyEnvironmentPower(AntaTest):
```
"""

name = "VerifyEnvironmentPower"
description = "Verifies the power supplies status."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment power", revision=1)]

Expand Down Expand Up @@ -274,8 +262,6 @@ class VerifyAdverseDrops(AntaTest):
```
"""

name = "VerifyAdverseDrops"
description = "Verifies there are no adverse drops on DCS-7280 and DCS-7500 family switches."
categories: ClassVar[list[str]] = ["hardware"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show hardware counter drop", revision=1)]

Expand Down
Loading

0 comments on commit 79016f7

Please sign in to comment.