From 2a7b8d979509d86a432f09574de2e50e4f799cf4 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 5 Dec 2024 10:23:53 +0100 Subject: [PATCH 1/2] Fix skipif decorators' conditions The ECDSA256 and ECDSA384 check conditions were switched. --- bin/tests/system/ecdsa/tests_ecdsa.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/ecdsa/tests_ecdsa.py b/bin/tests/system/ecdsa/tests_ecdsa.py index 6ae613c202..34b55d7ba1 100644 --- a/bin/tests/system/ecdsa/tests_ecdsa.py +++ b/bin/tests/system/ecdsa/tests_ecdsa.py @@ -38,16 +38,16 @@ def check_server_soa(resolver): @pytest.mark.skipif( - not os.environ["ECDSAP384SHA384_SUPPORTED"], - reason="algorithm ECDSA384 not supported", + not os.environ["ECDSAP256SHA256_SUPPORTED"], + reason="algorithm ECDSA256 not supported", ) def test_ecdsa256(): check_server_soa("10.53.0.2") @pytest.mark.skipif( - not os.environ["ECDSAP256SHA256_SUPPORTED"], - reason="algorithm ECDSA256 not supported", + not os.environ["ECDSAP384SHA384_SUPPORTED"], + reason="algorithm ECDSA384 not supported", ) def test_ecdsa384(): check_server_soa("10.53.0.3") From 1a5683b638894032548bedb357c0823bdda5c189 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 5 Dec 2024 10:37:19 +0100 Subject: [PATCH 2/2] Use os.getenv() instead of os.environ If ECDSAP256SHA256_SUPPORTED or ECDSAP384SHA384_SUPPORTED variables were not present in the environment, os.environ would raise KeyError that is not being handled in the decorator. Use os.getenv() instead. --- bin/tests/system/ecdsa/tests_ecdsa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/ecdsa/tests_ecdsa.py b/bin/tests/system/ecdsa/tests_ecdsa.py index 34b55d7ba1..1329fa710e 100644 --- a/bin/tests/system/ecdsa/tests_ecdsa.py +++ b/bin/tests/system/ecdsa/tests_ecdsa.py @@ -38,7 +38,7 @@ def check_server_soa(resolver): @pytest.mark.skipif( - not os.environ["ECDSAP256SHA256_SUPPORTED"], + not os.getenv("ECDSAP256SHA256_SUPPORTED"), reason="algorithm ECDSA256 not supported", ) def test_ecdsa256(): @@ -46,7 +46,7 @@ def test_ecdsa256(): @pytest.mark.skipif( - not os.environ["ECDSAP384SHA384_SUPPORTED"], + not os.getenv("ECDSAP384SHA384_SUPPORTED"), reason="algorithm ECDSA384 not supported", ) def test_ecdsa384():