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