8256417: Exclude TestJFRWithJMX test from running with PodMan

Reviewed-by: iignatyev
This commit is contained in:
Mikhailo Seledtsov 2021-02-26 16:21:12 +00:00
parent c9e91897ae
commit 07061fc73a
2 changed files with 14 additions and 3 deletions
test/hotspot/jtreg

@ -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
@ -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
#############################################################################

@ -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
@ -54,6 +54,7 @@ import jdk.management.jfr.FlightRecorderMXBean;
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;
@ -75,6 +76,10 @@ public class TestJFRWithJMX {
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 {
@ -215,4 +220,11 @@ public class TestJFRWithJMX {
}
}
}
static boolean isPodman() {
String[] parts = Container.ENGINE_COMMAND
.toLowerCase()
.split(File.pathSeparator);
return "podman".equals(parts[parts.length - 1]);
}
}