2025-03-17 07:33:45 +01:00
|
|
|
# Copyright (c) 2023-2025 Arista Networks, Inc.
|
2025-02-05 11:32:35 +01:00
|
|
|
# Use of this source code is governed by the Apache License 2.0
|
|
|
|
# that can be found in the LICENSE file.
|
2025-02-05 11:38:32 +01:00
|
|
|
"""Test inputs for anta.tests.field_notices."""
|
|
|
|
|
2025-02-05 11:32:35 +01:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2025-05-15 09:34:27 +02:00
|
|
|
import sys
|
|
|
|
from typing import TYPE_CHECKING, Any
|
2025-02-05 11:32:35 +01:00
|
|
|
|
2025-05-15 09:34:27 +02:00
|
|
|
from anta.models import AntaTest
|
|
|
|
from anta.result_manager.models import AntaTestStatus
|
2025-02-05 11:32:35 +01:00
|
|
|
from anta.tests.field_notices import VerifyFieldNotice44Resolution, VerifyFieldNotice72Resolution
|
2025-02-05 11:54:23 +01:00
|
|
|
from tests.units.anta_tests import test
|
2025-02-05 11:32:35 +01:00
|
|
|
|
2025-05-15 09:34:27 +02:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
from tests.units.anta_tests import AntaUnitTestDataDict
|
|
|
|
|
|
|
|
DATA: AntaUnitTestDataDict = {
|
|
|
|
(VerifyFieldNotice44Resolution, "success"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
|
|
|
"details": {
|
|
|
|
"deviations": [],
|
2025-02-05 11:39:42 +01:00
|
|
|
"components": [{"name": "Aboot", "version": "Aboot-veos-8.0.0-3255441"}, {"name": "NotAboot", "version": "Aboot-veos-8.0.0-3255441"}],
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SUCCESS},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "failure-4.0"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "Aboot", "version": "Aboot-veos-4.0.1-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is running incorrect version of aboot 4.0.1"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "failure-4.1"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "Aboot", "version": "Aboot-veos-4.1.0-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is running incorrect version of aboot 4.1.0"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "failure-6.0"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "Aboot", "version": "Aboot-veos-6.0.1-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is running incorrect version of aboot 6.0.1"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "failure-6.1"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "Aboot", "version": "Aboot-veos-6.1.1-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is running incorrect version of aboot 6.1.1"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "skipped-model"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "vEOS-lab",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "Aboot", "version": "Aboot-veos-8.0.0-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device is not impacted by FN044"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice44Resolution, "failure-no-aboot-component"): {
|
2025-02-05 11:39:42 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"imageFormatVersion": "1.0",
|
|
|
|
"uptime": 1109144.35,
|
|
|
|
"modelName": "DCS-7280QRA-C36S",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "NotAboot", "version": "Aboot-veos-4.0.1-3255441"}]},
|
|
|
|
}
|
2025-02-05 11:39:42 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Aboot component not found"]},
|
2025-02-05 11:39:42 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "success-JPE"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JPE2130000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "7"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SUCCESS, "messages": ["FN72 is mitigated"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "success-JAS"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JAS2040000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "7"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SUCCESS, "messages": ["FN72 is mitigated"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "success-K-JPE"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "JPE2133000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "7"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SUCCESS, "messages": ["FN72 is mitigated"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "success-K-JAS"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "JAS2040000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "7"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SUCCESS, "messages": ["FN72 is mitigated"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-Serial"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "BAN2040000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "7"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device not exposed"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-Platform"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
2025-05-15 09:34:27 +02:00
|
|
|
{"modelName": "DCS-7150-52-CL", "serialNumber": "JAS0040000", "details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]}}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Platform is not impacted by FN072"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-range-JPE"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JPE2131000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:38:32 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device not exposed"]},
|
2025-02-05 11:38:32 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-range-K-JPE"): {
|
2025-02-05 11:38:32 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "JPE2134000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:38:32 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device not exposed"]},
|
2025-02-05 11:38:32 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-range-JAS"): {
|
2025-02-05 11:38:32 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JAS2041000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device not exposed"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "skipped-range-K-JAS"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "JAS2041000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.SKIPPED, "messages": ["Device not exposed"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "failed-JPE"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3K-48YC8",
|
|
|
|
"serialNumber": "JPE2133000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is exposed to FN72"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "failed-JAS"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JAS2040000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm1", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Device is exposed to FN72"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
(VerifyFieldNotice72Resolution, "error"): {
|
2025-02-05 11:32:35 +01:00
|
|
|
"eos_data": [
|
|
|
|
{
|
|
|
|
"modelName": "DCS-7280SR3-48YC8",
|
|
|
|
"serialNumber": "JAS2040000",
|
2025-05-15 09:34:27 +02:00
|
|
|
"details": {"deviations": [], "components": [{"name": "FixedSystemvrm2", "version": "5"}]},
|
|
|
|
}
|
2025-02-05 11:32:35 +01:00
|
|
|
],
|
2025-05-15 09:34:27 +02:00
|
|
|
"expected": {"result": AntaTestStatus.FAILURE, "messages": ["Error in running test - Component FixedSystemvrm1 not found in 'show version"]},
|
2025-02-05 11:32:35 +01:00
|
|
|
},
|
2025-05-15 09:34:27 +02:00
|
|
|
}
|