Hi Matthias,

We don't set "jpackage.test.disabledPackagers" property from the test code. It is assumed to be set from jtreg command line that runs tests. The value of the property is just checked in tests.
So basically there is no need to change code at all.
However, if you want to disable running rpm tests on Ubuntu, you can tweak setting of jdk.jpackage.test.PackageType.Inner.DISABLED_PACKAGERS property (test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java).
Something like this:

class Inner {
    private static boolean isUbuntu() {
        if (!TKit.isLinux()) {
            return false;
        }
        ...
    }

    private final static Set<String> DISABLED_PACKAGERS;

    static {
        Set<String> disabledPackagers = TKit.tokenizeConfigProperty("disabledPackagers");
        if (disabledPackagers != null) {
            DISABLED_PACKAGERS = disabledPackagers;
        } else if (isUbuntu()) {
            DISABLED_PACKAGERS = Set.of("rpm");
        } else {
            DISABLED_PACKAGERS = Collections.emptySet();
        }
    }
}

This way the fix would disable running rpm tests on Ubuntu if "jpackage.test.disabledPackagers" property is not set allowing to still run rpm tests on Ubuntu in case the property is explicitly set to some value.

- Alexey


On 2/12/2020 4:19 AM, Baesken, Matthias wrote:
Hello, please review this small  test related change .

Currently (most of the)  tools/jpackage tests do not work on Ubuntu Linux .
Reason is that the rpm parts of the  jpackage tests  do not pass on this distro 
.
The  rpm tests  can be disabled by this property :


Do you expect  those  tests to work on Ubuntu ?
No, rpm test are not supposed to pass on Ubuntu.
To disable running rpm tests on Ubuntu please set
"jpackage.test.disabledPackagers" system property to "rpm":
-Djpackage.test.disabledPackagers=rpm.
However the tests should set this property   themselves , it is really bad that 
it must be currently configured from outside .




Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8238953

http://cr.openjdk.java.net/~mbaesken/webrevs/8238953.0/


Best regards, Matthias


Reply via email to