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
This commit is contained in:
Sneha Vijayarajan 2020-09-22 20:58:12 +00:00 committed by Thomas Marquardt
parent d166420302
commit da5db6a5a6
No known key found for this signature in database
GPG Key ID: AEB30C9E78868287

View File

@ -346,6 +346,7 @@ public void testNegativeScenariosForCreateOverwriteDisabled()
AzureBlobFileSystemStore abfsStore = fs.getAbfsStore(); AzureBlobFileSystemStore abfsStore = fs.getAbfsStore();
abfsStore = setAzureBlobSystemStoreField(abfsStore, "client", mockClient); abfsStore = setAzureBlobSystemStoreField(abfsStore, "client", mockClient);
boolean isNamespaceEnabled = abfsStore.getIsNamespaceEnabled();
AbfsRestOperation successOp = mock( AbfsRestOperation successOp = mock(
AbfsRestOperation.class); AbfsRestOperation.class);
@ -363,6 +364,7 @@ public void testNegativeScenariosForCreateOverwriteDisabled()
AbfsRestOperationException preConditionResponseEx AbfsRestOperationException preConditionResponseEx
= getMockAbfsRestOperationException(HTTP_PRECON_FAILED); = getMockAbfsRestOperationException(HTTP_PRECON_FAILED);
// mock for overwrite=false
doThrow(conflictResponseEx) // Scn1: GFS fails with Http404 doThrow(conflictResponseEx) // Scn1: GFS fails with Http404
.doThrow(conflictResponseEx) // Scn2: GFS fails with Http500 .doThrow(conflictResponseEx) // Scn2: GFS fails with Http500
.doThrow( .doThrow(
@ -372,8 +374,10 @@ public void testNegativeScenariosForCreateOverwriteDisabled()
.doThrow( .doThrow(
serverErrorResponseEx) // Scn5: create overwrite=false fails with Http500 serverErrorResponseEx) // Scn5: create overwrite=false fails with Http500
.when(mockClient) .when(mockClient)
.createPath(any(String.class), eq(true), eq(false), any(String.class), .createPath(any(String.class), eq(true), eq(false),
any(String.class), any(boolean.class), eq(null)); 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(fileNotFoundResponseEx) // Scn1: GFS fails with Http404
.doThrow(serverErrorResponseEx) // Scn2: GFS fails with Http500 .doThrow(serverErrorResponseEx) // Scn2: GFS fails with Http500
@ -382,13 +386,16 @@ public void testNegativeScenariosForCreateOverwriteDisabled()
.when(mockClient) .when(mockClient)
.getPathStatus(any(String.class), eq(false)); .getPathStatus(any(String.class), eq(false));
// mock for overwrite=true
doThrow( doThrow(
preConditionResponseEx) // Scn3: create overwrite=true fails with Http412 preConditionResponseEx) // Scn3: create overwrite=true fails with Http412
.doThrow( .doThrow(
serverErrorResponseEx) // Scn4: create overwrite=true fails with Http500 serverErrorResponseEx) // Scn4: create overwrite=true fails with Http500
.when(mockClient) .when(mockClient)
.createPath(any(String.class), eq(true), eq(true), any(String.class), .createPath(any(String.class), eq(true), eq(true),
any(String.class), any(boolean.class), eq(null)); isNamespaceEnabled ? any(String.class) : eq(null),
isNamespaceEnabled ? any(String.class) : eq(null),
any(boolean.class), eq(null));
// Scn1: GFS fails with Http404 // Scn1: GFS fails with Http404
// Sequence of events expected: // Sequence of events expected: