Skip to content

ANTA catalog for LANZ tests

VerifyLANZ

Verifies if LANZ (Latency Analyzer) is enabled.

Expected Results
  • Success: The test will pass if LANZ is enabled.
  • Failure: The test will fail if LANZ is disabled.
Examples
anta.tests.lanz:
  - VerifyLANZ:
Source code in anta/tests/lanz.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class VerifyLANZ(AntaTest):
    """Verifies if LANZ (Latency Analyzer) is enabled.

    Expected Results
    ----------------
    * Success: The test will pass if LANZ is enabled.
    * Failure: The test will fail if LANZ is disabled.

    Examples
    --------
    ```yaml
    anta.tests.lanz:
      - VerifyLANZ:
    ```
    """

    name = "VerifyLANZ"
    description = "Verifies if LANZ is enabled."
    categories: ClassVar[list[str]] = ["lanz"]
    commands: ClassVar[list[AntaCommand | AntaTemplate]] = [AntaCommand(command="show queue-monitor length status", revision=1)]

    @skip_on_platforms(["cEOSLab", "vEOS-lab", "cEOSCloudLab"])
    @AntaTest.anta_test
    def test(self) -> None:
        """Main test function for VerifyLANZ."""
        command_output = self.instance_commands[0].json_output

        if command_output["lanzEnabled"] is not True:
            self.result.is_failure("LANZ is not enabled")
        else:
            self.result.is_success()