You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by tm...@apache.org on 2020/10/14 22:39:34 UTC
[hadoop] 08/09: HADOOP-17279: ABFS:
testNegativeScenariosForCreateOverwriteDisabled fails for non-HNS account.
This is an automated email from the ASF dual-hosted git repository.
tmarquardt pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit da5db6a5a66d13fd8ba71b127bd6f16a1e3dade8
Author: Sneha Vijayarajan <sn...@microsoft.com>
AuthorDate: Tue Sep 22 20:58:12 2020 +0000
HADOOP-17279: ABFS: testNegativeScenariosForCreateOverwriteDisabled fails for non-HNS account.
Contributed by Sneha Vijayarajan
Testing:
namespace.enabled=false
auth.type=SharedKey
$mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify
Tests run: 87, Failures: 0, Errors: 0, Skipped: 0
Tests run: 457, Failures: 0, Errors: 0, Skipped: 246
Tests run: 207, Failures: 0, Errors: 0, Skipped: 24
namespace.enabled=true
auth.type=SharedKey
$mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify
Tests run: 87, Failures: 0, Errors: 0, Skipped: 0
Tests run: 457, Failures: 0, Errors: 0, Skipped: 33
Tests run: 207, Failures: 0, Errors: 0, Skipped: 24
namespace.enabled=true
auth.type=OAuth
$mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify
Tests run: 87, Failures: 0, Errors: 0, Skipped: 0
Tests run: 457, Failures: 0, Errors: 0, Skipped: 74
Tests run: 207, Failures: 0, Errors: 0, Skipped: 140
---
.../fs/azurebfs/ITestAzureBlobFileSystemCreate.java | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java
index 981ed25..09304d1 100644
--- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java
+++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java
@@ -346,6 +346,7 @@ public class ITestAzureBlobFileSystemCreate extends
AzureBlobFileSystemStore abfsStore = fs.getAbfsStore();
abfsStore = setAzureBlobSystemStoreField(abfsStore, "client", mockClient);
+ boolean isNamespaceEnabled = abfsStore.getIsNamespaceEnabled();
AbfsRestOperation successOp = mock(
AbfsRestOperation.class);
@@ -363,6 +364,7 @@ public class ITestAzureBlobFileSystemCreate extends
AbfsRestOperationException preConditionResponseEx
= getMockAbfsRestOperationException(HTTP_PRECON_FAILED);
+ // mock for overwrite=false
doThrow(conflictResponseEx) // Scn1: GFS fails with Http404
.doThrow(conflictResponseEx) // Scn2: GFS fails with Http500
.doThrow(
@@ -372,8 +374,10 @@ public class ITestAzureBlobFileSystemCreate extends
.doThrow(
serverErrorResponseEx) // Scn5: create overwrite=false fails with Http500
.when(mockClient)
- .createPath(any(String.class), eq(true), eq(false), any(String.class),
- any(String.class), any(boolean.class), eq(null));
+ .createPath(any(String.class), eq(true), eq(false),
+ isNamespaceEnabled ? any(String.class) : eq(null),
+ isNamespaceEnabled ? any(String.class) : eq(null),
+ any(boolean.class), eq(null));
doThrow(fileNotFoundResponseEx) // Scn1: GFS fails with Http404
.doThrow(serverErrorResponseEx) // Scn2: GFS fails with Http500
@@ -382,13 +386,16 @@ public class ITestAzureBlobFileSystemCreate extends
.when(mockClient)
.getPathStatus(any(String.class), eq(false));
+ // mock for overwrite=true
doThrow(
preConditionResponseEx) // Scn3: create overwrite=true fails with Http412
.doThrow(
serverErrorResponseEx) // Scn4: create overwrite=true fails with Http500
.when(mockClient)
- .createPath(any(String.class), eq(true), eq(true), any(String.class),
- any(String.class), any(boolean.class), eq(null));
+ .createPath(any(String.class), eq(true), eq(true),
+ isNamespaceEnabled ? any(String.class) : eq(null),
+ isNamespaceEnabled ? any(String.class) : eq(null),
+ any(boolean.class), eq(null));
// Scn1: GFS fails with Http404
// Sequence of events expected:
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org