Skip to content

Commit

Permalink
Merge branch 'main' into fix_ptp_software_module_failure_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
geetanjalimanegslab authored Feb 13, 2025
2 parents fa2d6d5 + b652ed1 commit ba9e356
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
- '<!--| ~| -->'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.9.6
hooks:
- id: ruff
name: Run Ruff linter
Expand Down Expand Up @@ -86,7 +86,7 @@ repos:
args: ["--ignore-words", ".codespellignore"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.15.0
hooks:
- id: mypy
name: Check typing with mypy
Expand Down
2 changes: 1 addition & 1 deletion anta/input_models/avt.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def __str__(self) -> str:
AVT CONTROL-PLANE-PROFILE VRF: default (Destination: 10.101.255.2, Next-hop: 10.101.255.1)
"""
return f"AVT {self.avt_name} VRF: {self.vrf} (Destination: {self.destination}, Next-hop: {self.next_hop})"
return f"AVT: {self.avt_name} VRF: {self.vrf} Destination: {self.destination} Next-hop: {self.next_hop}"
2 changes: 1 addition & 1 deletion anta/tests/avt.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ def test(self) -> None:

# Check if the AVT role matches the expected role
if self.inputs.role != command_output.get("role"):
self.result.is_failure(f"Expected AVT role as `{self.inputs.role}`, but found `{command_output.get('role')}` instead.")
self.result.is_failure(f"AVT role mismatch - Expected: {self.inputs.role}, Actual: {command_output.get('role')}")
4 changes: 2 additions & 2 deletions anta/tests/field_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test(self) -> None:
for variant in variants:
model = model.replace(variant, "")
if model not in devices:
self.result.is_skipped("device is not impacted by FN044")
self.result.is_skipped("Device is not impacted by FN044")
return

for component in command_output["details"]["components"]:
Expand All @@ -117,7 +117,7 @@ def test(self) -> None:
)
)
if incorrect_aboot_version:
self.result.is_failure(f"device is running incorrect version of aboot ({aboot_version})")
self.result.is_failure(f"Device is running incorrect version of aboot {aboot_version}")


class VerifyFieldNotice72Resolution(AntaTest):
Expand Down
18 changes: 9 additions & 9 deletions tests/units/anta_tests/test_avt.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
},
"expected": {
"result": "failure",
"messages": ["AVT MGMT-AVT-POLICY-DEFAULT VRF: default (Destination: 10.101.255.2, Next-hop: 10.101.255.1) - No AVT path configured"],
"messages": ["AVT: MGMT-AVT-POLICY-DEFAULT VRF: default Destination: 10.101.255.2 Next-hop: 10.101.255.1 - No AVT path configured"],
},
},
{
Expand Down Expand Up @@ -507,8 +507,8 @@
"expected": {
"result": "failure",
"messages": [
"AVT DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default (Destination: 10.101.255.2, Next-hop: 10.101.255.11) Path Type: multihop - Path not found",
"AVT DATA-AVT-POLICY-CONTROL-PLANE VRF: data (Destination: 10.101.255.1, Next-hop: 10.101.255.21) Path Type: direct - Path not found",
"AVT: DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default Destination: 10.101.255.2 Next-hop: 10.101.255.11 Path Type: multihop - Path not found",
"AVT: DATA-AVT-POLICY-CONTROL-PLANE VRF: data Destination: 10.101.255.1 Next-hop: 10.101.255.21 Path Type: direct - Path not found",
],
},
},
Expand Down Expand Up @@ -571,8 +571,8 @@
"expected": {
"result": "failure",
"messages": [
"AVT DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default (Destination: 10.101.255.2, Next-hop: 10.101.255.11) - Path not found",
"AVT DATA-AVT-POLICY-CONTROL-PLANE VRF: data (Destination: 10.101.255.1, Next-hop: 10.101.255.21) - Path not found",
"AVT: DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default Destination: 10.101.255.2 Next-hop: 10.101.255.11 - Path not found",
"AVT: DATA-AVT-POLICY-CONTROL-PLANE VRF: data Destination: 10.101.255.1 Next-hop: 10.101.255.21 - Path not found",
],
},
},
Expand Down Expand Up @@ -646,11 +646,11 @@
"expected": {
"result": "failure",
"messages": [
"AVT DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default (Destination: 10.101.255.2, Next-hop: 10.101.255.1) - "
"AVT: DEFAULT-AVT-POLICY-CONTROL-PLANE VRF: default Destination: 10.101.255.2 Next-hop: 10.101.255.1 - "
"Incorrect path multihop:3 - Valid: False, Active: True",
"AVT DATA-AVT-POLICY-CONTROL-PLANE VRF: data (Destination: 10.101.255.1, Next-hop: 10.101.255.1) - "
"AVT: DATA-AVT-POLICY-CONTROL-PLANE VRF: data Destination: 10.101.255.1 Next-hop: 10.101.255.1 - "
"Incorrect path direct:10 - Valid: False, Active: True",
"AVT DATA-AVT-POLICY-CONTROL-PLANE VRF: data (Destination: 10.101.255.1, Next-hop: 10.101.255.1) - "
"AVT: DATA-AVT-POLICY-CONTROL-PLANE VRF: data Destination: 10.101.255.1 Next-hop: 10.101.255.1 - "
"Incorrect path direct:9 - Valid: True, Active: False",
],
},
Expand All @@ -667,6 +667,6 @@
"test": VerifyAVTRole,
"eos_data": [{"role": "transit"}],
"inputs": {"role": "edge"},
"expected": {"result": "failure", "messages": ["Expected AVT role as `edge`, but found `transit` instead."]},
"expected": {"result": "failure", "messages": ["AVT role mismatch - Expected: edge, Actual: transit"]},
},
]
10 changes: 5 additions & 5 deletions tests/units/anta_tests/test_field_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"inputs": None,
"expected": {
"result": "failure",
"messages": ["device is running incorrect version of aboot (4.0.1)"],
"messages": ["Device is running incorrect version of aboot 4.0.1"],
},
},
{
Expand All @@ -65,7 +65,7 @@
"inputs": None,
"expected": {
"result": "failure",
"messages": ["device is running incorrect version of aboot (4.1.0)"],
"messages": ["Device is running incorrect version of aboot 4.1.0"],
},
},
{
Expand All @@ -85,7 +85,7 @@
"inputs": None,
"expected": {
"result": "failure",
"messages": ["device is running incorrect version of aboot (6.0.1)"],
"messages": ["Device is running incorrect version of aboot 6.0.1"],
},
},
{
Expand All @@ -105,7 +105,7 @@
"inputs": None,
"expected": {
"result": "failure",
"messages": ["device is running incorrect version of aboot (6.1.1)"],
"messages": ["Device is running incorrect version of aboot 6.1.1"],
},
},
{
Expand All @@ -125,7 +125,7 @@
"inputs": None,
"expected": {
"result": "skipped",
"messages": ["device is not impacted by FN044"],
"messages": ["Device is not impacted by FN044"],
},
},
{
Expand Down

0 comments on commit ba9e356

Please sign in to comment.