Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#131 Fixed
Added validation if CloudSec is enabled by checking the prescence of cloudsecPreSharedKey instances.
Local pytest result:
aci-preupgrade-validation-script.py 100% 189KB 294.9KB/s 00:00
jeestrad@JEESTRAD-M-L6VV ACI-Pre-Upgrade-Validation-Script % python3 -m pytest tests/cloudsec_encryption_check
==================================================================================== test session starts ====================================================================================
platform darwin -- Python 3.9.6, pytest-8.2.0, pluggy-1.5.0
rootdir: /Users/jeestrad/Documents/Python/pre-upgrade/ACI-Pre-Upgrade-Validation-Script/ACI-Pre-Upgrade-Validation-Script
configfile: pytest.ini
collected 4 items
tests/cloudsec_encryption_check/test_cloudsec_encryption_check.py::test_logic[icurl_outputs0-5.2(6a)-N/A] PASSED [ 25%]
tests/cloudsec_encryption_check/test_cloudsec_encryption_check.py::test_logic[icurl_outputs1-5.2(6b)-N/A] PASSED [ 50%]
tests/cloudsec_encryption_check/test_cloudsec_encryption_check.py::test_logic[icurl_outputs2-6.0(6b)-PASS] PASSED [ 75%]
tests/cloudsec_encryption_check/test_cloudsec_encryption_check.py::test_logic[icurl_outputs3-6.0(6b)-FAIL - OUTAGE WARNING!!] PASSED [100%]
===================================================================================== warnings summary ======================================================================================
aci-preupgrade-validation-script.py:123
/Users/jeestrad/Documents/Python/pre-upgrade/ACI-Pre-Upgrade-Validation-Script/ACI-Pre-Upgrade-Validation-Script/aci-preupgrade-validation-script.py:123: DeprecationWarning: invalid escape sequence \s
self.prompt = "#\s.$" #"[^#]#[ ](.)[ ]*$"
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================================== 4 passed, 1 warning in 0.02s ================================================================================
Test in lab fabric:
jeestrad@d-apic1:~> python /tmp/aci-preupgrade-validation-script.py
[Check 1/2] ClouSec Encrpytion Check... N/A
[Check 2/2] LLDP Custom Interface Description Defect... PASS
jeestrad@d-apic1:~> python /tmp/aci-preupgrade-validation-script.py
[Check 1/2] ClouSec Encrpytion Check... The CloudSec Encryption feature is deprecated in target version FAIL - OUTAGE WARNING!!
[Check 2/2] LLDP Custom Interface Description Defect... PASS