RFR: 8227642: [TESTBUG] Make docker tests podman compatible

Severin Gehwolf sgehwolf at redhat.com
Fri Jul 12 18:08:18 UTC 2019


There is an alternative container engine which is being used by Fedora
and RHEL 8, called podman[1]. 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[2].
 * 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).



[1] https://podman.io/
[2] 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 mailing list