Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #25 Fix #3

Open
wants to merge 16 commits into
base: Issue25
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
444 changes: 391 additions & 53 deletions aci-preupgrade-validation-script.py

Large diffs are not rendered by default.

218 changes: 202 additions & 16 deletions docs/docs/validations.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tests/cimc_compatibilty_check/compatRsSuppHw_605_L2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"compatRsSuppHw": {
"attributes": {
"cimcVersion": "4.0(2f)",
"dn": "uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicl2]"
}
}
}
]
10 changes: 10 additions & 0 deletions tests/cimc_compatibilty_check/compatRsSuppHw_605_M1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"compatRsSuppHw": {
"attributes": {
"cimcVersion": "3.0(4j)",
"dn": "uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicm1]"
}
}
}
]
40 changes: 40 additions & 0 deletions tests/cimc_compatibilty_check/eqptCh_newver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "4.0(2f)",
"configRole": "unspecified",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-1/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "4.0(2f)",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-2/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "4.0(2f)",
"configRole": "unspecified",
"descr": "APIC-SERVER-M1",
"dn": "topology/pod-2/node-3/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-M1"
}
}
}
]
40 changes: 40 additions & 0 deletions tests/cimc_compatibilty_check/eqptCh_oldver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "3.0(4l)",
"configRole": "unspecified",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-1/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "3.0(4l)",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-2/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "3.0(4l)",
"configRole": "unspecified",
"descr": "APIC-SERVER-M1",
"dn": "topology/pod-2/node-3/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-M1"
}
}
}
]
40 changes: 40 additions & 0 deletions tests/cimc_compatibilty_check/eqptCh_reallyoldver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "1.5(4e)",
"configRole": "unspecified",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-1/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "1.5(4e)",
"descr": "APIC-SERVER-L2",
"dn": "topology/pod-1/node-2/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-L2"
}
}
},
{
"eqptCh": {
"attributes": {
"bootSource": "bootflash",
"cimcVersion": "1.5(4e)",
"configRole": "unspecified",
"descr": "APIC-SERVER-M1",
"dn": "topology/pod-2/node-3/sys/ch",
"hybridMode": "no",
"model": "APIC-SERVER-M1"
}
}
}
]
47 changes: 47 additions & 0 deletions tests/cimc_compatibilty_check/test_cimc_compatibilty_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os
import pytest
import logging
import importlib
from helpers.utils import read_data

script = importlib.import_module("aci-preupgrade-validation-script")

log = logging.getLogger(__name__)
dir = os.path.dirname(os.path.abspath(__file__))


# icurl queries
eqptCh_api = 'eqptCh.json?query-target-filter=wcard(eqptCh.descr,"APIC")'

compatRsSuppHwL2_api = 'uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicl2].json'
compatRsSuppHwM1_api = 'uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicm1].json'

@pytest.mark.parametrize(
"icurl_outputs, tversion, expected_result",
[
(
{eqptCh_api: read_data(dir, "eqptCh_reallyoldver.json"),
compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"),
compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")},
"6.0(5a)",
script.FAIL_UF,
),
(
{eqptCh_api: read_data(dir, "eqptCh_oldver.json"),
compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"),
compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")},
"6.0(5a)",
script.FAIL_UF,
),
(
{eqptCh_api: read_data(dir, "eqptCh_newver.json"),
compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"),
compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")},
"6.0(5a)",
script.PASS,
),
],
)
def test_logic(mock_icurl, tversion, expected_result):
result = script.cimc_compatibilty_check(1, 1, script.AciVersion(tversion))
assert result == expected_result
90 changes: 90 additions & 0 deletions tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"infraRsHPathAtt": {
"attributes": {
"annotation": "",
"childAction": "",
"dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/extpaths-198/pathep-[eth1/7]]",
"extMngdBy": "",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2021-10-23T08:33:12.722+09:00",
"rType": "mo",
"state": "unformed",
"stateQual": "none",
"status": "",
"tCl": "fabricPathEp",
"tDn": "topology/pod-1/paths-105/extpaths-198/pathep-[eth1/7]",
"tType": "mo",
"uid": "15374",
"userdom": ""
}
}
},
{
"infraRsHPathAtt": {
"attributes": {
"annotation": "",
"childAction": "",
"dn": "uni/infra/hpaths-__ui_l101_eth1--1/rsHPathAtt-[topology/pod-1/paths-101/pathep-[eth1/1]]",
"extMngdBy": "",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2018-06-04T08:10:52.124+09:00",
"rType": "mo",
"state": "unformed",
"stateQual": "none",
"status": "",
"tCl": "fabricPathEp",
"tDn": "topology/pod-1/paths-101/pathep-[eth1/1]",
"tType": "mo",
"uid": "15374",
"userdom": ""
}
}
},
{
"infraRsHPathAtt": {
"attributes": {
"annotation": "",
"childAction": "",
"dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth100/1/7]]",
"extMngdBy": "",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2021-10-23T08:33:12.722+09:00",
"rType": "mo",
"state": "unformed",
"stateQual": "none",
"status": "",
"tCl": "fabricPathEp",
"tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]",
"tType": "mo",
"uid": "15374",
"userdom": ""
}
}
},
{
"infraRsHPathAtt": {
"attributes": {
"annotation": "",
"childAction": "",
"dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth1/30/11]]",
"extMngdBy": "",
"forceResolve": "yes",
"lcOwn": "local",
"modTs": "2021-10-23T08:33:12.722+09:00",
"rType": "mo",
"state": "unformed",
"stateQual": "none",
"status": "",
"tCl": "fabricPathEp",
"tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]",
"tType": "mo",
"uid": "15374",
"userdom": ""
}
}
}
]
Loading