Skip to content

Commit

Permalink
fix(anta.tests): Fix AVT and Path-Selection tests to be skipped on cE…
Browse files Browse the repository at this point in the history
…OSlab and vEOS-lab (#685)
  • Loading branch information
carl-baillargeon authored May 17, 2024
1 parent 28ba8e1 commit 838ec40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions anta/tests/avt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pydantic import BaseModel

from anta.decorators import skip_on_platforms
from anta.models import AntaCommand, AntaTemplate, AntaTest
from anta.tools import get_value

Expand All @@ -38,6 +39,7 @@ class VerifyAVTPathHealth(AntaTest):
categories: ClassVar[list[str]] = ["avt"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show adaptive-virtual-topology path")]

@skip_on_platforms(["cEOSLab", "vEOS-lab"])
@AntaTest.anta_test
def test(self) -> None:
"""Main test function for VerifyAVTPathHealth."""
Expand Down Expand Up @@ -126,6 +128,7 @@ def render(self, template: AntaTemplate) -> list[AntaCommand]:
"""Render the template for each input AVT path/peer."""
return [template.render(vrf=path.vrf, avt_name=path.avt_name, destination=path.destination) for path in self.inputs.avt_paths]

@skip_on_platforms(["cEOSLab", "vEOS-lab"])
@AntaTest.anta_test
def test(self) -> None:
"""Main test function for VerifyAVTSpecificPath."""
Expand Down Expand Up @@ -216,6 +219,7 @@ class Input(AntaTest.Input):
role: str
"""Expected AVT role of the device."""

@skip_on_platforms(["cEOSLab", "vEOS-lab"])
@AntaTest.anta_test
def test(self) -> None:
"""Main test function for VerifyAVTRole."""
Expand Down
3 changes: 3 additions & 0 deletions anta/tests/path_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pydantic import BaseModel

from anta.decorators import skip_on_platforms
from anta.models import AntaCommand, AntaTemplate, AntaTest
from anta.tools import get_value

Expand Down Expand Up @@ -42,6 +43,7 @@ class VerifyPathsHealth(AntaTest):
categories: ClassVar[list[str]] = ["path-selection"]
commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show path-selection paths", revision=1)]

@skip_on_platforms(["cEOSLab", "vEOS-lab"])
@AntaTest.anta_test
def test(self) -> None:
"""Main test function for VerifyPathsHealth."""
Expand Down Expand Up @@ -130,6 +132,7 @@ def render(self, template: AntaTemplate) -> list[AntaCommand]:
template.render(peer=path.peer, group=path.path_group, source=path.source_address, destination=path.destination_address) for path in self.inputs.paths
]

@skip_on_platforms(["cEOSLab", "vEOS-lab"])
@AntaTest.anta_test
def test(self) -> None:
"""Main test function for VerifySpecificPath."""
Expand Down

0 comments on commit 838ec40

Please sign in to comment.