File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
dd-smoke-tests/lib-injection/src/test/groovy/datadog/smoketest Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1
1
package datadog.smoketest
2
2
3
+ import java.nio.file.Files
4
+ import java.nio.file.StandardCopyOption
5
+
6
+
3
7
abstract class MultipleAgentGuardrailsTest extends AbstractSmokeTest {
4
8
static final String LIB_INJECTION_ENABLED_FLAG = ' DD_INJECTION_ENABLED'
5
9
static final String LIB_INJECTION_FORCE_FLAG = ' DD_INJECT_FORCE'
6
10
7
11
@Override
8
12
ProcessBuilder createProcessBuilder () {
13
+ String extraAgentFilename() {
14
+ return null
15
+ }
16
+
9
17
def jarPath = System . getProperty(" datadog.smoketest.shadowJar.path" )
18
+ if (extraAgentFilename() != null ) {
19
+ renamedJar = Paths . get(jarPath). getParent(). resolve(extraAgentFilename())
20
+ Files . copy(Paths . get(jarPath), renamedJar, StandardCopyOption . REPLACE_EXISTING )
21
+ jarPath = renamedJar. toString()
22
+ }
10
23
def command = []
11
24
command+ = javaPath()
12
25
command. addAll(defaultJavaProperties)
@@ -78,3 +91,26 @@ class LibInjectionForcedTest extends MultipleAgentGuardrailsTest {
78
91
return true
79
92
}
80
93
}
94
+
95
+ // Test that injection still works if we have to agent if one of them is the aws emr log4j patcher
96
+ class LibsInjectionWorksEmr extends MultipleAgentGuardrailsTest {
97
+ @Override
98
+ boolean isLibInjectionEnabled () {
99
+ return true
100
+ }
101
+
102
+ @Override
103
+ boolean isLibInjectionForced () {
104
+ return false
105
+ }
106
+
107
+ @Override
108
+ String extraAgentFilenam () {
109
+ return " Log4jHotPatchFat.jar"
110
+ }
111
+
112
+ @Override
113
+ boolean isExpectingTrace () {
114
+ return true
115
+ }
116
+ }
You can’t perform that action at this time.
0 commit comments