JDK-8235482 : [TESTBUG] PackageType LINUX_RPM should be excluded for jpackage tests on debian systems
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 14
  • Priority: P5
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2019-12-06
  • Updated: 2020-08-28
  • Resolved: 2020-08-28
Related Reports
Relates :  
Description
## The following tests may fail on Ubuntu18.04
------------------------------
tools/jpackage/linux/AppCategoryTest.java: jpackage with --linux-app-category
tools/jpackage/linux/LicenseTypeTest.java: jpackage with --linux-rpm-license-type
tools/jpackage/linux/LinuxBundleNameTest.java: jpackage with --linux-package-name
tools/jpackage/linux/PackageDepsTest.java: jpackage with --linux-package-deps
tools/jpackage/linux/ReleaseTest.java: jpackage with --linux-app-release
tools/jpackage/linux/ShortcutHintTest.java#id0: jpackage with --linux-shortcut
tools/jpackage/share/AdditionalLaunchersTest.java: jpackage with --add-launcher
tools/jpackage/share/AppImagePackageTest.java: jpackage with --app-image
tools/jpackage/share/FileAssociationsTest.java: jpackage with --file-associations
tools/jpackage/share/InstallDirTest.java#id0: jpackage with --install-dir
tools/jpackage/share/LicenseTest.java#id0: jpackage with --license-file
tools/jpackage/share/LicenseTest.java#id1: jpackage with --license-file
tools/jpackage/share/RuntimePackageTest.java: jpackage with --runtime-image
tools/jpackage/share/SimplePackageTest.java: Simple jpackage command run
tools/jpackage/share/jdk/jpackage/tests/BasicTest.java: jpackage basic testing
------------------------------

## Reproduce

1. Install rpm on Ubuntu18.04
------------------------------
sudo apt install rpm
------------------------------

2. Run
------------------------------
Ben="tools/jpackage/share/SimplePackageTest.java"
make test TEST="${Ben}" CONF=server-release
------------------------------

## Symptom
------------------------------
Running [rpm, -q, --queryformat, %{name}\n, -q, --whatprovides, /lib/x86_64-linux-gnu/libc.so.6]
file /lib/x86_64-linux-gnu/libc.so.6 is not owned by any package
java.io.IOException: Command [rpm, -q, --queryformat, %{name}\n, -q, --whatprovides, /lib/x86_64-linux-gnu/libc.so.6] exited with 1 code
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Executor.executeExpectSuccess(Executor.java:68)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LinuxRpmBundler.lambda$initLibProvidersLookup$7(LinuxRpmBundler.java:187)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LibProvidersLookup.lambda$execute$1(LibProvidersLookup.java:67)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1694)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LibProvidersLookup.execute(LibProvidersLookup.java:78)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LinuxPackageBundler.getListOfNeededPackages(LinuxPackageBundler.java:188)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LinuxPackageBundler.createDefaultReplacementData(LinuxPackageBundler.java:214)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.LinuxPackageBundler.execute(LinuxPackageBundler.java:144)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.generateBundle(Arguments.java:628)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.internal.Arguments.processArguments(Arguments.java:514)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.execute(Main.java:97)
        at jdk.incubator.jpackage/jdk.incubator.jpackage.main.Main.main(Main.java:51)

...


TRACE: assertEquals(0): Check command [rpm -qp -R ./test/output/simplepackagetest-1.0-1.x86_64.rpm](4) exited with 0 code
ERROR: Failed: Check [libc] package is in the list of required packages [/bin/sh, /bin/sh, rpmlib(CompressedFileNames) <= 3.0.4-1, rpmlib(FileDigests) <= 4.6.0-1, rpmlib(PayloadFilesHavePrefix) <= 4.0-1] of [simplepackagetest] package
[  FAILED  ] SimplePackageTest.test; checks=24
[==========] 1 tests ran
[  PASSED  ] 0 tests
[  FAILED  ] 1 test, listed below
[  FAILED  ] SimplePackageTest.test; workDir=[./test]
1 FAILED TEST
STDERR:
WARNING: Using incubator modules: jdk.incubator.jpackage
WARNING: Using incubator modules: jdk.incubator.jpackage
WARNING: Using incubator modules: jdk.incubator.jpackage
java.lang.AssertionError: Failed: Check [libc] package is in the list of required packages [/bin/sh, /bin/sh, rpmlib(CompressedFileNames) <= 3.0.4-1, rpmlib(FileDigests) <= 4.6.0-1, rpmlib(PayloadFilesHavePrefix) <= 4.0-1] of [simplepackagetest] package
        at jdk.jpackage.test.TKit.error(TKit.java:238)
        at jdk.jpackage.test.TKit.assertTrue(TKit.java:610)
        at jdk.jpackage.test.TKit.assertTrue(TKit.java:597)
        at jdk.jpackage.test.LinuxHelper.verifyPackageBundleEssential(LinuxHelper.java:217)
        at jdk.jpackage.test.PackageTest$Handler.verifyPackageBundle(PackageTest.java:381)
        at jdk.jpackage.test.PackageTest$Handler.accept(PackageTest.java:360)
        at jdk.jpackage.test.PackageTest.lambda$run$19(PackageTest.java:298)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
        at jdk.jpackage.test.PackageTest.run(PackageTest.java:298)
        at SimplePackageTest.test(SimplePackageTest.java:59)
...
------------------------------
Comments
Won't fix. Workaround is sufficient.
17-12-2019

Hi Alexey, I'm not an expert in jpackage. Would you mind if I re-assign this issue to you to implement the better fix you've mentioned above? Thanks a lot. Best regards, Jie
11-12-2019

Sorry, I misunderstood your question about building rpm-s on Ubuntu. I though you asked if I had jpackage successfully produce rpm-s on Ubuntu, not the tests. jpackage tests will fail on Ubuntu with rpmbuild and rpm commands installed. jpackage itself will succeed to create rpm packages in this environment. The workaround is to disable rpm in jpackage tests as I suggested in my previous comments. The better fix would be to tweak jpackage tests to disable verification of the list of prerequisite packages in case tests are executed in the environment in which jpackage can't build this list.
10-12-2019

>> - 1) Have you ever tried the rpm tests on a debian system? > Yes, I did. I have rpm package installed on my Ubuntu box that provides rpmbuild command needed by jpackage to create rpm packages How can I make tools/jpackage/share/SimplePackageTest.java pass on Ubuntu18.04 with the rpm mode? Could you please share us the detailed steps? >> - 2) How to decide whether the rpm tests are supported on a debian system? > if rpm packaging is supported by jpackage in the given environment, tests will run jpackage in rpm mode. But the tests in rpm mode fails on my Ubuntu machine. If I had missed something, please let me know. Thanks.
10-12-2019

> - 1) Have you ever tried the rpm tests on a debian system? Yes, I did. I have rpm package installed on my Ubuntu box that provides rpmbuild command needed by jpackage to create rpm packages > - 2) How to decide whether the rpm tests are supported on a debian system? if rpm packaging is supported by jpackage in the given environment, tests will run jpackage in rpm mode.
09-12-2019

Hi Alexey, I have two questions: - 1) Have you ever tried the rpm tests on a debian system? - 2) How to decide whether the rpm tests are supported on a debian system? Thanks.
09-12-2019

Fix referenced in RFR will disable running rpm tests on Debian systems that support it. This is not a good idea. If you need to exclude some packaging from jpackage tests, just run jtreg with "jpackage.test.disabledPackagers" system property set to the list of corresponding package types. E.g.: -Djpackage.test.disabledPackagers=rpm will disable rpm packaging. This bug can be closed as not an issue.
06-12-2019

RFR: https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-December/063861.html
06-12-2019