diff --git a/conftest.py b/conftest.py index 43fc3ff119..7e81f9362e 100644 --- a/conftest.py +++ b/conftest.py @@ -6,11 +6,13 @@ import pytest from pytest_jsonreport.plugin import JSONReport +from manifests.parser.core import load as load_manifest from utils import context from utils._context._scenarios import scenarios from utils.tools import logger from utils.scripts.junit_report import junit_modifyreport from utils._context.library_version import LibraryVersion +from utils._decorators import released, _get_skipped_item, _get_expected_failure_item # Monkey patch JSON-report plugin to avoid noise in report JSONReport.pytest_terminal_summary = lambda *args, **kwargs: None @@ -127,9 +129,52 @@ def _get_skip_reason_from_marker(marker): return None +def pytest_pycollect_makemodule(module_path, parent): + + manifest = load_manifest(context.scenario.library.library, context.scenario.weblog_variant) + + relative_path = str(module_path.relative_to(module_path.cwd())) + + if relative_path in manifest: + reason = manifest[relative_path] + mod: pytest.Module = pytest.Module.from_parent(parent, path=module_path) + + if reason.startswith("not relevant") or reason.startswith("flaky"): + mod.add_marker(pytest.mark.skip(reason=reason)) + logger.debug(f"Module {relative_path} is skipped by manifest file because {reason}") + else: + mod.add_marker(pytest.mark.xfail(reason=reason)) + logger.debug(f"Module {relative_path} is xfailed by manifest file because {reason}") + + return mod + + +@pytest.hookimpl(tryfirst=True) +def pytest_pycollect_makeitem(collector, name, obj): + + if collector.istestclass(obj, name): + + manifest = load_manifest(context.scenario.library.library, context.scenario.weblog_variant) + nodeid = f"{collector.nodeid}::{name}" + + if nodeid in manifest: + declaration = manifest[nodeid] + logger.info(f"Manifest declaration for {nodeid}: {declaration}") + + if declaration.startswith("v"): + if not hasattr(obj, "__released__"): # let priority to inline declaration + released(**{context.scenario.library.library: declaration[1:]})(obj) + elif declaration.startswith("not relevant") or declaration.startswith("flaky"): + _get_skipped_item(obj, declaration) + else: + _get_expected_failure_item(obj, declaration) + + def pytest_collection_modifyitems(session, config, items): """unselect items that are not included in the current scenario""" + logger.debug("pytest_collection_modifyitems") + def get_declared_scenario(item): for marker in item.own_markers: if marker.name == "scenario": @@ -181,6 +226,12 @@ def _item_is_skipped(item): if marker.name in ("skip",): return True + # for test methods in classes, item.parent.parent is the module + if item.parent.parent: + for marker in item.parent.parent.own_markers: + if marker.name in ("skip",): + return True + return False @@ -251,6 +302,8 @@ def pytest_runtest_call(item): @pytest.hookimpl(optionalhook=True) def pytest_json_runtest_metadata(item, call): + logger.debug("pytest_json_runtest_metadata") + if call.when != "setup": return {} diff --git a/manifests/cpp.yml b/manifests/cpp.yml new file mode 100644 index 0000000000..e93817a0d3 --- /dev/null +++ b/manifests/cpp.yml @@ -0,0 +1,62 @@ +tests/: + appsec/: + api_security/: + test_schemas.py: irrelevant (ASM is not implemented in C++) + iast/: + sink/: + test_command_injection.py: irrelevant (ASM is not implemented in C++) + test_insecure_cookie.py: irrelevant (ASM is not implemented in C++) + test_ldap_injection.py: irrelevant (ASM is not implemented in C++) + test_no_httponly_cookie.py: irrelevant (ASM is not implemented in C++) + test_no_samesite_cookie.py: irrelevant (ASM is not implemented in C++) + test_path_traversal.py: irrelevant (ASM is not implemented in C++) + test_sql_injection.py: irrelevant (ASM is not implemented in C++) + test_ssrf.py: irrelevant (ASM is not implemented in C++) + test_trust_boundary_violation.py: irrelevant (ASM is not implemented in C++) + test_unvalidated_redirect.py: irrelevant (ASM is not implemented in C++) + test_unvalidated_redirect_forward.py: irrelevant (ASM is not implemented in C++) + test_weak_cipher.py: irrelevant (ASM is not implemented in C++) + test_weak_hash.py: irrelevant (ASM is not implemented in C++) + test_weak_randomness.py: irrelevant (ASM is not implemented in C++) + test_xpath_injection.py: irrelevant (ASM is not implemented in C++) + source/: + test_body.py: irrelevant (ASM is not implemented in C++) + test_cookie_name.py: irrelevant (ASM is not implemented in C++) + test_cookie_value.py: irrelevant (ASM is not implemented in C++) + test_header_name.py: irrelevant (ASM is not implemented in C++) + test_header_value.py: irrelevant (ASM is not implemented in C++) + test_parameter_name.py: irrelevant (ASM is not implemented in C++) + test_parameter_value.py: irrelevant (ASM is not implemented in C++) + waf/: + test_addresses.py: irrelevant (ASM is not implemented in C++) + test_blocking.py: irrelevant (ASM is not implemented in C++) + test_custom_rules.py: irrelevant (ASM is not implemented in C++) + test_exclusions.py: irrelevant (ASM is not implemented in C++) + test_miscs.py: irrelevant (ASM is not implemented in C++) + test_reports.py: irrelevant (ASM is not implemented in C++) + test_rules.py: irrelevant (ASM is not implemented in C++) + test_telemetry.py: irrelevant (ASM is not implemented in C++) + test_PII.py: irrelevant (ASM is not implemented in C++) + test_alpha.py: irrelevant (ASM is not implemented in C++) + test_automated_login_events.py: irrelevant (ASM is not implemented in C++) + test_blocking_addresses.py: irrelevant (ASM is not implemented in C++) + test_conf.py: irrelevant (ASM is not implemented in C++) + test_customconf.py: irrelevant (ASM is not implemented in C++) + test_docs.py: irrelevant (ASM is not implemented in C++) + test_endpoint_ognl.py: irrelevant (ASM is not implemented in C++) + test_endpoint_sqli.py: irrelevant (ASM is not implemented in C++) + test_endpoint_ssrf.py: irrelevant (ASM is not implemented in C++) + test_event_tracking.py: irrelevant (ASM is not implemented in C++) + test_identify.py: irrelevant (ASM is not implemented in C++) + test_ip_blocking_full_denylist.py: irrelevant (ASM is not implemented in C++) + test_logs.py: irrelevant (ASM is not implemented in C++) + test_rate_limiter.py: irrelevant (ASM is not implemented in C++) + test_reports.py: irrelevant (ASM is not implemented in C++) + test_request_blocking.py: irrelevant (ASM is not implemented in C++) + test_runtime_activation.py: irrelevant (ASM is not implemented in C++) + test_traces.py: irrelevant (ASM is not implemented in C++) + test_user_blocking_full_denylist.py: irrelevant (ASM is not implemented in C++) + test_versions.py: irrelevant (ASM is not implemented in C++) + test_identify.py: irrelevant + test_scrubbing.py: irrelevant + test_standard_tags.py: irrelevant diff --git a/manifests/dotnet.yml b/manifests/dotnet.yml new file mode 100644 index 0000000000..9b73fe885a --- /dev/null +++ b/manifests/dotnet.yml @@ -0,0 +1,4 @@ +tests/: + appsec/: + test_alpha.py: + Test_Basic: "v1.28.6" diff --git a/manifests/golang.yml b/manifests/golang.yml new file mode 100644 index 0000000000..0d2b7889d6 --- /dev/null +++ b/manifests/golang.yml @@ -0,0 +1,8 @@ +tests/: + appsec/: + test_alpha.py: + Test_Basic: + "*": "v1.34.0" + chi: "v1.36.0" + echo: "v1.36.0" + gin: "v1.37.0" diff --git a/manifests/java.yml b/manifests/java.yml new file mode 100644 index 0000000000..07b4e4b86a --- /dev/null +++ b/manifests/java.yml @@ -0,0 +1,8 @@ +tests/: + appsec/: + test_alpha.py: + Test_Basic: + "*": "v0.87.0" + akka-http: missing_feature (No AppSec support) + spring-boot-3-native: missing_feature (GraalVM. Tracing support only) + spring-boot-payara: missing_feature (No AppSec support) \ No newline at end of file diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml new file mode 100644 index 0000000000..3bd5cfab27 --- /dev/null +++ b/manifests/nodejs.yml @@ -0,0 +1,4 @@ +tests/: + appsec/: + test_alpha.py: + Test_Basic: "v2.0.0" diff --git a/manifests/parser/core.py b/manifests/parser/core.py new file mode 100644 index 0000000000..125ac99fd8 --- /dev/null +++ b/manifests/parser/core.py @@ -0,0 +1,105 @@ +from functools import lru_cache +import json +import os + +from jsonschema import validate +import yaml + + +def _flatten(base, object): + if base.endswith(".py"): + base += "::" + for key, value in object.items(): + + if isinstance(value, str): + yield f"{base}{key}", value + elif isinstance(value, dict): + if base.endswith(".py::"): + yield f"{base}{key}", value + else: + yield from _flatten(f"{base}{key}", value) + + +def _load_file(file): + + try: + with open(file) as f: + data = yaml.safe_load(f) + except FileNotFoundError: + return {} + + return {nodeid: value for nodeid, value in _flatten("", data)} + + +def _filter_with_context(data, weblog_variant): + def resolve_value(value): + if isinstance(value, str): + return value + elif weblog_variant in value: + return value[weblog_variant] + elif "*" in value: + return value["*"] + else: + return None + + def fix_irrelevant_legacy(value: str): + # in JSON report, the marker for irrelevant is "not relevant", where the decorator is "irrelevant" + if value.startswith("irrelevant"): + return "not relevant" + value[len("irrelevant") :] + + return value + + # resolve weblogs dicts + result = {nodeid: resolve_value(value) for nodeid, value in data.items()} + + # filter nones, and fix irrelevant => not relevant + result = {nodeid: fix_irrelevant_legacy(value) for nodeid, value in result.items() if value is not None} + + return result + + +@lru_cache +def load(library, weblog_variant): + + result = _load_file(f"manifests/{library}.yml") + result = _filter_with_context(result, weblog_variant) + + return result + + +def assert_key_order(obj: dict, path=""): + last_key = "/" + + for key in obj: + if last_key.endswith("/") and not key.endswith("/"): # transition from folder fo files, nothing to do + pass + elif not last_key.endswith("/") and key.endswith("/"): # folder must be before files + raise ValueError("Folders must be placed before files at {path}") + else: # otherwise, it must be sorted + assert last_key < key, f"Order is not respcted at {path} ({last_key} < {key})" + + if isinstance(obj[key], dict): + assert_key_order(obj[key], f"{path}.{key}") + + last_key = key + + +def validate_manifest_files(): + with open("manifests/parser/schema.json") as f: + schema = json.load(f) + + for file in os.listdir("manifests/"): + if file.endswith(".yml"): + try: + with open(f"manifests/{file}") as f: + data = yaml.safe_load(f) + + validate(data, schema) + assert_key_order(data) + + except Exception as e: + raise ValueError(f"Fail to validate manifests/{file}") from e + + +if __name__ == "__main__": + validate_manifest_files() diff --git a/manifests/parser/schema.json b/manifests/parser/schema.json new file mode 100644 index 0000000000..6d60189976 --- /dev/null +++ b/manifests/parser/schema.json @@ -0,0 +1,70 @@ +{ + "type": "object", + + "properties": { + "tests/": { "$ref": "#/$defs/folder_content" } + }, + + "$defs": { + "folder_content": { + "type": "object", + "patternProperties": { + ".+/": { "$ref": "#/$defs/folder_content" }, + "test_.+\\.py": { "$ref": "#/$defs/file_content" } + } + }, + + "file_content": { + "allOf": [ + { + "if": { "type": "string" }, + "then": { "$ref": "#/$defs/skipped_declaration" } + }, + { + "if": { "type": "object" }, + "then": { "$ref": "#/$defs/classes_object" } + } + ] + }, + + "classes_object": { + "patternProperties": { + "Test_.+": { + "$comment": "Value can be a version number, a skip reason, or an object with weblog variant as keys", + "allOf": [ + { + "if": { "type": "string" }, + "then": { "$ref": "#/$defs/feature_state" } + }, + + { + "if": { "type": "object" }, + "then": { "$ref": "#/$defs/declaration_per_weblog" } + } + ] + } + } + }, + + "declaration_per_weblog": { + "$comment": "Keys are weblog variant names, values are version, or a skip reason", + "patternProperties": { + ".+": { "$ref": "#/$defs/feature_state" } + } + }, + + "feature_state": { + "oneOf": [ + { "$ref": "#/$defs/version" }, + { "$ref": "#/$defs/skipped_declaration" } + ] + }, + + "version": { "type": "string", "pattern": "v\\d.+" }, + + "skipped_declaration": { + "type": "string", + "pattern": "^(bug|flaky|irrelevant|missing_feature)( \\(.+\\))?$" + } + } +} diff --git a/manifests/python.yml b/manifests/python.yml new file mode 100644 index 0000000000..90018ff624 --- /dev/null +++ b/manifests/python.yml @@ -0,0 +1,4 @@ +tests/: + appsec/: + test_alpha.py: + Test_Basic: "v1.1.0rc2.dev" diff --git a/tests/appsec/api_security/test_schemas.py b/tests/appsec/api_security/test_schemas.py index 496ac6c6d5..6e85593d94 100644 --- a/tests/appsec/api_security/test_schemas.py +++ b/tests/appsec/api_security/test_schemas.py @@ -36,7 +36,6 @@ def equal_value(t1, t2): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", @@ -64,7 +63,6 @@ def test_request_method(self): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", @@ -94,7 +92,6 @@ def test_request_method(self): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", @@ -126,7 +123,6 @@ def test_request_method(self): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", @@ -153,7 +149,6 @@ def test_request_method(self): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", @@ -183,7 +178,7 @@ def test_request_method(self): @rfc("https://docs.google.com/document/d/1OCHPBCAErOL2FhLl64YAHB8woDyq66y5t-JGolxdf1Q/edit#heading=h.bth088vsbjrz") @released( - cpp="?", dotnet="?", golang="?", java="?", nodejs="?", php_appsec="?", python="?", ruby="?", + dotnet="?", golang="?", java="?", nodejs="?", php_appsec="?", python="?", ruby="?", ) @coverage.not_implemented @scenarios.appsec_api_security diff --git a/tests/appsec/iast/sink/test_command_injection.py b/tests/appsec/iast/sink/test_command_injection.py index 52f51e44da..e7299e0f4d 100644 --- a/tests/appsec/iast/sink/test_command_injection.py +++ b/tests/appsec/iast/sink/test_command_injection.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="?", ruby="?") diff --git a/tests/appsec/iast/sink/test_insecure_cookie.py b/tests/appsec/iast/sink/test_insecure_cookie.py index 25296dffca..535ffa760f 100644 --- a/tests/appsec/iast/sink/test_insecure_cookie.py +++ b/tests/appsec/iast/sink/test_insecure_cookie.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, missing_feature, bug from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="1.18.0", ruby="?") diff --git a/tests/appsec/iast/sink/test_ldap_injection.py b/tests/appsec/iast/sink/test_ldap_injection.py index 099280c4c4..3563e880eb 100644 --- a/tests/appsec/iast/sink/test_ldap_injection.py +++ b/tests/appsec/iast/sink/test_ldap_injection.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", python="?", ruby="?") diff --git a/tests/appsec/iast/sink/test_no_httponly_cookie.py b/tests/appsec/iast/sink/test_no_httponly_cookie.py index 1d706ec00c..985df668d9 100644 --- a/tests/appsec/iast/sink/test_no_httponly_cookie.py +++ b/tests/appsec/iast/sink/test_no_httponly_cookie.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature, bug from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="1.18.0", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/sink/test_no_samesite_cookie.py b/tests/appsec/iast/sink/test_no_samesite_cookie.py index 8a5ec0ae30..70ee83b711 100644 --- a/tests/appsec/iast/sink/test_no_samesite_cookie.py +++ b/tests/appsec/iast/sink/test_no_samesite_cookie.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature, bug from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="1.18.0", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/sink/test_path_traversal.py b/tests/appsec/iast/sink/test_path_traversal.py index 95d4b4bc80..3e58b2e8c5 100644 --- a/tests/appsec/iast/sink/test_path_traversal.py +++ b/tests/appsec/iast/sink/test_path_traversal.py @@ -1,13 +1,10 @@ # Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest + from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="?", ruby="?") diff --git a/tests/appsec/iast/sink/test_sql_injection.py b/tests/appsec/iast/sink/test_sql_injection.py index 9ebd466036..e73a31ecf7 100644 --- a/tests/appsec/iast/sink/test_sql_injection.py +++ b/tests/appsec/iast/sink/test_sql_injection.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", ruby="?") diff --git a/tests/appsec/iast/sink/test_ssrf.py b/tests/appsec/iast/sink/test_ssrf.py index 8911843db7..d9edf158f9 100644 --- a/tests/appsec/iast/sink/test_ssrf.py +++ b/tests/appsec/iast/sink/test_ssrf.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", java="1.14.0", golang="?", php_appsec="?", python="?", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/sink/test_trust_boundary_violation.py b/tests/appsec/iast/sink/test_trust_boundary_violation.py index 54e48897eb..4a5e094929 100644 --- a/tests/appsec/iast/sink/test_trust_boundary_violation.py +++ b/tests/appsec/iast/sink/test_trust_boundary_violation.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="?", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/sink/test_unvalidated_redirect.py b/tests/appsec/iast/sink/test_unvalidated_redirect.py index 823f22ab80..d91962651c 100644 --- a/tests/appsec/iast/sink/test_unvalidated_redirect.py +++ b/tests/appsec/iast/sink/test_unvalidated_redirect.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, irrelevant, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - def _expected_location(): if context.library.library == "java": diff --git a/tests/appsec/iast/sink/test_unvalidated_redirect_forward.py b/tests/appsec/iast/sink/test_unvalidated_redirect_forward.py index 4d002d11b3..97de04af3a 100644 --- a/tests/appsec/iast/sink/test_unvalidated_redirect_forward.py +++ b/tests/appsec/iast/sink/test_unvalidated_redirect_forward.py @@ -6,9 +6,6 @@ from utils import context, coverage, released, missing_feature, irrelevant from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - def _expected_location(): if context.library.library == "java": diff --git a/tests/appsec/iast/sink/test_weak_cipher.py b/tests/appsec/iast/sink/test_weak_cipher.py index 1dfccf396c..f4bd1bb4b6 100644 --- a/tests/appsec/iast/sink/test_weak_cipher.py +++ b/tests/appsec/iast/sink/test_weak_cipher.py @@ -1,13 +1,9 @@ # Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, missing_feature, coverage, released, flaky from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", java="0.108.0", php_appsec="?", python="1.7.0", ruby="?") diff --git a/tests/appsec/iast/sink/test_weak_hash.py b/tests/appsec/iast/sink/test_weak_hash.py index a67696cd6e..81cf4080e1 100644 --- a/tests/appsec/iast/sink/test_weak_hash.py +++ b/tests/appsec/iast/sink/test_weak_hash.py @@ -1,13 +1,10 @@ # Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest + from utils import weblog, interfaces, context, bug, missing_feature, coverage, released from .._test_iast_fixtures import SinkFixture, get_iast_event, assert_iast_vulnerability -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - def _expected_location(): if context.library.library == "java": diff --git a/tests/appsec/iast/sink/test_weak_randomness.py b/tests/appsec/iast/sink/test_weak_randomness.py index 65aa73782f..f71b4c42d9 100644 --- a/tests/appsec/iast/sink/test_weak_randomness.py +++ b/tests/appsec/iast/sink/test_weak_randomness.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, missing_feature from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", java="1.15.0", php_appsec="?", python="?", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/sink/test_xpath_injection.py b/tests/appsec/iast/sink/test_xpath_injection.py index bd72af6fe9..2b6f678818 100644 --- a/tests/appsec/iast/sink/test_xpath_injection.py +++ b/tests/appsec/iast/sink/test_xpath_injection.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released from .._test_iast_fixtures import SinkFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="?", ruby="?", nodejs="?") diff --git a/tests/appsec/iast/source/test_body.py b/tests/appsec/iast/source/test_body.py index 905dbc5c76..3d58f6eb5c 100644 --- a/tests/appsec/iast/source/test_body.py +++ b/tests/appsec/iast/source/test_body.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, missing_feature, bug from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", ruby="?") diff --git a/tests/appsec/iast/source/test_cookie_name.py b/tests/appsec/iast/source/test_cookie_name.py index c4b09c8ceb..43c4e384e5 100644 --- a/tests/appsec/iast/source/test_cookie_name.py +++ b/tests/appsec/iast/source/test_cookie_name.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, bug, missing_feature from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", python="1.18.0", ruby="?") diff --git a/tests/appsec/iast/source/test_cookie_value.py b/tests/appsec/iast/source/test_cookie_value.py index dd681058eb..ea2ef7dfb3 100644 --- a/tests/appsec/iast/source/test_cookie_value.py +++ b/tests/appsec/iast/source/test_cookie_value.py @@ -2,15 +2,10 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, bug, missing_feature from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", python="1.18.0", ruby="?") @released( diff --git a/tests/appsec/iast/source/test_header_name.py b/tests/appsec/iast/source/test_header_name.py index 061aa46144..cb6d67ed2d 100644 --- a/tests/appsec/iast/source/test_header_name.py +++ b/tests/appsec/iast/source/test_header_name.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, released, bug, missing_feature from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", python="1.18.0", ruby="?") diff --git a/tests/appsec/iast/source/test_header_value.py b/tests/appsec/iast/source/test_header_value.py index a3a2f03b2f..fdb3f2acc0 100644 --- a/tests/appsec/iast/source/test_header_value.py +++ b/tests/appsec/iast/source/test_header_value.py @@ -2,14 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. - -import pytest from utils import context, coverage, released, bug, missing_feature from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", python="1.18.0", ruby="?") diff --git a/tests/appsec/iast/source/test_parameter_name.py b/tests/appsec/iast/source/test_parameter_name.py index 5c1f48432a..678db6764d 100644 --- a/tests/appsec/iast/source/test_parameter_name.py +++ b/tests/appsec/iast/source/test_parameter_name.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, missing_feature, released, bug from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", nodejs="?", php_appsec="?", ruby="?") diff --git a/tests/appsec/iast/source/test_parameter_value.py b/tests/appsec/iast/source/test_parameter_value.py index 980b510d97..90d76af4a6 100644 --- a/tests/appsec/iast/source/test_parameter_value.py +++ b/tests/appsec/iast/source/test_parameter_value.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, coverage, missing_feature, released, bug from .._test_iast_fixtures import SourceFixture -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @coverage.basic @released(dotnet="?", golang="?", php_appsec="?", python="1.18.0", ruby="?") diff --git a/tests/appsec/test_PII.py b/tests/appsec/test_PII.py index 698f7f188b..aa4cf03861 100644 --- a/tests/appsec/test_PII.py +++ b/tests/appsec/test_PII.py @@ -2,15 +2,10 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from utils import context, released, coverage -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - - @released(golang="?", dotnet="?", java="?", nodejs="?", php="?", python="?", ruby="?") @coverage.not_implemented class Test_Scrubbing: diff --git a/tests/appsec/test_alpha.py b/tests/appsec/test_alpha.py index ec11354252..3ff0854659 100644 --- a/tests/appsec/test_alpha.py +++ b/tests/appsec/test_alpha.py @@ -2,21 +2,11 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. - -import pytest - from utils import context, weblog, interfaces, released, missing_feature, bug, coverage -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - -@released(golang={"gin": "1.37.0", "echo": "1.36.0", "chi": "1.36.0", "*": "1.34.0"}) -@released(dotnet="1.28.6", java="0.87.0", nodejs="2.0.0", php_appsec="0.2.1", python="1.1.0rc2.dev") +@released(php_appsec="0.2.1") @missing_feature(context.library == "ruby" and context.libddwaf_version is None) -@missing_feature(weblog_variant="akka-http", reason="No AppSec support") -@missing_feature(weblog_variant="spring-boot-payara", reason="No AppSec support") -@missing_feature(weblog_variant="spring-boot-3-native", reason="GraalVM. Tracing support only") @coverage.basic class Test_Basic: """ Detect attacks on raw URI and headers with default rules """ diff --git a/tests/appsec/test_automated_login_events.py b/tests/appsec/test_automated_login_events.py index 5c76c57223..67a6f21db5 100644 --- a/tests/appsec/test_automated_login_events.py +++ b/tests/appsec/test_automated_login_events.py @@ -7,7 +7,7 @@ @rfc("https://docs.google.com/document/d/1-trUpphvyZY7k5ldjhW-MgqWl0xOm7AMEQDJEAZ63_Q/edit#heading=h.8d3o7vtyu1y1") @coverage.good -@released(cpp="?", golang="?", java="?", nodejs="4.4.0", dotnet="2.32.0", php="0.89.0", python="?", ruby="?") +@released(golang="?", java="?", nodejs="4.4.0", dotnet="2.32.0", php="0.89.0", python="?", ruby="?") @missing_feature( weblog_variant="rails32", reason="Not able to configure weblog variant properly. Issue with SQLite and PRIMARY_KEY as String and Rails 3 protected attributes", @@ -264,7 +264,7 @@ def test_login_sdk_failure_basic(self): @rfc("https://docs.google.com/document/d/1-trUpphvyZY7k5ldjhW-MgqWl0xOm7AMEQDJEAZ63_Q/edit#heading=h.8d3o7vtyu1y1") @coverage.good @scenarios.appsec_auto_events_extended -@released(cpp="?", golang="?", java="?", nodejs="4.4.0", dotnet="2.33.0", php="0.89.0", python="?", ruby="?") +@released(golang="?", java="?", nodejs="4.4.0", dotnet="2.33.0", php="0.89.0", python="?", ruby="?") @missing_feature( weblog_variant="rails32", reason="Not able to configure weblog variant properly. Issue with SQLite and PRIMARY_KEY as String and Rails 3 protected attributes", diff --git a/tests/appsec/test_blocking_addresses.py b/tests/appsec/test_blocking_addresses.py index c31c42dffa..002b55b95f 100644 --- a/tests/appsec/test_blocking_addresses.py +++ b/tests/appsec/test_blocking_addresses.py @@ -34,7 +34,6 @@ @released( - cpp="?", dotnet="2.27.0", php_appsec="0.7.0", python={"django-poc": "1.10", "flask-poc": "1.10", "*": "1.16.1"}, @@ -231,7 +230,6 @@ def wrapper(span): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="1.51.0", nodejs="3.19.0", @@ -282,7 +280,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.32.0", golang="1.51.0", nodejs="3.19.0", @@ -343,7 +340,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="1.51.0", java="1.15.0", @@ -398,7 +394,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="1.51.0", nodejs="3.19.0", @@ -455,7 +450,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="1.51.0", nodejs="3.19.0", @@ -512,7 +506,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="1.51.0", nodejs="?", @@ -569,7 +562,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.29.0", golang="?", java="1.15.0", @@ -641,7 +633,6 @@ def test_blocking_before(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.32.0", golang="?", java="?", @@ -679,7 +670,6 @@ def test_non_blocking(self): @scenarios.appsec_blocking @coverage.good @released( - cpp="?", dotnet="2.32.0", golang="?", java="?", @@ -717,7 +707,7 @@ def test_non_blocking(self): @rfc("https://datadoghq.atlassian.net/wiki/spaces/APS/pages/2667021177/Suspicious+requests+blocking") @coverage.not_implemented -@released(cpp="?", dotnet="2.29.0", php_appsec="0.7.0", python="?", nodejs="3.19.0", golang="?", ruby="1.0.0") +@released(dotnet="2.29.0", php_appsec="0.7.0", python="?", nodejs="3.19.0", golang="?", ruby="1.0.0") class Test_Suspicious_Request_Blocking: """Test if blocking on multiple addresses with multiple rules is supported""" diff --git a/tests/appsec/test_client_ip.py b/tests/appsec/test_client_ip.py index 617f7c2fa4..4feeb3214e 100644 --- a/tests/appsec/test_client_ip.py +++ b/tests/appsec/test_client_ip.py @@ -2,13 +2,8 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2022 Datadog, Inc. -import pytest - from utils import weblog, context, coverage, interfaces, released, scenarios -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @released(dotnet="2.20.0", golang="1.44.1", java="0.114.0") @released(nodejs="3.6.0", php="0.81.0", python="1.5.0", ruby="1.8.0") diff --git a/tests/appsec/test_conf.py b/tests/appsec/test_conf.py index d1290188c8..74b99f35ad 100644 --- a/tests/appsec/test_conf.py +++ b/tests/appsec/test_conf.py @@ -3,14 +3,11 @@ # Copyright 2021 Datadog, Inc. import pytest + from utils import weblog, context, coverage, interfaces, released, missing_feature, irrelevant, rfc, scenarios from tests.constants import PYTHON_RELEASE_GA_1_1 from .waf.utils import rules - -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/test_customconf.py b/tests/appsec/test_customconf.py index c642f46658..673a4eec3a 100644 --- a/tests/appsec/test_customconf.py +++ b/tests/appsec/test_customconf.py @@ -6,9 +6,6 @@ from utils import weblog, context, coverage, interfaces, released, bug, missing_feature, scenarios -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant == "akka-http": pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/test_docs.py b/tests/appsec/test_docs.py index 531b452c1d..5eb07ea8a5 100644 --- a/tests/appsec/test_docs.py +++ b/tests/appsec/test_docs.py @@ -2,15 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. - -import pytest from utils import coverage, context, released, missing_feature -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - - @released(python="1.4.2") @missing_feature(context.weblog_variant == "spring-boot-3-native", reason="GraalVM. Tracing support only") @coverage.not_testable diff --git a/tests/appsec/test_event_tracking.py b/tests/appsec/test_event_tracking.py index d0eae47b53..ae13792b2b 100644 --- a/tests/appsec/test_event_tracking.py +++ b/tests/appsec/test_event_tracking.py @@ -7,9 +7,6 @@ from utils import weblog, context, coverage, interfaces, released, irrelevant -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant == "spring-boot-payara": pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/test_identify.py b/tests/appsec/test_identify.py index d30c7ad3c0..c73c21d698 100644 --- a/tests/appsec/test_identify.py +++ b/tests/appsec/test_identify.py @@ -2,14 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest - from tests.constants import PYTHON_RELEASE_GA_1_1 from utils import weblog, context, coverage, interfaces, released -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @released(dotnet="2.7.0", golang="1.37.0", java="?", nodejs="2.4.0") @released(php="0.85.0", python=PYTHON_RELEASE_GA_1_1, ruby="1.0.0") diff --git a/tests/appsec/test_ip_blocking_full_denylist.py b/tests/appsec/test_ip_blocking_full_denylist.py index 0216561afc..adbcbd2a92 100644 --- a/tests/appsec/test_ip_blocking_full_denylist.py +++ b/tests/appsec/test_ip_blocking_full_denylist.py @@ -12,9 +12,7 @@ @rfc("https://docs.google.com/document/d/1GUd8p7HBp9gP0a6PZmDY26dpGrS1Ztef9OYdbK3Vq3M/edit") -@released( - cpp="?", dotnet="2.16.0", php_appsec="0.7.0", python="1.10.0", ruby="1.11.0", nodejs="3.11.0", golang="1.47.0" -) +@released(dotnet="2.16.0", php_appsec="0.7.0", python="1.10.0", ruby="1.11.0", nodejs="3.11.0", golang="1.47.0") @released( java={ "spring-boot": "0.110.0", diff --git a/tests/appsec/test_logs.py b/tests/appsec/test_logs.py index 7031e1b0fe..2dd2008c04 100644 --- a/tests/appsec/test_logs.py +++ b/tests/appsec/test_logs.py @@ -6,9 +6,6 @@ from utils import weblog, context, interfaces, released, irrelevant, missing_feature, bug, coverage -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/test_rate_limiter.py b/tests/appsec/test_rate_limiter.py index b9611ca680..f9244dff99 100644 --- a/tests/appsec/test_rate_limiter.py +++ b/tests/appsec/test_rate_limiter.py @@ -9,8 +9,6 @@ from utils import weblog, context, coverage, interfaces, released, rfc, bug, scenarios, missing_feature, flaky from utils.tools import logger -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") if context.weblog_variant == "akka-http": pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/test_reports.py b/tests/appsec/test_reports.py index afa9e8e435..5b551d6584 100644 --- a/tests/appsec/test_reports.py +++ b/tests/appsec/test_reports.py @@ -4,7 +4,6 @@ import socket -import pytest from utils import ( weblog, @@ -20,9 +19,6 @@ from tests.constants import PYTHON_RELEASE_GA_1_1 -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @released(dotnet="1.28.6", java="0.92.0", nodejs="2.0.0", php_appsec="0.1.0", python="1.1.0rc2.dev") @released(golang={"gin": "1.37.0", "echo": "1.36.0", "*": "1.34.0"}) diff --git a/tests/appsec/test_request_blocking.py b/tests/appsec/test_request_blocking.py index 86b26753ed..f216c57d1b 100644 --- a/tests/appsec/test_request_blocking.py +++ b/tests/appsec/test_request_blocking.py @@ -10,7 +10,7 @@ EXPECTED_REQUESTS = json.load(f) -@released(cpp="?", dotnet="2.25.0", php_appsec="0.7.0", python="1.10.0", ruby="1.11.1", nodejs="3.19.0") +@released(dotnet="2.25.0", php_appsec="0.7.0", python="1.10.0", ruby="1.11.1", nodejs="3.19.0") @released( java={ "spring-boot": "1.9.0", diff --git a/tests/appsec/test_runtime_activation.py b/tests/appsec/test_runtime_activation.py index 3bd7e6ef93..2bfc3df2f6 100644 --- a/tests/appsec/test_runtime_activation.py +++ b/tests/appsec/test_runtime_activation.py @@ -16,9 +16,7 @@ @scenarios.appsec_runtime_activation -@released( - java="0.115.0", cpp="?", dotnet="2.16.0", php_appsec="0.7.0", python="?", ruby="?", nodejs="3.9.0", golang="?" -) +@released(java="0.115.0", dotnet="2.16.0", php_appsec="0.7.0", python="?", ruby="?", nodejs="3.9.0", golang="?") @bug( context.library < "java@1.8.0" and context.appsec_rules_file is not None, reason="ASM_FEATURES was not subscribed when a custom rules file was present", diff --git a/tests/appsec/test_traces.py b/tests/appsec/test_traces.py index 23b63dab4b..79f25b1cea 100644 --- a/tests/appsec/test_traces.py +++ b/tests/appsec/test_traces.py @@ -2,7 +2,6 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest from tests.constants import PYTHON_RELEASE_PUBLIC_BETA, PYTHON_RELEASE_GA_1_1 from utils import ( weblog, @@ -17,8 +16,6 @@ scenarios, ) -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") RUNTIME_FAMILIES = ["nodejs", "ruby", "jvm", "dotnet", "go", "php", "python"] diff --git a/tests/appsec/test_user_blocking_full_denylist.py b/tests/appsec/test_user_blocking_full_denylist.py index bbef882508..f55379fb65 100644 --- a/tests/appsec/test_user_blocking_full_denylist.py +++ b/tests/appsec/test_user_blocking_full_denylist.py @@ -2,7 +2,6 @@ @released( - cpp="?", dotnet="2.30.0", golang="1.48.0", java={ diff --git a/tests/appsec/waf/test_addresses.py b/tests/appsec/waf/test_addresses.py index 30af11a3df..586ee48e8b 100644 --- a/tests/appsec/waf/test_addresses.py +++ b/tests/appsec/waf/test_addresses.py @@ -2,7 +2,6 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. - import pytest from tests.constants import PYTHON_RELEASE_GA_1_1, PYTHON_RELEASE_PUBLIC_BETA @@ -20,9 +19,6 @@ scenarios, ) -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/waf/test_blocking.py b/tests/appsec/waf/test_blocking.py index 30bc7af4c6..35a9a924d8 100644 --- a/tests/appsec/waf/test_blocking.py +++ b/tests/appsec/waf/test_blocking.py @@ -5,9 +5,6 @@ from utils import released, coverage, interfaces, bug, scenarios, weblog, rfc, missing_feature, flaky from utils._context.core import context -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/waf/test_custom_rules.py b/tests/appsec/waf/test_custom_rules.py index 950e1f1ca1..d0cc0dd9fe 100644 --- a/tests/appsec/waf/test_custom_rules.py +++ b/tests/appsec/waf/test_custom_rules.py @@ -9,7 +9,6 @@ php_appsec="0.8.1", python={"django-poc": "1.12", "flask-poc": "1.12", "*": "1.16.1"}, ruby="1.12.0", - cpp="?", ) @scenarios.appsec_custom_rules class Test_CustomRules: diff --git a/tests/appsec/waf/test_exclusions.py b/tests/appsec/waf/test_exclusions.py index 0030fae8bf..23e83e0130 100644 --- a/tests/appsec/waf/test_exclusions.py +++ b/tests/appsec/waf/test_exclusions.py @@ -13,7 +13,6 @@ php_appsec="0.7.0", python={"django-poc": "1.12", "flask-poc": "1.12", "*": "1.16.1"}, ruby="1.11.0", - cpp="?", ) @missing_feature(context.weblog_variant == "spring-boot-3-native", reason="GraalVM. Tracing support only") @scenarios.appsec_custom_rules diff --git a/tests/appsec/waf/test_miscs.py b/tests/appsec/waf/test_miscs.py index b18baa7657..cb9db95e67 100644 --- a/tests/appsec/waf/test_miscs.py +++ b/tests/appsec/waf/test_miscs.py @@ -7,10 +7,6 @@ from utils import context, weblog, interfaces, released, bug, coverage, missing_feature from .utils import rules - -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/waf/test_reports.py b/tests/appsec/waf/test_reports.py index a532e9f1a6..1f96e58535 100644 --- a/tests/appsec/waf/test_reports.py +++ b/tests/appsec/waf/test_reports.py @@ -9,10 +9,6 @@ from tests.constants import PYTHON_RELEASE_GA_1_1 from utils import weblog, context, interfaces, released, irrelevant, coverage, scenarios, missing_feature - -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/waf/test_rules.py b/tests/appsec/waf/test_rules.py index dc586a553e..e4ba42329a 100644 --- a/tests/appsec/waf/test_rules.py +++ b/tests/appsec/waf/test_rules.py @@ -9,10 +9,6 @@ from utils import context, weblog, interfaces, released, bug, missing_feature, irrelevant, flaky, coverage from .utils import rules - -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - if context.weblog_variant in ("akka-http", "spring-boot-payara"): pytestmark = pytest.mark.skip("missing feature: No AppSec support") diff --git a/tests/appsec/waf/test_telemetry.py b/tests/appsec/waf/test_telemetry.py index 0f2a11967b..ed11d3189f 100644 --- a/tests/appsec/waf/test_telemetry.py +++ b/tests/appsec/waf/test_telemetry.py @@ -41,7 +41,7 @@ def test_all_telemetry_requests_are_successful(self): @rfc("https://docs.google.com/document/d/1qBDsS_ZKeov226CPx2DneolxaARd66hUJJ5Lh9wjhlE") -@released(python="1.14.0", cpp="?", golang="?", java="1.12.0", dotnet="?", nodejs="?", php="?", ruby="?") +@released(python="1.14.0", golang="?", java="1.12.0", dotnet="?", nodejs="?", php="?", ruby="?") @missing_feature(context.weblog_variant == "spring-boot-3-native", reason="GraalVM. Tracing support only") @scenarios.appsec_waf_telemetry class Test_TelemetryMetrics: diff --git a/tests/test_identify.py b/tests/test_identify.py index 84edc38d08..4f0fd9e024 100644 --- a/tests/test_identify.py +++ b/tests/test_identify.py @@ -2,14 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2021 Datadog, Inc. -import pytest - from tests.constants import PYTHON_RELEASE_GA_1_1 from utils import weblog, bug, context, coverage, interfaces, released, rfc -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - def assertTagInSpanMeta(span, tag, expected): if tag not in span["meta"]: diff --git a/tests/test_scrubbing.py b/tests/test_scrubbing.py index ebe6f0cdf2..b5c72f0b49 100644 --- a/tests/test_scrubbing.py +++ b/tests/test_scrubbing.py @@ -3,13 +3,9 @@ # Copyright 2022 Datadog, Inc. import re -import pytest from utils import bug, context, coverage, interfaces, released, rfc, weblog, missing_feature from utils.tools import logger -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - def validate_no_leak(needle, whitelist_pattern=None): diff --git a/tests/test_standard_tags.py b/tests/test_standard_tags.py index a96267bd71..e0716b39d1 100644 --- a/tests/test_standard_tags.py +++ b/tests/test_standard_tags.py @@ -2,13 +2,9 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2022 Datadog, Inc. -import pytest from tests.constants import PYTHON_RELEASE_GA_1_1, PYTHON_RELEASE_PUBLIC_BETA from utils import bug, context, coverage, interfaces, irrelevant, released, rfc, weblog, missing_feature -if context.library == "cpp": - pytestmark = pytest.mark.skip("not relevant") - @released(dotnet="2.0.0", golang="1.39.0", java="0.102.0", nodejs="2.11.0", php="0.75.0", python="1.2.1", ruby="1.8.0") @coverage.good diff --git a/tests/test_the_test/test_manifest.py b/tests/test_the_test/test_manifest.py new file mode 100644 index 0000000000..3a67ec71b1 --- /dev/null +++ b/tests/test_the_test/test_manifest.py @@ -0,0 +1,8 @@ +from manifests.parser.core import validate_manifest_files + +from utils import scenarios + + +@scenarios.test_the_test +def test_fornats(): + validate_manifest_files()