RFR: 8227642: [TESTBUG] Make docker tests podman compatible
igor.ignatyev at oracle.com
Tue Jul 16 18:49:08 UTC 2019
I don't think that tests (or test libraries for that matter) should be responsible for setting correct PATH value, it should be a part of host configuration procedure (tests can/should check that all required bins are available though). in other words, I'd prefer if you remove 'env.put("PATH", ...)' lines from both DockerTestUtils and TestJFREvents. the rest looks good to me.
> On Jul 16, 2019, at 5:36 AM, Severin Gehwolf <sgehwolf at redhat.com> wrote:
> I believe I still need a *R*eviewer for this. Any takers?
> On Fri, 2019-07-12 at 15:19 -0700, mikhailo.seledtsov at oracle.com wrote:
>> Hi Severin,
>> The change looks good to me. Thank you for adding support for Podman
>> container technology.
>> Testing: I ran both HotSpot and JDK container tests with your patch;
>> tests executed on Oracle Linux 7.6 using default container engine (Docker):
>> test/hotspot/jtreg/containers/ AND
>> All PASS
>> On 7/12/19 11:08 AM, Severin Gehwolf wrote:
>>> There is an alternative container engine which is being used by Fedora
>>> and RHEL 8, called podman. It's mostly compatible with docker. It
>>> looks like OpenJDK docker tests can be made podman compatible with a
>>> few little tweaks. One "interesting" one is to not assert "Successfully
>>> built" in the build output but only rely on the exit code, which seems
>>> to be OK for my testing. Interestingly the test would be skipped in
>>> that case.
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8227642
>>> webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8227642/01/webrev/
>>> Adjustments I've done:
>>> * Don't assert "Successfully built" in image build output.
>>> * Add /usr/sbin to PATH as the podman binary relies on iptables for it
>>> to work which is in /usr/sbin on Fedora
>>> * Allow for Metrics.getCpuSystemUsage() and Metrics.getCpuUserUsage()
>>> to be equal to the previous value. I've found those counters to be
>>> slowly increasing, which made the tests unreliable.
>>> Running docker tests with docker as engine. Did the same with podman as
>>> engine via -Djdk.test.docker.command=podman on Linux x86_64. Both
>>> passed (non-trivially).
>>>  https://podman.io/
>>>  Image builds with podman look
>>> like ("COMMIT" over "Successfully built"):
>>> STEP 1: FROM fedora:29
>>> STEP 2: RUN dnf install -y java-11-openjdk-devel && dnf clean all
>>> --> Using cache 96f8b1a0dfe7dba581a64fc67a27002ddf52e032af55f9ddc765182a690afd9d
>>> STEP 3: COPY TestMetrics.class TestMetrics.java /opt/
>>> STEP 4: CMD /usr/lib/jvm/java-11-openjdk/bin/java -cp /opt --add-modules java.base --add-exports java.base/jdk.internal.platform=ALL-UNNAMED TestMetrics
>>> STEP 5: COMMIT fedora-metrics-11
More information about the core-libs-dev