HADOOP-16104. Wasb tests to downgrade to skip when test a/c is namespace enabled. Contributed by Masatake Iwasaki.
This commit is contained in:
parent
41e18feda3
commit
aa3ad36605
@ -32,6 +32,7 @@
|
|||||||
import org.apache.hadoop.fs.azure.integration.AzureTestConstants;
|
import org.apache.hadoop.fs.azure.integration.AzureTestConstants;
|
||||||
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation;
|
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation;
|
||||||
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemMetricsSystem;
|
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemMetricsSystem;
|
||||||
|
import org.apache.hadoop.fs.azure.integration.AzureTestUtils;
|
||||||
import org.apache.hadoop.metrics2.AbstractMetric;
|
import org.apache.hadoop.metrics2.AbstractMetric;
|
||||||
import org.apache.hadoop.metrics2.MetricsRecord;
|
import org.apache.hadoop.metrics2.MetricsRecord;
|
||||||
import org.apache.hadoop.metrics2.MetricsSink;
|
import org.apache.hadoop.metrics2.MetricsSink;
|
||||||
@ -529,6 +530,8 @@ public static CloudStorageAccount createTestAccount()
|
|||||||
|
|
||||||
static CloudStorageAccount createTestAccount(Configuration conf)
|
static CloudStorageAccount createTestAccount(Configuration conf)
|
||||||
throws URISyntaxException, KeyProviderException {
|
throws URISyntaxException, KeyProviderException {
|
||||||
|
AzureTestUtils.assumeNamespaceDisabled(conf);
|
||||||
|
|
||||||
String testAccountName = verifyWasbAccountNameInConfig(conf);
|
String testAccountName = verifyWasbAccountNameInConfig(conf);
|
||||||
if (testAccountName == null) {
|
if (testAccountName == null) {
|
||||||
LOG.warn("Skipping live Azure test because of missing test account");
|
LOG.warn("Skipping live Azure test because of missing test account");
|
||||||
|
@ -34,6 +34,7 @@ public class NativeAzureFileSystemContract extends AbstractBondedFSContract {
|
|||||||
public NativeAzureFileSystemContract(Configuration conf) {
|
public NativeAzureFileSystemContract(Configuration conf) {
|
||||||
super(conf); //insert the base features
|
super(conf); //insert the base features
|
||||||
addConfResource(CONTRACT_XML);
|
addConfResource(CONTRACT_XML);
|
||||||
|
AzureTestUtils.assumeNamespaceDisabled(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
import static org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount.WASB_ACCOUNT_NAME_DOMAIN_SUFFIX_REGEX;
|
import static org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount.WASB_ACCOUNT_NAME_DOMAIN_SUFFIX_REGEX;
|
||||||
import static org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount.WASB_TEST_ACCOUNT_NAME_WITH_DOMAIN;
|
import static org.apache.hadoop.fs.azure.AzureBlobStorageTestAccount.WASB_TEST_ACCOUNT_NAME_WITH_DOMAIN;
|
||||||
import static org.apache.hadoop.fs.azure.integration.AzureTestConstants.*;
|
import static org.apache.hadoop.fs.azure.integration.AzureTestConstants.*;
|
||||||
|
import static org.apache.hadoop.fs.azurebfs.constants.TestConfigurationKeys.FS_AZURE_TEST_NAMESPACE_ENABLED_ACCOUNT;
|
||||||
import static org.apache.hadoop.test.MetricsAsserts.getLongCounter;
|
import static org.apache.hadoop.test.MetricsAsserts.getLongCounter;
|
||||||
import static org.apache.hadoop.test.MetricsAsserts.getLongGauge;
|
import static org.apache.hadoop.test.MetricsAsserts.getLongGauge;
|
||||||
import static org.apache.hadoop.test.MetricsAsserts.getMetrics;
|
import static org.apache.hadoop.test.MetricsAsserts.getMetrics;
|
||||||
@ -545,4 +546,12 @@ public static String readStringFromStream(FSDataInputStream inputStream) throws
|
|||||||
inputStream.close();
|
inputStream.close();
|
||||||
return new String(buffer, 0, count);
|
return new String(buffer, 0, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assume hierarchical namespace is disabled for test account.
|
||||||
|
*/
|
||||||
|
public static void assumeNamespaceDisabled(Configuration conf) {
|
||||||
|
Assume.assumeFalse("Hierarchical namespace is enabled for test account.",
|
||||||
|
conf.getBoolean(FS_AZURE_TEST_NAMESPACE_ENABLED_ACCOUNT, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
<value>false</value>
|
<value>false</value>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
<property>
|
||||||
|
<name>fs.azure.test.namespace.enabled</name>
|
||||||
|
<value>false</value>
|
||||||
|
</property>
|
||||||
|
|
||||||
<!--==================== ABFS CONFIGURATION ====================-->
|
<!--==================== ABFS CONFIGURATION ====================-->
|
||||||
<!-- SEE relevant section in "site/markdown/testing_azure.md"-->
|
<!-- SEE relevant section in "site/markdown/testing_azure.md"-->
|
||||||
|
|
||||||
|
@ -161,4 +161,9 @@
|
|||||||
<value>true</value>
|
<value>true</value>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
<property>
|
||||||
|
<name>fs.azure.test.namespace.enabled</name>
|
||||||
|
<value>false</value>
|
||||||
|
</property>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in New Issue
Block a user