-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sup hwrev check + pytests * ver to v1.6.0
- Loading branch information
Showing
4 changed files
with
182 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1201/sys/ch/supslot-1/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-15279-05" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1201/sys/ch/supslot-2/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-15279-05" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1202/sys/ch/supslot-1/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-15279-05" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1202/sys/ch/supslot-1/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-15279-05" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1201/sys/ch/supslot-1/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-18562-02" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1201/sys/ch/supslot-2/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-A", | ||
"prtNum": "73-18562-02" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1202/sys/ch/supslot-1/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-B", | ||
"prtNum": "73-18570-02" | ||
} | ||
} | ||
}, | ||
{ | ||
"eqptSpCmnBlk": { | ||
"attributes": { | ||
"dn": "topology/pod-1/node-1202/sys/ch/supslot-2/sup/spsup/spcmn", | ||
"oem": "Cisco Systems, Inc.", | ||
"pdNum": "N9K-SUP-B", | ||
"prtNum": "73-18570-02" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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 | ||
eqptSpCmnBlk = 'eqptSpCmnBlk.json?&query-target-filter=wcard(eqptSpromSupBlk.dn,"sup")' | ||
|
||
@pytest.mark.parametrize( | ||
"icurl_outputs, cversion, tversion, expected_result", | ||
[ | ||
# Affected Sups and on 5.2 | ||
( | ||
{ | ||
eqptSpCmnBlk: read_data(dir, "eqptSpCmnBlk_POS.json") | ||
}, | ||
"5.2(1g)", | ||
"6.0(2h)", | ||
script.FAIL_O, | ||
), | ||
# Affected sups, no longer on 5.2 | ||
( | ||
{ | ||
eqptSpCmnBlk: read_data(dir, "eqptSpCmnBlk_POS.json") | ||
}, | ||
"6.0(3a)", | ||
"6.0(2h)", | ||
script.PASS, | ||
), | ||
# affected sups, not yet on 5.2 | ||
( | ||
{ | ||
eqptSpCmnBlk: read_data(dir, "eqptSpCmnBlk_POS.json") | ||
}, | ||
"4.2(3g)", | ||
"5.2(2h)", | ||
script.PASS, | ||
), | ||
# no affected sups | ||
( | ||
{ | ||
eqptSpCmnBlk: read_data(dir, "eqptSpCmnBlk_NEG.json") | ||
}, | ||
"5.2(1g)", | ||
"6.0(2h)", | ||
script.PASS, | ||
) | ||
], | ||
) | ||
def test_logic(mock_icurl, cversion, tversion, expected_result): | ||
result = script.sup_hwrev_check(1, 1, cversion, tversion) | ||
assert result == expected_result |