-
Notifications
You must be signed in to change notification settings - Fork 182
Expand file tree
/
Copy pathintegration_filesystem_01.phpt
More file actions
68 lines (65 loc) · 1.87 KB
/
Copy pathintegration_filesystem_01.phpt
File metadata and controls
68 lines (65 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--TEST--
Filesystem integration depends on RASP. If RASP is not enabled, integration is disabled
--SKIPIF--
<?php
if (getenv('PHP_PEAR_RUNTESTS') === '1') die("skip: pecl run-tests does not support {PWD}");
if (PHP_OS === "WINNT" && PHP_VERSION_ID < 70400) die("skip: Windows on PHP 7.2 and 7.3 have permission issues with synchronous access to telemetry");
if (getenv('USE_ZEND_ALLOC') === '0' && !getenv("SKIP_ASAN")) die('skip timing sensitive test - valgrind is too slow');
require __DIR__ . '/../includes/clear_skipif_telemetry.inc'
?>
--ENV--
DD_TRACE_GENERATE_ROOT_SPAN=0
_DD_LOAD_TEST_INTEGRATIONS=1
DD_INSTRUMENTATION_TELEMETRY_ENABLED=1
DD_APPSEC_RASP_ENABLED=0
DD_TRACE_AGENT_TIMEOUT=200
DD_TRACE_RETRY_INTERVAL=1
--INI--
datadog.trace.agent_url="file://{PWD}/integration-telemetry-01.out"
--FILE--
<?php
namespace
{
$file = ini_get('datadog.trace.agent_url');
dd_trace_internal_fn("finalize_telemetry");
for ($i = 0; $i < 300; ++$i) {
usleep(100000);
if (file_exists($file )) {
foreach (file($file) as $l) {
if ($l) {
$json = json_decode($l, true);
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
foreach ($batch as $json) {
if ($json["request_type"] == "app-integrations-change") {
var_dump($json["payload"]);
break 3;
}
}
}
}
}
}
}
?>
--EXPECT--
array(1) {
["integrations"]=>
array(1) {
[0]=>
array(5) {
["name"]=>
string(10) "filesystem"
["enabled"]=>
bool(false)
["version"]=>
string(0) ""
["compatible"]=>
NULL
["auto_enabled"]=>
NULL
}
}
}
--CLEAN--
<?php
@unlink(ini_get('datadog.trace.agent_url'));