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);
}
}
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);
}
}
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());
}
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);
}
}
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);
}
}
Aggregations