mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
01.27.2016 98fa91eb1a7eb1d7410295b73e92992ca78562a7
Temporarily work around file permissions checks when running the tests as root
1 files modified
12 ■■■■ changed files
opendj-cli/src/test/java/com/forgerock/opendj/cli/UtilsTestCase.java 12 ●●●● patch | view | raw | blame | history
opendj-cli/src/test/java/com/forgerock/opendj/cli/UtilsTestCase.java
@@ -11,7 +11,7 @@
 * Header, with the fields enclosed by brackets [] replaced by your own identifying
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2014-2015 ForgeRock AS.
 * Copyright 2014-2016 ForgeRock AS.
 */
package com.forgerock.opendj.cli;
@@ -56,7 +56,15 @@
        f.setReadOnly();
        f.deleteOnExit();
        assertTrue(f.exists());
        assertFalse(Utils.canWrite(f.getPath()));
        if (!System.getProperty("user.name").equals("root")) {
            // Expected behaviour
            assertFalse(Utils.canWrite(f.getPath()));
        } else {
            // Workaround for running tests in Docker
            // side effect of https://bugs.openjdk.java.net/browse/JDK-6931128,
            // where file permissions are not enforced if user is root.
            assertTrue(Utils.canWrite(f.getPath()));
        }
    }
    @Test