-
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.
- Loading branch information
Showing
5 changed files
with
97 additions
and
1 deletion.
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
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 @@ | ||
[] |
15 changes: 15 additions & 0 deletions
15
tests/cloudsec_encryption_check/cloudsecPreSharedKey_pos.json
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,15 @@ | ||
[ | ||
{ | ||
"cloudsecPreSharedKey": { | ||
"attributes": { | ||
"dn": "uni/tn-infra/cloudsecifp-default/psk-1", | ||
"monPolDn": "uni/tn-common/monepg-default", | ||
"name": "", | ||
"nameAlias": "", | ||
"ownerKey": "", | ||
"ownerTag": "", | ||
"status": "" | ||
} | ||
} | ||
} | ||
] |
48 changes: 48 additions & 0 deletions
48
tests/cloudsec_encryption_check/test_cloudsec_encryption_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,48 @@ | ||
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 | ||
cloudsecPreSharedKey = 'cloudsecPreSharedKey.json' | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"icurl_outputs, tversion, expected_result", | ||
[ | ||
( | ||
## TARGET VERSION IS OLDER THAN 6.0(6), CLOUDSEC IS PRESENT, VALIDATION RESULT : N/A | ||
{cloudsecPreSharedKey: read_data(dir, "cloudsecPreSharedKey_pos.json")}, | ||
"5.2(6a)", | ||
script.NA, | ||
), | ||
( | ||
## TARGET VERSION IS OLDER THAN 6.0(6), NO CLOUDSEC PRESENT, VALIDATION RESULT : N/A | ||
{cloudsecPreSharedKey: read_data(dir, "cloudsecPreSharedKey_neg.json")}, | ||
"5.2(6b)", | ||
script.NA, | ||
), | ||
( | ||
## TARGET VERSION IS NEWER THAN 6.0(6), NO CLOUDSEC PRESENT, VALIDATION RESULT : PASS | ||
{cloudsecPreSharedKey: read_data(dir, "cloudsecPreSharedKey_neg.json")}, | ||
"6.0(6b)", | ||
script.PASS, | ||
), | ||
( | ||
## TARGET VERSION IS NEWER THAN 6.0(6), CLOUDSEC PRESENT, VALIDATION RESULT : FAIL_O | ||
{cloudsecPreSharedKey: read_data(dir, "cloudsecPreSharedKey_pos.json")}, | ||
"6.0(6b)", | ||
script.FAIL_O, | ||
), | ||
], | ||
) | ||
def test_logic(mock_icurl, tversion, expected_result): | ||
result = script.cloudsec_encryption_check(1, 1, script.AciVersion(tversion)) | ||
assert result == expected_result |