use of alluxio.ConfigurationRule in project alluxio by Alluxio.
the class PermissionCheckTest method setStateSuccess.
@Test
public void setStateSuccess() throws Exception {
// set unmask
try (Closeable c = new ConfigurationRule(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK, "000", ServerConfiguration.global()).toResource()) {
String file = PathUtils.concatPath(TEST_DIR_URI, "testState1");
verifyCreateFile(TEST_USER_1, file, false);
SetAttributePOptions expect = getNonDefaultSetState();
SetAttributePOptions result = verifySetState(TEST_USER_2, file, expect);
assertEquals(expect.getCommonOptions().getTtl(), result.getCommonOptions().getTtl());
assertEquals(expect.getCommonOptions().getTtlAction(), result.getCommonOptions().getTtlAction());
assertEquals(expect.getPinned(), result.getPinned());
}
}
use of alluxio.ConfigurationRule in project alluxio by Alluxio.
the class PermissionCheckTest method completeFileSuccess.
@Test
public void completeFileSuccess() throws Exception {
// set unmask
try (Closeable c = new ConfigurationRule(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK, "044", ServerConfiguration.global()).toResource()) {
String file = PathUtils.concatPath(TEST_DIR_URI, "/testState1");
verifyCreateFile(TEST_USER_1, file, false);
CompleteFileContext expect = getNonDefaultCompleteFileContext();
verifyCompleteFile(TEST_USER_2, file, expect);
}
}
Aggregations