From 92240acb5cc600eec60624ece9ed4b9ec43b386f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 07:06:46 +0200 Subject: Adding upstream version 0.15.0. Signed-off-by: Daniel Baumann --- tests/units/anta_tests/test_security.py | 43 ++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'tests/units/anta_tests/test_security.py') 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, @@ -573,6 +580,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, -- cgit v1.2.3