use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsConfValidationTaskTest method missingBoth.
@Test
public void missingBoth() {
sConf.set(PropertyKey.UNDERFS_HDFS_CONFIGURATION, "/conf/");
HdfsConfValidationTask task = new HdfsConfValidationTask("hdfs://namenode:9000/alluxio", sConf);
ValidationTaskResult result = task.loadHdfsConfig();
assertEquals(result.getState(), ValidationUtils.State.SKIPPED);
assertThat(result.getResult(), containsString("hdfs-site.xml is not configured"));
assertThat(result.getResult(), containsString("core-site.xml is not configured"));
assertThat(result.getAdvice(), containsString("hdfs-site.xml"));
assertThat(result.getAdvice(), containsString("core-site.xml"));
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsConfValidationTaskTest method loadedConf.
@Test
public void loadedConf() {
String hdfsSite = Paths.get(sTestDir.toPath().toString(), "hdfs-site.xml").toString();
ValidationTestUtils.writeXML(hdfsSite, ImmutableMap.of("key2", "value2"));
String coreSite = Paths.get(sTestDir.toPath().toString(), "core-site.xml").toString();
ValidationTestUtils.writeXML(coreSite, ImmutableMap.of("key1", "value1"));
sConf.set(PropertyKey.UNDERFS_HDFS_CONFIGURATION, hdfsSite + HdfsConfValidationTask.SEPARATOR + coreSite);
HdfsConfValidationTask task = new HdfsConfValidationTask("hdfs://namenode:9000/alluxio", sConf);
ValidationTaskResult result = task.loadHdfsConfig();
assertEquals(result.getState(), ValidationUtils.State.OK);
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsConfValidationTaskTest method inconsistentConf.
@Test
public void inconsistentConf() {
String hdfsSite = Paths.get(sTestDir.toPath().toString(), "hdfs-site.xml").toString();
ValidationTestUtils.writeXML(hdfsSite, ImmutableMap.of("key1", "value2"));
String coreSite = Paths.get(sTestDir.toPath().toString(), "core-site.xml").toString();
ValidationTestUtils.writeXML(coreSite, ImmutableMap.of("key1", "value1"));
sConf.set(PropertyKey.UNDERFS_HDFS_CONFIGURATION, hdfsSite + HdfsConfValidationTask.SEPARATOR + coreSite);
HdfsConfValidationTask task = new HdfsConfValidationTask("hdfs://namenode:9000/alluxio", sConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("key1"));
assertThat(result.getResult(), containsString("value1 in core-site.xml"));
assertThat(result.getResult(), containsString("value2 in hdfs-site.xml"));
assertThat(result.getAdvice(), containsString("fix the inconsistency"));
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsProxyUserValidationTaskTest method proxyUsersAndGroupsAllMissing.
@Test
public void proxyUsersAndGroupsAllMissing() {
String userName = System.getProperty("user.name");
// Proxyuser configured for bob, not the running user
prepareHdfsConfFiles(ImmutableMap.of("hadoop.proxyuser.bob.users", "user1,user3", "hadoop.proxyuser.bob.groups", "*"));
HdfsProxyUserValidationTask task = new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("Alluxio is not able to perform impersonation."));
assertThat(result.getAdvice(), containsString(String.format("Please enable Alluxio user %s to impersonate", userName)));
}
use of alluxio.cli.ValidationTaskResult in project alluxio by Alluxio.
the class HdfsProxyUserValidationTaskTest method missingProxyUser.
@Test
public void missingProxyUser() {
String userName = System.getProperty("user.name");
// No proxy user definition in core-site.xml
prepareHdfsConfFiles(ImmutableMap.of("key1", "value1"));
HdfsProxyUserValidationTask task = new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
assertEquals(ValidationUtils.State.FAILED, result.getState());
assertThat(result.getResult(), containsString("Alluxio is not able to perform impersonation."));
assertThat(result.getAdvice(), containsString(String.format("Please enable Alluxio user %s to impersonate", userName)));
}
Aggregations