use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsProxyUserValidationTaskTest method wildcardProxyUsers.
@Test
public void wildcardProxyUsers() {
String userName = System.getProperty("user.name");
// Proxy users configured but not groups
prepareHdfsConfFiles(ImmutableMap.of(String.format("hadoop.proxyuser.%s.users", userName), "*"));
HdfsProxyUserValidationTask task = new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.OK, result.getState());
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsProxyUserValidationTaskTest method wildcardProxyGroups.
@Test
public void wildcardProxyGroups() {
String userName = System.getProperty("user.name");
// Proxy groups configured but not users
prepareHdfsConfFiles(ImmutableMap.of(String.format("hadoop.proxyuser.%s.groups", userName), "*"));
HdfsProxyUserValidationTask task = new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.OK, result.getState());
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsVersionValidationTaskTest method versionNotMatched.
@Test
public void versionNotMatched() throws Exception {
PowerMockito.mockStatic(ShellUtils.class);
String[] cmd = new String[] { "hadoop", "version" };
BDDMockito.given(ShellUtils.execCommand(cmd)).willReturn("Hadoop 2.7");
sConf.set(PropertyKey.UNDERFS_VERSION, "2.6");
HdfsVersionValidationTask task = new HdfsVersionValidationTask(sConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("2.7 does not match alluxio.underfs.version=2.6"));
assertThat(result.getAdvice(), containsString("configure alluxio.underfs.version"));
}
Aggregations