Search in sources :

Example 26 with ValidationTaskResult

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());
}
Also used : StringContains.containsString(org.hamcrest.core.StringContains.containsString) ValidationTaskResult(alluxio.cli.ValidationTaskResult) Test(org.junit.Test)

Example 27 with ValidationTaskResult

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());
}
Also used : StringContains.containsString(org.hamcrest.core.StringContains.containsString) ValidationTaskResult(alluxio.cli.ValidationTaskResult) Test(org.junit.Test)

Example 28 with ValidationTaskResult

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"));
}
Also used : StringContains.containsString(org.hamcrest.core.StringContains.containsString) ValidationTaskResult(alluxio.cli.ValidationTaskResult) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

ValidationTaskResult (alluxio.cli.ValidationTaskResult)28 Test (org.junit.Test)19 StringContains.containsString (org.hamcrest.core.StringContains.containsString)16 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 Pair (alluxio.collections.Pair)4 IOException (java.io.IOException)3 IMetaStoreClient (org.apache.hadoop.hive.metastore.IMetaStoreClient)3 List (java.util.List)2 AbstractValidationTask (alluxio.cli.AbstractValidationTask)1 ApplicableUfsType (alluxio.cli.ApplicableUfsType)1 ValidationUtils (alluxio.cli.ValidationUtils)1 AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)1 PropertyKey (alluxio.conf.PropertyKey)1 InvalidPathException (alluxio.exception.InvalidPathException)1 ValidationResult (alluxio.hub.proto.ValidationResult)1 BaseHubTest (alluxio.hub.test.BaseHubTest)1 PathUtils (alluxio.util.io.PathUtils)1 RandomAccessFile (java.io.RandomAccessFile)1 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 URI (java.net.URI)1