HADOOP-16687. ABFS: Fix testcase added for HADOOP-16138 for namespace enabled account. (#1701)

This commit is contained in:
Sneha Vijayarajan 2019-11-20 18:24:12 -08:00 committed by Masatake Iwasaki
parent 1a0c0e42e7
commit de38045021
1 changed files with 7 additions and 9 deletions

View File

@ -22,8 +22,8 @@ import java.util.UUID;
import org.junit.Test;
import org.apache.hadoop.fs.FsShell;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FsShell;
import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION;
import static org.apache.hadoop.fs.azurebfs.constants.FileSystemUriSchemes.ABFS_SCHEME;
@ -36,8 +36,6 @@ public class ITestAzureBlobFileSystemCLI extends AbstractAbfsIntegrationTest {
public ITestAzureBlobFileSystemCLI() throws Exception {
super();
final AbfsConfiguration conf = getConfiguration();
conf.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, false);
}
/**
@ -51,14 +49,14 @@ public class ITestAzureBlobFileSystemCLI extends AbstractAbfsIntegrationTest {
@Test
public void testMkdirRootNonExistentContainer() throws Exception {
final Configuration rawConf = getRawConfiguration();
FsShell fsShell = new FsShell(rawConf);
final String account =
rawConf.get(FS_AZURE_ABFS_ACCOUNT_NAME, null);
final String account = rawConf.get(FS_AZURE_ABFS_ACCOUNT_NAME, null);
rawConf.setBoolean(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION,
false);
String nonExistentContainer = "nonexistent-" + UUID.randomUUID();
FsShell fsShell = new FsShell(rawConf);
int result = fsShell.run(new String[] { "-mkdir",
ABFS_SCHEME + "://" + nonExistentContainer + "@" + account + "/" });
int result = fsShell.run(new String[] {"-mkdir",
ABFS_SCHEME + "://" + nonExistentContainer + "@" + account + "/"});
assertEquals(1, result);
}