Skip to content

Commit

Permalink
fix makeBucket() with object-lock in functional test (#942)
Browse files Browse the repository at this point in the history
As minio server FS mode recently changed to return `NotImplemented`
error for `CreateBucket` with object-lock-enabled, this patch fixes
makeBucket() with object-lock functional test to handle the error
appropriately.
  • Loading branch information
balamurugana authored May 18, 2020
1 parent 91cd2a7 commit 8d139d4
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions functional/FunctionalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,25 @@ public static void makeBucket_test2() throws Exception {
mintSuccessLog(
"makeBucket(MakeBucketArgs args)", "region: eu-west-1, objectLock: true", startTime);
} catch (Exception e) {
mintFailedLog(
"makeBucket(MakeBucketArgs args)",
"region: eu-west-1, objectLock: true",
startTime,
null,
e.toString() + " >>> " + Arrays.toString(e.getStackTrace()));
throw e;
ErrorResponse errorResponse = null;
if (e instanceof ErrorResponseException) {
ErrorResponseException exp = (ErrorResponseException) e;
errorResponse = exp.errorResponse();
}

// Ignore NotImplemented error
if (errorResponse != null && errorResponse.errorCode() == ErrorCode.NOT_IMPLEMENTED) {
mintIgnoredLog(
"makeBucket(MakeBucketArgs args)", "region: eu-west-1, objectLock: true", startTime);
} else {
mintFailedLog(
"makeBucket(MakeBucketArgs args)",
"region: eu-west-1, objectLock: true",
startTime,
null,
e.toString() + " >>> " + Arrays.toString(e.getStackTrace()));
throw e;
}
}
}

Expand Down

0 comments on commit 8d139d4

Please sign in to comment.