diff --git a/anta/input_models/avt.py b/anta/input_models/avt.py index 6430045eb..44fd780fc 100644 --- a/anta/input_models/avt.py +++ b/anta/input_models/avt.py @@ -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}" diff --git a/anta/tests/avt.py b/anta/tests/avt.py index 365a2f72a..499b25057 100644 --- a/anta/tests/avt.py +++ b/anta/tests/avt.py @@ -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')}") diff --git a/anta/tests/field_notices.py b/anta/tests/field_notices.py index 0c093e796..cc7fab9f0 100644 --- a/anta/tests/field_notices.py +++ b/anta/tests/field_notices.py @@ -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"]: @@ -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): diff --git a/tests/units/anta_tests/test_avt.py b/tests/units/anta_tests/test_avt.py index bb6c6b903..60adbec28 100644 --- a/tests/units/anta_tests/test_avt.py +++ b/tests/units/anta_tests/test_avt.py @@ -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"], }, }, { @@ -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", ], }, }, @@ -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", ], }, }, @@ -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", ], }, @@ -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"]}, }, ] diff --git a/tests/units/anta_tests/test_field_notices.py b/tests/units/anta_tests/test_field_notices.py index 13dd66095..f7c5fc681 100644 --- a/tests/units/anta_tests/test_field_notices.py +++ b/tests/units/anta_tests/test_field_notices.py @@ -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"], }, }, { @@ -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"], }, }, { @@ -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"], }, }, { @@ -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"], }, }, { @@ -125,7 +125,7 @@ "inputs": None, "expected": { "result": "skipped", - "messages": ["device is not impacted by FN044"], + "messages": ["Device is not impacted by FN044"], }, }, {