Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gcp): fix flaky tests from dns service #6570

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from re import search
from unittest import mock

from tests.providers.gcp.gcp_fixtures import GCP_PROJECT_ID, set_mocked_gcp_provider
from tests.providers.gcp.gcp_fixtures import (
GCP_EU1_LOCATION,
GCP_PROJECT_ID,
set_mocked_gcp_provider,
)


class Test_dns_dnssec_disabled:
def test_dns_no_managed_zones(self):
dns_client = mock.MagicMock
dns_client.managed_zones = []
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -51,6 +56,7 @@ def test_one_compliant_managed_zone(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -101,6 +107,7 @@ def test_managed_zone_with_dnssec_disabled(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from re import search
from unittest import mock

from tests.providers.gcp.gcp_fixtures import GCP_PROJECT_ID, set_mocked_gcp_provider
from tests.providers.gcp.gcp_fixtures import (
GCP_EU1_LOCATION,
GCP_PROJECT_ID,
set_mocked_gcp_provider,
)


class Test_dns_rsasha1_in_use_to_key_sign_in_dnssec:
def test_dns_no_managed_zones(self):
dns_client = mock.MagicMock
dns_client.managed_zones = []
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -51,6 +56,7 @@ def test_one_compliant_managed_zone(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -101,6 +107,7 @@ def test_managed_zone_with_rsasha1_key_sign(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from re import search
from unittest import mock

from tests.providers.gcp.gcp_fixtures import GCP_PROJECT_ID, set_mocked_gcp_provider
from tests.providers.gcp.gcp_fixtures import (
GCP_EU1_LOCATION,
GCP_PROJECT_ID,
set_mocked_gcp_provider,
)


class Test_dns_rsasha1_in_use_to_zone_sign_in_dnssec:
def test_dns_no_managed_zones(self):
dns_client = mock.MagicMock
dns_client.managed_zones = []
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -51,6 +56,7 @@ def test_one_compliant_managed_zone(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down Expand Up @@ -101,6 +107,7 @@ def test_managed_zone_with_dnssec_disabled(self):
dns_client = mock.MagicMock
dns_client.project_ids = [GCP_PROJECT_ID]
dns_client.managed_zones = [managed_zone]
dns_client.region = GCP_EU1_LOCATION

with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
Expand Down
Loading