Skip to content

Commit

Permalink
fix(anta.tests): Add latest eAPI command revision number to all tests (
Browse files Browse the repository at this point in the history
…#609)

Add revision to all tests
  • Loading branch information
carl-baillargeon authored Mar 27, 2024
1 parent 23d706a commit 1d59155
Show file tree
Hide file tree
Showing 27 changed files with 129 additions and 120 deletions.
14 changes: 7 additions & 7 deletions anta/tests/aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class VerifyTacacsSourceIntf(AntaTest):
name = "VerifyTacacsSourceIntf"
description = "Verifies TACACS source-interface for a specified VRF."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyTacacsSourceIntf test."""
Expand Down Expand Up @@ -84,7 +84,7 @@ class VerifyTacacsServers(AntaTest):
name = "VerifyTacacsServers"
description = "Verifies TACACS servers are configured for a specified VRF."
categories: ClassVar[list[str]] = ["aaa"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyTacacsServers test."""
Expand Down Expand Up @@ -137,7 +137,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show tacacs", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyTacacsServerGroups test."""
Expand Down Expand Up @@ -187,7 +187,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods authentication", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyAuthenMethods test."""
Expand Down Expand Up @@ -248,7 +248,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods authorization", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyAuthzMethods test."""
Expand Down Expand Up @@ -304,7 +304,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods accounting", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyAcctDefaultMethods test."""
Expand Down Expand Up @@ -367,7 +367,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show aaa methods accounting", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyAcctConsoleMethods test."""
Expand Down
6 changes: 3 additions & 3 deletions anta/tests/bfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bfd peers", revision=4)]

class Input(AntaTest.Input):
"""Input model for the VerifyBFDSpecificPeers test."""
Expand Down Expand Up @@ -126,7 +126,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show bfd peers detail", revision=4)]

class Input(AntaTest.Input):
"""Input model for the VerifyBFDPeersIntervals test."""
Expand Down Expand Up @@ -224,7 +224,7 @@ class VerifyBFDPeersHealth(AntaTest):
# revision 1 as later revision introduces additional nesting for type
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [
AntaCommand(command="show bfd peers", revision=1),
AntaCommand(command="show clock"),
AntaCommand(command="show clock", revision=1),
]

class Input(AntaTest.Input):
Expand Down
2 changes: 1 addition & 1 deletion anta/tests/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class VerifyZeroTouch(AntaTest):
name = "VerifyZeroTouch"
description = "Verifies ZeroTouch is disabled"
categories: ClassVar[list[str]] = ["configuration"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show zerotouch")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show zerotouch", revision=1)]

@AntaTest.anta_test
def test(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions anta/tests/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VerifyReachability(AntaTest):
name = "VerifyReachability"
description = "Test the network reachability to one or many destination IP(s)."
categories: ClassVar[list[str]] = ["connectivity"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaTemplate(template="ping vrf {vrf} {destination} source {source} repeat {repeat}")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaTemplate(template="ping vrf {vrf} {destination} source {source} repeat {repeat}", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyReachability test."""
Expand Down Expand Up @@ -116,7 +116,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show lldp neighbors detail", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyLLDPNeighbors test."""
Expand Down
4 changes: 2 additions & 2 deletions anta/tests/field_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show version detail", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down Expand Up @@ -141,7 +141,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show version detail", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down
4 changes: 2 additions & 2 deletions anta/tests/greent.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show monitor telemetry postcard counters", revision=1)]

@AntaTest.anta_test
def test(self) -> None:
Expand Down Expand Up @@ -64,7 +64,7 @@ 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")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show monitor telemetry postcard policy profile", revision=1)]

@AntaTest.anta_test
def test(self) -> None:
Expand Down
14 changes: 7 additions & 7 deletions anta/tests/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show inventory", revision=2)]

class Input(AntaTest.Input):
"""Input model for the VerifyTransceiversManufacturers test."""
Expand Down Expand Up @@ -80,7 +80,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment temperature", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down Expand Up @@ -113,7 +113,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment temperature transceiver", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down Expand Up @@ -154,7 +154,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment cooling", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down Expand Up @@ -188,7 +188,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment cooling", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyEnvironmentCooling test."""
Expand Down Expand Up @@ -235,7 +235,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show system environment power", revision=1)]

class Input(AntaTest.Input):
"""Input model for the VerifyEnvironmentPower test."""
Expand Down Expand Up @@ -277,7 +277,7 @@ 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", ofmt="json")]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show hardware counter drop", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
@AntaTest.anta_test
Expand Down
Loading

0 comments on commit 1d59155

Please sign in to comment.