diff --git a/manifests/golang.yml b/manifests/golang.yml index 9ff795850c..f81a30d4db 100644 --- a/manifests/golang.yml +++ b/manifests/golang.yml @@ -365,6 +365,8 @@ tests/: Test_RemoteConfigurationUpdateSequenceFeaturesNoCache: irrelevant (cache is implemented) Test_RemoteConfigurationUpdateSequenceLiveDebugging: missing_feature Test_RemoteConfigurationUpdateSequenceLiveDebuggingNoCache: irrelevant (cache is implemented) + test_data_integrity.py: + Test_LibraryHeaders: missing_feature (Datadog-Container-ID is empty on telemetry payloads) test_distributed.py: Test_DistributedHttp: missing_feature test_identify.py: diff --git a/tests/test_data_integrity.py b/tests/test_data_integrity.py index 6da9c1ce75..8e7c93c3d1 100644 --- a/tests/test_data_integrity.py +++ b/tests/test_data_integrity.py @@ -3,7 +3,7 @@ # Copyright 2021 Datadog, Inc. """Misc checks around data integrity during components' lifetime""" -from utils import weblog, interfaces, context, bug, rfc, scenarios, missing_feature +from utils import weblog, interfaces, context, bug, rfc, missing_feature from utils.tools import logger from utils.cgroup_info import get_container_id @@ -41,7 +41,7 @@ def check_condition(data): ) def test_trace_header_diagnostic_check(self): - """ x-datadog-diagnostic-check header is present iif content is empty """ + """x-datadog-diagnostic-check header is present iif content is empty""" def validator(data): request_headers = {h[0].lower() for h in data["request"]["headers"]} @@ -91,7 +91,6 @@ def test_trace_header_container_tags(self): logger.info(f"cgroup: weblog container id is {weblog_container_id}") def validator(data): - if "content" not in data["request"] or not data["request"]["content"]: # RFC states "Once container ID is stored locally in the tracer, # it must be sent to the Agent every time traces are sent." @@ -121,3 +120,17 @@ def validator(data): ) interfaces.library.add_traces_validation(validator, success_by_default=True) + + +class Test_LibraryHeaders: + """Misc test around headers sent by libraries""" + + def test_datadog_container_id(self): + """Datadog-Container-ID header is not empty if present""" + + def validator(data): + for header, value in data["request"]["headers"]: + if header.lower() == "datadog-container-id": + assert value, "Datadog-Container-ID header is empty" + + interfaces.library.validate(validator, success_by_default=True)