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 11package datadog.smoketest
22
3+ import java.nio.file.Files
4+ import java.nio.file.StandardCopyOption
5+
6+
37abstract class MultipleAgentGuardrailsTest extends AbstractSmokeTest {
48 static final String LIB_INJECTION_ENABLED_FLAG = ' DD_INJECTION_ENABLED'
59 static final String LIB_INJECTION_FORCE_FLAG = ' DD_INJECT_FORCE'
610
711 @Override
812 ProcessBuilder createProcessBuilder () {
13+ String extraAgentFilename() {
14+ return null
15+ }
16+
917 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+ }
1023 def command = []
1124 command+ = javaPath()
1225 command. addAll(defaultJavaProperties)
@@ -78,3 +91,26 @@ class LibInjectionForcedTest extends MultipleAgentGuardrailsTest {
7891 return true
7992 }
8093}
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