From 98db3d9864743fe4afd4dd3e13ddabbf04d143d5 Mon Sep 17 00:00:00 2001 From: Alejandro Estringana Ruiz Date: Tue, 26 Nov 2024 15:54:43 +0100 Subject: [PATCH] Test filesystem integration --- .../telemetry/integration_filesystem_01.phpt | 77 +++++++++++++++++ .../telemetry/integration_filesystem_02.phpt | 65 +++++++++++++++ ...em.phpt => integration_filesystem_03.phpt} | 32 +------- .../telemetry/integration_filesystem_04.phpt | 82 +++++++++++++++++++ 4 files changed, 228 insertions(+), 28 deletions(-) create mode 100644 tests/ext/telemetry/integration_filesystem_01.phpt create mode 100644 tests/ext/telemetry/integration_filesystem_02.phpt rename tests/ext/telemetry/{integration_filesystem.phpt => integration_filesystem_03.phpt} (74%) create mode 100644 tests/ext/telemetry/integration_filesystem_04.phpt diff --git a/tests/ext/telemetry/integration_filesystem_01.phpt b/tests/ext/telemetry/integration_filesystem_01.phpt new file mode 100644 index 00000000000..98fcd729f25 --- /dev/null +++ b/tests/ext/telemetry/integration_filesystem_01.phpt @@ -0,0 +1,77 @@ +--TEST-- +Filesystem integration depends on RASP. If RASP is not enabled, integration is disabled +--SKIPIF-- + +--ENV-- +DD_TRACE_GENERATE_ROOT_SPAN=0 +_DD_LOAD_TEST_INTEGRATIONS=1 +DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +--INI-- +datadog.trace.agent_url="file://{PWD}/integration-telemetry.out" +--FILE-- + +--EXPECT-- +array(1) { + ["integrations"]=> + array(2) { + [0]=> + array(5) { + ["name"]=> + string(10) "filesystem" + ["enabled"]=> + bool(false) + ["version"]=> + string(0) "" + ["compatible"]=> + NULL + ["auto_enabled"]=> + NULL + } + [1]=> + array(5) { + ["name"]=> + string(4) "logs" + ["enabled"]=> + bool(false) + ["version"]=> + string(0) "" + ["compatible"]=> + NULL + ["auto_enabled"]=> + NULL + } + } +} +--CLEAN-- + +--ENV-- +DD_TRACE_GENERATE_ROOT_SPAN=0 +_DD_LOAD_TEST_INTEGRATIONS=1 +DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_APPSEC_RASP_ENABLED=1 +--INI-- +datadog.trace.agent_url="file://{PWD}/integration-telemetry.out" +--FILE-- + +--EXPECT-- +array(1) { + ["integrations"]=> + array(1) { + [0]=> + array(5) { + ["name"]=> + string(4) "logs" + ["enabled"]=> + bool(false) + ["version"]=> + string(0) "" + ["compatible"]=> + NULL + ["auto_enabled"]=> + NULL + } + } +} +--CLEAN-- + --EXPECT-- -PUBLIC STATIC METHOD -test_access hook array(1) { ["integrations"]=> array(2) { [0]=> array(5) { ["name"]=> - string(37) "ddtrace\test\testsandboxedintegration" + string(10) "filesystem" ["enabled"]=> bool(true) ["version"]=> diff --git a/tests/ext/telemetry/integration_filesystem_04.phpt b/tests/ext/telemetry/integration_filesystem_04.phpt new file mode 100644 index 00000000000..c41fff44a0c --- /dev/null +++ b/tests/ext/telemetry/integration_filesystem_04.phpt @@ -0,0 +1,82 @@ +--TEST-- +Filesystem integration can also be disabled with default integrations flag +--SKIPIF-- + +--ENV-- +DD_TRACE_GENERATE_ROOT_SPAN=0 +_DD_LOAD_TEST_INTEGRATIONS=1 +DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_APPSEC_RASP_ENABLED=1 +DD_TRACE_FILESYSTEM_ENABLED=0 +--INI-- +datadog.trace.agent_url="file://{PWD}/integration-telemetry.out" +--FILE-- + +--EXPECT-- +array(1) { + ["integrations"]=> + array(2) { + [0]=> + array(5) { + ["name"]=> + string(10) "filesystem" + ["enabled"]=> + bool(false) + ["version"]=> + string(0) "" + ["compatible"]=> + NULL + ["auto_enabled"]=> + NULL + } + [1]=> + array(5) { + ["name"]=> + string(4) "logs" + ["enabled"]=> + bool(false) + ["version"]=> + string(0) "" + ["compatible"]=> + NULL + ["auto_enabled"]=> + NULL + } + } +} +--CLEAN-- +