Search in sources :

Example 16 with FileSystemAdminShell

use of alluxio.cli.fsadmin.FileSystemAdminShell in project alluxio by Alluxio.

the class AddCommandIntegrationTest method invalidPropertyKey.

@Test
public void invalidPropertyKey() throws Exception {
    try (FileSystemAdminShell shell = new FileSystemAdminShell(ServerConfiguration.global())) {
        int ret = shell.run("pathConf", "add", "--property", "unknown=value", "/");
        Assert.assertEquals(-1, ret);
        String output = mOutput.toString();
        Assert.assertEquals("Invalid property key unknown\n", output);
    }
}
Also used : FileSystemAdminShell(alluxio.cli.fsadmin.FileSystemAdminShell) Test(org.junit.Test) AbstractShellIntegrationTest(alluxio.client.cli.fs.AbstractShellIntegrationTest)

Example 17 with FileSystemAdminShell

use of alluxio.cli.fsadmin.FileSystemAdminShell in project alluxio by Alluxio.

the class RemoveCommandIntegrationTest method remove.

@Test
public void remove() throws Exception {
    try (FileSystemAdminShell shell = new FileSystemAdminShell(ServerConfiguration.global())) {
        int ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        String output = mOutput.toString();
        Assert.assertEquals("", output);
        ret = shell.run("pathConf", "add", "--property", format(PROPERTY_KEY11, PROPERTY_VALUE11), "--property", format(PROPERTY_KEY12, PROPERTY_VALUE12), DIR1);
        Assert.assertEquals(0, ret);
        ret = shell.run("pathConf", "add", "--property", format(PROPERTY_KEY13, PROPERTY_VALUE13), DIR1);
        Assert.assertEquals(0, ret);
        ret = shell.run("pathConf", "add", "--property", format(PROPERTY_KEY2, PROPERTY_VALUE2), DIR2);
        Assert.assertEquals(0, ret);
        mOutput.reset();
        ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        output = mOutput.toString();
        Assert.assertEquals(DIR1 + "\n" + DIR2 + "\n", output);
        ret = shell.run("pathConf", "remove", DIR2);
        Assert.assertEquals(0, ret);
        mOutput.reset();
        ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        output = mOutput.toString();
        Assert.assertEquals(DIR1 + "\n", output);
        ret = shell.run("pathConf", "remove", "--keys", PROPERTY_KEY11.getName(), DIR1);
        Assert.assertEquals(0, ret);
        mOutput.reset();
        ret = shell.run("pathConf", "show", DIR1);
        Assert.assertEquals(0, ret);
        String expected = format(PROPERTY_KEY13, PROPERTY_VALUE13) + "\n" + format(PROPERTY_KEY12, PROPERTY_VALUE12) + "\n";
        output = mOutput.toString();
        Assert.assertEquals(expected, output);
        ret = shell.run("pathConf", "remove", "--keys", PROPERTY_KEY12.getName() + "," + PROPERTY_KEY13.getName(), DIR1);
        Assert.assertEquals(0, ret);
        mOutput.reset();
        ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        output = mOutput.toString();
        Assert.assertEquals("", output);
    }
}
Also used : FileSystemAdminShell(alluxio.cli.fsadmin.FileSystemAdminShell) AbstractShellIntegrationTest(alluxio.client.cli.fs.AbstractShellIntegrationTest) Test(org.junit.Test)

Example 18 with FileSystemAdminShell

use of alluxio.cli.fsadmin.FileSystemAdminShell in project alluxio by Alluxio.

the class AbstractFsAdminShellTest method before.

@Before
public final void before() throws Exception {
    mLocalAlluxioCluster = sLocalAlluxioClusterResource.get();
    mFsAdminShell = new FileSystemAdminShell(ServerConfiguration.global());
}
Also used : FileSystemAdminShell(alluxio.cli.fsadmin.FileSystemAdminShell) Before(org.junit.Before)

Example 19 with FileSystemAdminShell

use of alluxio.cli.fsadmin.FileSystemAdminShell in project alluxio by Alluxio.

the class ListCommandIntegrationTest method listEmpty.

@Test
public void listEmpty() throws Exception {
    try (FileSystemAdminShell shell = new FileSystemAdminShell(ServerConfiguration.global())) {
        int ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        String output = mOutput.toString();
        Assert.assertEquals("", output);
    }
}
Also used : FileSystemAdminShell(alluxio.cli.fsadmin.FileSystemAdminShell) Test(org.junit.Test) AbstractShellIntegrationTest(alluxio.client.cli.fs.AbstractShellIntegrationTest)

Example 20 with FileSystemAdminShell

use of alluxio.cli.fsadmin.FileSystemAdminShell in project alluxio by Alluxio.

the class ListCommandIntegrationTest method list.

@Test
public void list() throws Exception {
    try (FileSystemAdminShell shell = new FileSystemAdminShell(setPathConfigurations())) {
        int ret = shell.run("pathConf", "list");
        Assert.assertEquals(0, ret);
        String output = mOutput.toString();
        Assert.assertEquals(DIR1 + "\n" + DIR2 + "\n", output);
    }
}
Also used : FileSystemAdminShell(alluxio.cli.fsadmin.FileSystemAdminShell) Test(org.junit.Test) AbstractShellIntegrationTest(alluxio.client.cli.fs.AbstractShellIntegrationTest)

Aggregations

FileSystemAdminShell (alluxio.cli.fsadmin.FileSystemAdminShell)23 Test (org.junit.Test)22 AbstractShellIntegrationTest (alluxio.client.cli.fs.AbstractShellIntegrationTest)17 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)5 MasterNetAddress (alluxio.multi.process.MasterNetAddress)3 AlluxioURI (alluxio.AlluxioURI)2 PropertyKey (alluxio.conf.PropertyKey)2 ConfigurationRule (alluxio.ConfigurationRule)1 SystemErrRule (alluxio.SystemErrRule)1 SystemOutRule (alluxio.SystemOutRule)1 FileSystemShell (alluxio.cli.fs.FileSystemShell)1 QuorumCommand (alluxio.cli.fsadmin.journal.QuorumCommand)1 QuorumElectCommand (alluxio.cli.fsadmin.journal.QuorumElectCommand)1 QuorumInfoCommand (alluxio.cli.fsadmin.journal.QuorumInfoCommand)1 QuorumRemoveCommand (alluxio.cli.fsadmin.journal.QuorumRemoveCommand)1 FileSystem (alluxio.client.file.FileSystem)1 URIStatus (alluxio.client.file.URIStatus)1 InstancedConfiguration (alluxio.conf.InstancedConfiguration)1 ServerConfiguration (alluxio.conf.ServerConfiguration)1 ExceptionMessage (alluxio.exception.ExceptionMessage)1