-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
10 changed files
with
159 additions
and
94 deletions.
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
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
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,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# (C) Datadog, Inc. 2024-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
import os | ||
from typing import Any # noqa: F401 | ||
|
||
import pytest | ||
|
||
from datadog_checks.tls import TLSCheck | ||
from datadog_checks.tls.const import ( | ||
SERVICE_CHECK_CAN_CONNECT, | ||
SERVICE_CHECK_VALIDATION, | ||
) | ||
|
||
|
||
@pytest.mark.e2e | ||
def test_connection_after_fips(clean_fips_environment, dd_fips_environment, dd_agent_check, instance_e2e_fips): | ||
""" | ||
Test connection to the FIPS server after enabling FIPS mode. | ||
""" | ||
os.environ["GOFIPS"] = "1" | ||
aggregator = dd_agent_check(instance_e2e_fips) | ||
aggregator.assert_service_check(SERVICE_CHECK_CAN_CONNECT, status=TLSCheck.OK, count=1) | ||
aggregator.assert_service_check(SERVICE_CHECK_VALIDATION, status=TLSCheck.OK, count=1) | ||
|
||
|
||
@pytest.mark.e2e | ||
def test_connection_after_non_fips(clean_fips_environment, dd_fips_environment, dd_agent_check, instance_e2e_non_fips): | ||
""" | ||
Test connection to the non-FIPS server after enabling FIPS mode. | ||
""" | ||
os.environ["GOFIPS"] = "1" | ||
aggregator = dd_agent_check(instance_e2e_non_fips) | ||
aggregator.assert_service_check( | ||
SERVICE_CHECK_VALIDATION, | ||
message="[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1000)", | ||
) |
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# (C) Datadog, Inc. 2024-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
from typing import Any # noqa: F401 | ||
|
||
import pytest | ||
|
||
from datadog_checks.tls import TLSCheck | ||
from datadog_checks.tls.const import ( | ||
SERVICE_CHECK_CAN_CONNECT, | ||
SERVICE_CHECK_VALIDATION, | ||
) | ||
|
||
|
||
@pytest.mark.e2e | ||
def test_connection_before_fips(clean_fips_environment, dd_fips_environment, dd_agent_check, instance_e2e_fips): | ||
""" | ||
Test connection to the FIPS server before enabling FIPS mode. | ||
""" | ||
aggregator = dd_agent_check(instance_e2e_fips) | ||
aggregator.assert_service_check(SERVICE_CHECK_CAN_CONNECT, status=TLSCheck.OK, count=1) | ||
aggregator.assert_service_check(SERVICE_CHECK_VALIDATION, status=TLSCheck.OK, count=1) | ||
|
||
|
||
@pytest.mark.e2e | ||
def test_connection_before_non_fips(clean_fips_environment, dd_fips_environment, dd_agent_check, instance_e2e_non_fips): | ||
""" | ||
Test connection to the non-FIPS server before enabling FIPS mode. | ||
""" | ||
aggregator = dd_agent_check(instance_e2e_non_fips) | ||
aggregator.assert_service_check(SERVICE_CHECK_CAN_CONNECT, status=TLSCheck.OK, count=1) | ||
aggregator.assert_service_check(SERVICE_CHECK_VALIDATION, status=TLSCheck.OK, count=1) |