Skip to content

Commit

Permalink
USM: java ci add jre 8u151 (#15514)
Browse files Browse the repository at this point in the history
  • Loading branch information
nplanel committed Feb 20, 2023
1 parent 958f0a2 commit fd8ce67
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion pkg/network/tracer/tracer_usm_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,38 @@ func TestJavaInjection(t *testing.T) {
}{
{
// Test the java hotspot injection is working
name: "java_hotspot_injection",
name: "java_hotspot_injection_8u151",
context: testContext{
extras: make(map[string]interface{}),
},
preTracerSetup: func(t *testing.T, ctx testContext) {
ctx.extras["JavaAgentArgs"] = cfg.JavaAgentArgs

tfile, err := ioutil.TempFile(dir+"/../java/testdata/", "TestAgentLoaded.agentmain.*")
require.NoError(t, err)
tfile.Close()
os.Remove(tfile.Name())
ctx.extras["testfile"] = tfile.Name()
cfg.JavaAgentArgs += " testfile=/v/" + filepath.Base(tfile.Name())
},
postTracerSetup: func(t *testing.T, ctx testContext) {
javatestutil.RunJavaVersion(t, "openjdk:8u151-jre", "JustWait")
// if RunJavaVersion failing to start it's probably because the java process has not been injected

cfg.JavaAgentArgs = ctx.extras["JavaAgentArgs"].(string)
},
validation: func(t *testing.T, ctx testContext, tr *Tracer) {
time.Sleep(time.Second)

testfile := ctx.extras["testfile"].(string)
_, err := os.Stat(testfile)
require.NoError(t, err)
os.Remove(testfile)
},
},
{
// Test the java hotspot injection is working
name: "java_hotspot_injection_21",
context: testContext{
extras: make(map[string]interface{}),
},
Expand Down
2 changes: 1 addition & 1 deletion tasks/system_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ def save_test_dockers(ctx, output_dir, arch, windows=is_windows):
images.add(docker_compose["services"][component]["image"])

# Java tests have dynamic images in docker-compose.yml
for image in ["openjdk:21-oraclelinux8"]:
for image in ["openjdk:21-oraclelinux8", "openjdk:8u151-jre"]:
images.add(image)

for image in images:
Expand Down

0 comments on commit fd8ce67

Please sign in to comment.