Skip to content

Commit

Permalink
8256417: Exclude TestJFRWithJMX test from running with PodMan
Browse files Browse the repository at this point in the history
Reviewed-by: iignatyev
  • Loading branch information
Mikhailo Seledtsov committed Feb 26, 2021
1 parent c9e9189 commit 07061fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -86,7 +86,6 @@ runtime/cds/appcds/jigsaw/modulepath/ModulePathAndCP_JFR.java 8253437 windows-x6
runtime/cds/DeterministicDump.java 8253495 generic-all
runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64
runtime/ReservedStack/ReservedStackTest.java 8231031 generic-all
containers/docker/TestJFRWithJMX.java 8256417 linux-5.4.17-2011.5.3.el8uek.x86_64

#############################################################################

Expand Down
14 changes: 13 additions & 1 deletion test/hotspot/jtreg/containers/docker/TestJFRWithJMX.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -54,6 +54,7 @@

import jdk.test.lib.Asserts;
import jdk.test.lib.Container;
import jdk.test.lib.Platform;
import jdk.test.lib.Utils;
import jdk.test.lib.containers.docker.Common;
import jdk.test.lib.containers.docker.DockerRunOptions;
Expand All @@ -75,6 +76,10 @@ public static void main(String[] args) throws Exception {
throw new SkippedException("Docker is not supported on this host");
}

if (isPodman() & !Platform.isRoot()) {
throw new SkippedException("test cannot be run under rootless podman configuration");
}

DockerTestUtils.buildJdkDockerImage(imageName, "Dockerfile-BasicTest", "jdk-docker");

try {
Expand Down Expand Up @@ -215,4 +220,11 @@ static File transferRecording(FlightRecorderMXBean bean, long streamId) throws E
}
}
}

static boolean isPodman() {
String[] parts = Container.ENGINE_COMMAND
.toLowerCase()
.split(File.pathSeparator);
return "podman".equals(parts[parts.length - 1]);
}
}

1 comment on commit 07061fc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.