-
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.
* Update pytest for eventmgr_db_defect_check * Update pytest for encap_already_in_use_check * Update pytest for apic_ca_cert_validation * Update pytest for vpc_paired_switches_check * Update pytest for llfc_susceptibility_check * Update pytest for telemetryStatsServerP_object_check * Update pytest for isis_redis_metric_mpod_msite_check * Update pytest for switch_bootflash_usage_check * Update pytest for contract_22_defect_check * Update pytest for internal_vlanpool_check * Update pytest for bgp_golf_route_target_type_check * Remove unnecessary path setting in test_IPAddress * Update pytest for Aciversion * Update pytest for get_vpc_node()
- Loading branch information
Showing
57 changed files
with
1,833 additions
and
1,612 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
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
tests/apic_ca_cert_validation/test_apic_ca_cert_validation.py
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,32 @@ | ||
import os | ||
import pytest | ||
import logging | ||
import importlib | ||
|
||
script = importlib.import_module("aci-preupgrade-validation-script") | ||
|
||
log = logging.getLogger(__name__) | ||
dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"certreq_out_file, expected_result", | ||
[ | ||
# FAIL - certreq returns error | ||
( | ||
"POS_certreq.txt", | ||
script.FAIL_O, | ||
), | ||
# PASS - certreq returns cert info | ||
( | ||
"NEG_certreq.txt", | ||
script.PASS, | ||
), | ||
], | ||
) | ||
def test_logic(certreq_out_file, expected_result): | ||
data_path = os.path.join("tests", dir, certreq_out_file) | ||
with open(data_path, "r") as file: | ||
certreq_out = file.read() | ||
result = script.apic_ca_cert_validation(1, 1, certreq_out=certreq_out) | ||
assert result == expected_result |
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,50 @@ | ||
[ | ||
{ | ||
"fvCtx": { | ||
"attributes": { | ||
"annotation": "orchestrator:msc-shadow:no", | ||
"bdEnforcedEnable": "no", | ||
"dn": "uni/tn-welkin/ctx-qa", | ||
"knwMcastAct": "permit", | ||
"monPolDn": "uni/tn-common/monepg-default", | ||
"name": "qa", | ||
"pcEnfDir": "ingress", | ||
"pcEnfDirUpdated": "yes", | ||
"pcEnfPref": "enforced", | ||
"pcTag": "16386", | ||
"scope": "3080192", | ||
"seg": "3080192" | ||
}, | ||
"children": [ | ||
{ | ||
"l3extGlobalCtxName": { | ||
"attributes": { | ||
"name": "welkinqa", | ||
"rn": "globalctxname" | ||
} | ||
} | ||
}, | ||
{ | ||
"bgpRtTargetP": { | ||
"attributes": { | ||
"af": "ipv4-ucast", | ||
"rn": "rtp-ipv4-ucast" | ||
}, | ||
"children": [ | ||
{ | ||
"bgpRtTarget": { | ||
"attributes": { | ||
"rn": "rt-[extended:as2-nn2:100:2000]-import", | ||
"rt": "extended:as2-nn2:100:2000", | ||
"targetAf": "l2vpn-evpn", | ||
"type": "import" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
71 changes: 71 additions & 0 deletions
71
tests/bgp_golf_route_target_type_check/test_bgp_golf_route_target_type_check.py
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,71 @@ | ||
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 | ||
fvCtxs = 'fvCtx.json?rsp-subtree=full&rsp-subtree-class=l3extGlobalCtxName,bgpRtTarget&rsp-subtree-include=required' | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"icurl_outputs, cversion, tversion, expected_result", | ||
[ | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"4.2(1b)", | ||
"5.2(2a)", | ||
script.PASS, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"3.2(1a)", | ||
"4.2(4d)", | ||
script.FAIL_O, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"3.2(1a)", | ||
"5.2(6a)", | ||
script.FAIL_O, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"4.2(3a)", | ||
"4.2(7d)", | ||
script.PASS, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"2.2(3a)", | ||
"2.2(4r)", | ||
script.PASS, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"5.2(1a)", | ||
None, | ||
script.MANUAL, | ||
), | ||
( | ||
{fvCtxs: read_data(dir, "fvCtx_pos.json")}, | ||
"4.1(1a)", | ||
"5.2(7f)", | ||
script.FAIL_O, | ||
), | ||
], | ||
) | ||
def test_logic(mock_icurl, cversion, tversion, expected_result): | ||
result = script.bgp_golf_route_target_type_check( | ||
1, | ||
1, | ||
script.AciVersion(cversion), | ||
script.AciVersion(tversion) if tversion else None, | ||
) | ||
assert result == expected_result |
Oops, something went wrong.