diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 21ca3a5723b..643a2ec990e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,14 @@ onboarding_tests_installer: onboarding_tests_k8s_injection: parallel: matrix: - - WEBLOG_VARIANT: [dd-lib-python-init-test-django, dd-lib-python-init-test-django-gunicorn, dd-lib-python-init-test-django-uvicorn, dd-lib-python-init-test-protobuf-old] + - WEBLOG_VARIANT: + - dd-lib-python-init-test-django + - dd-lib-python-init-test-django-gunicorn + - dd-lib-python-init-test-django-gunicorn-alpine + - dd-lib-python-init-test-django-preinstalled + - dd-lib-python-init-test-django-unsupported-package-force + - dd-lib-python-init-test-django-uvicorn + - dd-lib-python-init-test-protobuf-old deploy_to_di_backend:manual: stage: shared-pipeline diff --git a/tests/.suitespec.json b/tests/.suitespec.json index ed5e90189d9..773e41b366d 100644 --- a/tests/.suitespec.json +++ b/tests/.suitespec.json @@ -23,17 +23,7 @@ "tests/subprocesstest.py", "tests/wait-for-services.py", "tests/webclient.py", - "tests/test_module/*", - "tests/lib-injection/dd-lib-python-init-test-django/*", - "tests/lib-injection/dd-lib-python-init-test-django-gunicorn/*", - "tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/*", - "tests/lib-injection/dd-lib-python-init-test-django-no-perms/*", - "tests/lib-injection/dd-lib-python-init-test-django-pre-installed/*", - "tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/*", - "tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/*", - "tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/*", - "tests/lib-injection/dd-lib-python-init-test-django-uvicorn/*", - "tests/lib-injection/dd-lib-python-init-test-protobuf-old/*" + "tests/test_module/*" ], "core": [ "ddtrace/internal/__init__.py", diff --git a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/Dockerfile deleted file mode 100644 index 2f1d001ac57..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.10-alpine - -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.1.3 gunicorn==20.1.0 -CMD gunicorn --bind :18080 django_app:application diff --git a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/django_app.py deleted file mode 100644 index d25a658e4b1..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/django_app.py +++ /dev/null @@ -1,26 +0,0 @@ -import logging -import os - -from django.core.wsgi import get_wsgi_application -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] - -application = get_wsgi_application() diff --git a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/Dockerfile deleted file mode 100644 index 7570dd13cc5..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.10 - -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.1.3 gunicorn==20.1.0 -CMD gunicorn --bind :18080 django_app:application diff --git a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/django_app.py deleted file mode 100644 index d25a658e4b1..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-gunicorn/django_app.py +++ /dev/null @@ -1,26 +0,0 @@ -import logging -import os - -from django.core.wsgi import get_wsgi_application -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] - -application = get_wsgi_application() diff --git a/tests/lib-injection/dd-lib-python-init-test-django-no-perms/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-no-perms/Dockerfile deleted file mode 100644 index 9e8ba28f7b9..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-no-perms/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.11 - -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.1.3 - -# Many users run a non-root user, ensure this is supported by the injection mechanism -USER 1000 -CMD python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-no-perms/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-no-perms/django_app.py deleted file mode 100644 index a563e549e91..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-no-perms/django_app.py +++ /dev/null @@ -1,23 +0,0 @@ -import logging -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/Dockerfile deleted file mode 100644 index 0355178185f..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM python:3.9 - -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 - -# Install ddtrace beforehand to ensure it doesn't get overridden. -RUN pip install django==4.1.3 ddtrace==1.12.0 - -# Many users run a non-root user, ensure this is supported by the injection mechanism -USER 1000 -CMD ddtrace-run python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/django_app.py deleted file mode 100644 index d83d49cd18f..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-pre-installed/django_app.py +++ /dev/null @@ -1,32 +0,0 @@ -import logging -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - import ddtrace - - if ddtrace.__version__ != "1.12.0": - print( - "Assertion failure: unexpected ddtrace version received. Got %r when expecting '1.12.0'" - % ddtrace.__version__ - ) - # Hard exit so traces aren't flushed. - os._exit(1) - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/Dockerfile deleted file mode 100644 index 0d62d4e2555..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM python:3.11 - -ENV PYTHONUNBUFFERED 1 -ENV DD_INJECT_FORCE 1 -ENV DD_TRACE_DEBUG 1 -ENV DD_PROFILING_ENABLED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.1.3 structlog==16.0.0 - -CMD python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/django_app.py deleted file mode 100644 index b73bf3b8782..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/django_app.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - - -def index(request): - import ddtrace - - if ddtrace.__version__ != "2.6.3": - print( - "Assertion failure: unexpected ddtrace version received. Got %r when expecting '2.6.3'" - % ddtrace.__version__ - ) - # Hard exit so traces aren't flushed and the test will fail. - os._exit(1) - - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/validate_telemetry.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/validate_telemetry.py deleted file mode 100644 index 3a8680b49b0..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/validate_telemetry.py +++ /dev/null @@ -1,10 +0,0 @@ -import json -import sys - - -in_text = sys.stdin.read() -print(in_text) -parsed = json.loads(in_text.split("\t")[-1]) -print(parsed) -assert len(parsed["points"]) == 1 -assert parsed["points"][0] == {"name": "library_entrypoint.complete", "tags": ["injection_forced:true"]} diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/Dockerfile deleted file mode 100644 index 1ed8aa4aca9..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.7 - -ENV PYTHONUNBUFFERED 1 -ENV DD_TRACE_DEBUG 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==3.2 falcon==2.0.0 - -CMD python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/django_app.py deleted file mode 100644 index 783bd0bbd19..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/django_app.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - - -def index(request): - import ddtrace - - if ddtrace.__version__ != "1.12.0": - print( - "Assertion failure: unexpected ddtrace version received. Got %r when expecting '1.12.0'" - % ddtrace.__version__ - ) - # Hard exit so traces aren't flushed and the test will fail. - os._exit(1) - - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/validate_telemetry.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/validate_telemetry.py deleted file mode 100644 index 23f361a7424..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/validate_telemetry.py +++ /dev/null @@ -1,11 +0,0 @@ -import json -import sys - - -in_text = sys.stdin.read() -print(in_text) -parsed = json.loads(in_text.split("\t")[-1]) -print(parsed) -assert len(parsed["points"]) == 2 -assert {"name": "library_entrypoint.abort", "tags": ["reason:integration"]} in parsed["points"] -assert len([a for a in parsed["points"] if a["name"] == "library_entrypoint.abort.integration"]) == 1 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/Dockerfile deleted file mode 100644 index 1a605d21ae7..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.6 - -ENV PYTHONUNBUFFERED 1 -ENV DD_TRACE_DEBUG 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==3.2 - -CMD python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/django_app.py deleted file mode 100644 index 783bd0bbd19..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/django_app.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - - -def index(request): - import ddtrace - - if ddtrace.__version__ != "1.12.0": - print( - "Assertion failure: unexpected ddtrace version received. Got %r when expecting '1.12.0'" - % ddtrace.__version__ - ) - # Hard exit so traces aren't flushed and the test will fail. - os._exit(1) - - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/validate_telemetry.py b/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/validate_telemetry.py deleted file mode 100644 index 284fc27f285..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/validate_telemetry.py +++ /dev/null @@ -1,11 +0,0 @@ -import json -import sys - - -in_text = sys.stdin.read() -print(in_text) -parsed = json.loads(in_text.split("\t")[-1]) -print(parsed) -assert len(parsed["points"]) == 2 -assert {"name": "library_entrypoint.abort", "tags": ["reason:incompatible_runtime"]} in parsed["points"] -assert {"name": "library_entrypoint.abort.runtime", "tags": []} in parsed["points"] diff --git a/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/Dockerfile deleted file mode 100644 index cfb9ac0e795..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3.12 - -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.2.10 uvicorn==0.27.1 -CMD uvicorn --host 0.0.0.0 --port 18080 django_app:application diff --git a/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/django_app.py deleted file mode 100644 index c75a8df9a06..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django-uvicorn/django_app.py +++ /dev/null @@ -1,26 +0,0 @@ -import logging -import os - -from django.core.asgi import get_asgi_application -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] - -application = get_asgi_application() diff --git a/tests/lib-injection/dd-lib-python-init-test-django/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-django/Dockerfile deleted file mode 100644 index ce20a9d42bf..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11 - -ENV PYTHONUNBUFFERED 1 -ENV DD_INJECTION_ENABLED service_name,tracer,true -ENV DD_PROFILING_ENABLED true # profiling will crash the service on load if it does not pickup autoinjection correctly -ENV DD_TELEMETRY_FORWARDER_PATH ../datadog-lib/telemetry-forwarder.sh -# intentionally redundant in this test -ENV DD_INJECT_FORCE 1 -ENV DJANGO_SETTINGS_MODULE django_app -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install django==4.1.3 - -CMD python -m django runserver 0.0.0.0:18080 diff --git a/tests/lib-injection/dd-lib-python-init-test-django/django_app.py b/tests/lib-injection/dd-lib-python-init-test-django/django_app.py deleted file mode 100644 index 9bace85eca5..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django/django_app.py +++ /dev/null @@ -1,32 +0,0 @@ -import logging -import os - -from django.http import HttpResponse -from django.urls import path - - -filepath, extension = os.path.splitext(__file__) -ROOT_URLCONF = os.path.basename(filepath) -DEBUG = False -SECRET_KEY = "fdsfdasfa" -ALLOWED_HOSTS = ["*"] - -logging.basicConfig(level=logging.DEBUG) - - -def index(request): - import ddtrace - - if ddtrace.__version__ != "2.6.3": - print( - "Assertion failure: unexpected ddtrace version received. Got %r when expecting '2.6.3'" - % ddtrace.__version__ - ) - # Hard exit so traces aren't flushed. - os._exit(1) - return HttpResponse("test") - - -urlpatterns = [ - path("", index), -] diff --git a/tests/lib-injection/dd-lib-python-init-test-django/validate_telemetry.py b/tests/lib-injection/dd-lib-python-init-test-django/validate_telemetry.py deleted file mode 100644 index a138f3a1f31..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-django/validate_telemetry.py +++ /dev/null @@ -1,10 +0,0 @@ -import json -import sys - - -in_text = sys.stdin.read() -print(in_text) -parsed = json.loads(in_text.split("\t")[-1]) -print(parsed) -assert len(parsed["points"]) == 1 -assert parsed["points"][0] == {"name": "library_entrypoint.complete", "tags": ["injection_forced:false"]} diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Dockerfile b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Dockerfile deleted file mode 100644 index 7c16c1bca1c..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.8-slim - -ENV PYTHONUNBUFFERED 1 -ENV DD_INJECTION_ENABLED service_name,tracer,true -ENV DD_PROFILING_ENABLED true # profiling will crash the service on load if it does not pickup autoinjection correctly -ENV DD_INJECT_FORCE 1 -WORKDIR /src -ADD . /src -EXPOSE 18080 -RUN pip install -r requirements.txt - -CMD python test.py diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Readme.md b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Readme.md deleted file mode 100644 index dd922aef651..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/Readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# Purpose - -This is a regression test to detect situations where: -1. autoinject erroneously brings in a new version of protobuf, causing issues processing pb.py files generated with an old version of protoc -2. when the profiler is loaded, it tries to load its own pb.py files with the customer's old version of protobuf, which cannot process its too-new pb.py files - - -# How to reproduce the test itself - -This test uses assets which were generated outside of the test itself. -At the time of writing, the following works to generate the required assets - -``` -wget -c https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2 -tar -xvf protobuf-2.6.1.tar.bz2 -pushd protobuf-2.6.1 -./configure && make -j -popd -mv ./protobuf-2.6.1/examples/addressbook.proto . -./protobuf-2.6.1/src/protoc --python_out=. addressbook.proto -``` diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py deleted file mode 100644 index 851b0c32f8f..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py +++ /dev/null @@ -1,274 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: addressbook.proto - -import sys - - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pb2 -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="addressbook.proto", - package="tutorial", - serialized_pb=_b( - '\n\x11\x61\x64\x64ressbook.proto\x12\x08tutorial"\xda\x01\n\x06Person\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\n\n\x02id\x18\x02 \x02(\x05\x12\r\n\x05\x65mail\x18\x03 \x01(\t\x12+\n\x05phone\x18\x04 \x03(\x0b\x32\x1c.tutorial.Person.PhoneNumber\x1aM\n\x0bPhoneNumber\x12\x0e\n\x06number\x18\x01 \x02(\t\x12.\n\x04type\x18\x02 \x01(\x0e\x32\x1a.tutorial.Person.PhoneType:\x04HOME"+\n\tPhoneType\x12\n\n\x06MOBILE\x10\x00\x12\x08\n\x04HOME\x10\x01\x12\x08\n\x04WORK\x10\x02"/\n\x0b\x41\x64\x64ressBook\x12 \n\x06person\x18\x01 \x03(\x0b\x32\x10.tutorial.PersonB)\n\x14\x63om.example.tutorialB\x11\x41\x64\x64ressBookProtos' - ), -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -_PERSON_PHONETYPE = _descriptor.EnumDescriptor( - name="PhoneType", - full_name="tutorial.Person.PhoneType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor(name="MOBILE", index=0, number=0, options=None, type=None), - _descriptor.EnumValueDescriptor(name="HOME", index=1, number=1, options=None, type=None), - _descriptor.EnumValueDescriptor(name="WORK", index=2, number=2, options=None, type=None), - ], - containing_type=None, - options=None, - serialized_start=207, - serialized_end=250, -) -_sym_db.RegisterEnumDescriptor(_PERSON_PHONETYPE) - - -_PERSON_PHONENUMBER = _descriptor.Descriptor( - name="PhoneNumber", - full_name="tutorial.Person.PhoneNumber", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="number", - full_name="tutorial.Person.PhoneNumber.number", - index=0, - number=1, - type=9, - cpp_type=9, - label=2, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="tutorial.Person.PhoneNumber.type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=True, - default_value=1, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - options=None, - is_extendable=False, - extension_ranges=[], - oneofs=[], - serialized_start=128, - serialized_end=205, -) - -_PERSON = _descriptor.Descriptor( - name="Person", - full_name="tutorial.Person", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="tutorial.Person.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=2, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="tutorial.Person.id", - index=1, - number=2, - type=5, - cpp_type=1, - label=2, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - _descriptor.FieldDescriptor( - name="email", - full_name="tutorial.Person.email", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - _descriptor.FieldDescriptor( - name="phone", - full_name="tutorial.Person.phone", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - ], - extensions=[], - nested_types=[ - _PERSON_PHONENUMBER, - ], - enum_types=[ - _PERSON_PHONETYPE, - ], - options=None, - is_extendable=False, - extension_ranges=[], - oneofs=[], - serialized_start=32, - serialized_end=250, -) - - -_ADDRESSBOOK = _descriptor.Descriptor( - name="AddressBook", - full_name="tutorial.AddressBook", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="person", - full_name="tutorial.AddressBook.person", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - options=None, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - options=None, - is_extendable=False, - extension_ranges=[], - oneofs=[], - serialized_start=252, - serialized_end=299, -) - -_PERSON_PHONENUMBER.fields_by_name["type"].enum_type = _PERSON_PHONETYPE -_PERSON_PHONENUMBER.containing_type = _PERSON -_PERSON.fields_by_name["phone"].message_type = _PERSON_PHONENUMBER -_PERSON_PHONETYPE.containing_type = _PERSON -_ADDRESSBOOK.fields_by_name["person"].message_type = _PERSON -DESCRIPTOR.message_types_by_name["Person"] = _PERSON -DESCRIPTOR.message_types_by_name["AddressBook"] = _ADDRESSBOOK - -Person = _reflection.GeneratedProtocolMessageType( - "Person", - (_message.Message,), - dict( - PhoneNumber=_reflection.GeneratedProtocolMessageType( - "PhoneNumber", - (_message.Message,), - dict( - DESCRIPTOR=_PERSON_PHONENUMBER, - __module__="addressbook_pb2" - # @@protoc_insertion_point(class_scope:tutorial.Person.PhoneNumber) - ), - ), - DESCRIPTOR=_PERSON, - __module__="addressbook_pb2" - # @@protoc_insertion_point(class_scope:tutorial.Person) - ), -) -_sym_db.RegisterMessage(Person) -_sym_db.RegisterMessage(Person.PhoneNumber) - -AddressBook = _reflection.GeneratedProtocolMessageType( - "AddressBook", - (_message.Message,), - dict( - DESCRIPTOR=_ADDRESSBOOK, - __module__="addressbook_pb2" - # @@protoc_insertion_point(class_scope:tutorial.AddressBook) - ), -) -_sym_db.RegisterMessage(AddressBook) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions( - descriptor_pb2.FileOptions(), _b("\n\024com.example.tutorialB\021AddressBookProtos") -) -# @@protoc_insertion_point(module_scope) diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/requirements.txt b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/requirements.txt deleted file mode 100644 index 9424298af94..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -protobuf==3.17.0 diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/test.py b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/test.py deleted file mode 100644 index 28ff14f12eb..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/test.py +++ /dev/null @@ -1,33 +0,0 @@ -import socket - -import addressbook_pb2 - - -# First, open a socket on port 18080 to allow the fixture to continue -s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.bind(("localhost", 18080)) - -# Accept a connection from the fixture -s.listen(1) -conn, addr = s.accept() - -# Drain the request from the fixture -data = conn.recv(4096) - -# Do some stuff with the protobuf -person = addressbook_pb2.Person() -person.id = 1234 -person.name = "John Doe" -person.email = "john@ibm.com" - -print(person) - -# If we're here, then everything was successful. -# This test takes advantage of an existing fixture for these kinds of injection tests, so -# we just write the string "OK" to a magic file named `mock-telemetry.out` to signal success. -with open("mock-telemetry.out", "w") as f: - f.write("OK") - -# Send a standard response back to the fixture and teardown -conn.sendall(b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") -s.close() diff --git a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/validate_telemetry.py b/tests/lib-injection/dd-lib-python-init-test-protobuf-old/validate_telemetry.py deleted file mode 100644 index 8dd103a5eba..00000000000 --- a/tests/lib-injection/dd-lib-python-init-test-protobuf-old/validate_telemetry.py +++ /dev/null @@ -1,7 +0,0 @@ -# This test succeeds as long as the test application can print the string "OK" to the -import sys - - -in_text = sys.stdin.read() -print(in_text) -assert "OK" == in_text