summaryrefslogtreecommitdiffstats
path: root/tests/units/anta_tests/test_security.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/anta_tests/test_security.py')
-rw-r--r--tests/units/anta_tests/test_security.py43
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/units/anta_tests/test_security.py b/tests/units/anta_tests/test_security.py
index 4c28541..3a732bd 100644
--- a/tests/units/anta_tests/test_security.py
+++ b/tests/units/anta_tests/test_security.py
@@ -34,7 +34,14 @@ DATA: list[dict[str, Any]] = [
"expected": {"result": "success"},
},
{
- "name": "failure",
+ "name": "error-missing-ssh-status",
+ "test": VerifySSHStatus,
+ "eos_data": ["SSH per host connection limit is 20\nFIPS status: disabled\n\n"],
+ "inputs": None,
+ "expected": {"result": "error", "messages": ["Could not find SSH status in returned output."]},
+ },
+ {
+ "name": "failure-ssh-disabled",
"test": VerifySSHStatus,
"eos_data": ["SSHD status for Default VRF is enabled\nSSH connection limit is 50\nSSH per host connection limit is 20\nFIPS status: disabled\n\n"],
"inputs": None,
@@ -574,6 +581,40 @@ DATA: list[dict[str, Any]] = [
},
},
{
+ "name": "error-wrong-input-rsa",
+ "test": VerifyAPISSLCertificate,
+ "eos_data": [],
+ "inputs": {
+ "certificates": [
+ {
+ "certificate_name": "ARISTA_ROOT_CA.crt",
+ "expiry_threshold": 30,
+ "common_name": "Arista Networks Internal IT Root Cert Authority",
+ "encryption_algorithm": "RSA",
+ "key_size": 256,
+ },
+ ]
+ },
+ "expected": {"result": "error", "messages": ["Allowed sizes are (2048, 3072, 4096)."]},
+ },
+ {
+ "name": "error-wrong-input-ecdsa",
+ "test": VerifyAPISSLCertificate,
+ "eos_data": [],
+ "inputs": {
+ "certificates": [
+ {
+ "certificate_name": "ARISTA_SIGNING_CA.crt",
+ "expiry_threshold": 30,
+ "common_name": "AristaIT-ICA ECDSA Issuing Cert Authority",
+ "encryption_algorithm": "ECDSA",
+ "key_size": 2048,
+ },
+ ]
+ },
+ "expected": {"result": "error", "messages": ["Allowed sizes are (256, 384, 512)."]},
+ },
+ {
"name": "success",
"test": VerifyBannerLogin,
"eos_data": [