Skip to content

Commit

Permalink
Handle "Not implemented" error codes in functional test
Browse files Browse the repository at this point in the history
Check for the error message "Not Implemented" in ComposeObject
API call. If it is seen, log NA for the test and log the error, but continue
with the test.

Fixes #834
  • Loading branch information
kannappanr committed Oct 6, 2017
1 parent 9690dc6 commit 9fd2d9d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ func ignoredLog(function string, args map[string]interface{}, startTime time.Tim
return log.WithFields(fields)
}

func isErrNotImplemented(err error) bool {
errResp := minio.ToErrorResponse(err)
return errResp.Code != "NotImplemented"
}

func init() {
// If server endpoint is not set, all tests default to
// using https://play.minio.io:9000
Expand Down Expand Up @@ -4478,6 +4483,10 @@ func testComposeMultipleSources(c *minio.Client) {
}
err = c.ComposeObject(dst, srcs)
if err != nil {
if isErrNotImplemented(err) {
ignoredLog(function, args, startTime, err.Error()).Info()
return
}
failureLog(function, args, startTime, "", "ComposeObject failed", err).Fatal()
}

Expand Down Expand Up @@ -4752,6 +4761,10 @@ func testUserMetadataCopyingWrapper(c *minio.Client) {
args["source"] = srcs

if err != nil {
if isErrNotImplemented(err) {
ignoredLog(function, args, startTime, err.Error()).Info()
return
}
failureLog(function, args, startTime, "", "ComposeObject failed", err).Fatal()
}

Expand All @@ -4776,6 +4789,10 @@ func testUserMetadataCopyingWrapper(c *minio.Client) {
args["source"] = srcs

if err != nil {
if isErrNotImplemented(err) {
ignoredLog(function, args, startTime, err.Error()).Info()
return
}
failureLog(function, args, startTime, "", "ComposeObject failed", err).Fatal()
}

Expand Down

0 comments on commit 9fd2d9d

Please sign in to comment.