use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsProxyUserValidationTaskTest method proxyUserNotWildcard.
@Test
public void proxyUserNotWildcard() {
String userName = System.getProperty("user.name");
// Configured proxy users and groups, but not wildcard
String proxyUserKey = String.format("hadoop.proxyuser.%s.users", userName);
String proxyGroupKey = String.format("hadoop.proxyuser.%s.groups", userName);
prepareHdfsConfFiles(ImmutableMap.of(proxyUserKey, "user1,user2", proxyGroupKey, "groups"));
HdfsProxyUserValidationTask task = new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.WARNING, result.getState());
assertThat(result.getResult(), containsString(String.format("%s=user1,user2 and %s=groups", proxyUserKey, proxyGroupKey)));
assertThat(result.getAdvice(), containsString("Please make sure that includes all users/groups Alluxio needs to impersonate as."));
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsVersionValidationTaskTest method versionMatched.
@Test
public void versionMatched() throws Exception {
PowerMockito.mockStatic(ShellUtils.class);
String[] cmd = new String[] { "hadoop", "version" };
BDDMockito.given(ShellUtils.execCommand(cmd)).willReturn("Hadoop 2.6");
sConf.set(PropertyKey.UNDERFS_VERSION, "2.6");
HdfsVersionValidationTask task = new HdfsVersionValidationTask(sConf);
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 minorVersionAccepted.
@Test
public void minorVersionAccepted() throws Exception {
PowerMockito.mockStatic(ShellUtils.class);
String[] cmd = new String[] { "hadoop", "version" };
// The minor version is not defined in Alluxio, which should work
BDDMockito.given(ShellUtils.execCommand(cmd)).willReturn("Hadoop 2.6.2");
sConf.set(PropertyKey.UNDERFS_VERSION, "2.6");
HdfsVersionValidationTask task = new HdfsVersionValidationTask(sConf);
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 versionNotMatchedDefault.
@Test
public void versionNotMatchedDefault() throws Exception {
PowerMockito.mockStatic(ShellUtils.class);
String[] cmd = new String[] { "hadoop", "version" };
BDDMockito.given(ShellUtils.execCommand(cmd)).willReturn("Hadoop 2.2");
HdfsVersionValidationTask task = new HdfsVersionValidationTask(sConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("2.2 does not match alluxio.underfs.version"));
assertThat(result.getAdvice(), containsString("configure alluxio.underfs.version"));
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsVersionValidationTaskTest method minorVersionConflict.
@Test
public void minorVersionConflict() throws Exception {
PowerMockito.mockStatic(ShellUtils.class);
String[] cmd = new String[] { "hadoop", "version" };
// Alluxio defines a different minor version, which should not work
BDDMockito.given(ShellUtils.execCommand(cmd)).willReturn("Hadoop 2.6.2");
sConf.set(PropertyKey.UNDERFS_VERSION, "2.6.3");
HdfsVersionValidationTask task = new HdfsVersionValidationTask(sConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("Hadoop version 2.6.2 does not match alluxio.underfs.version=2.6.3"));
}
Aggregations