Mint - Add AWS SDK Go tests (#12097)

* Add aws-sdk-go tests: extend testListObjectVersionsSimple with error cases

* Add aws-sdk-go tests: extend testListMultipartUploads with error cases

Co-authored-by: Andre Bruch <ab@andrebruch.com>
Signed-off-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
iternity-dotcom
2021-04-20 18:40:03 +02:00
committed by Harshavardhana
parent 445d080826
commit 046e8fd17e
2 changed files with 64 additions and 0 deletions

View File

@@ -951,6 +951,29 @@ func testListMultipartUploads(s3Client *s3.S3) {
return
}
// Error cases
// MaxParts < 0
lpInput := &s3.ListPartsInput{
Bucket: aws.String(bucket),
Key: aws.String(object),
UploadId: multipartUpload.UploadId,
MaxParts: aws.Int64(-1),
}
listParts, err = s3Client.ListParts(lpInput)
if err == nil {
failureLog(function, args, startTime, "", "AWS SDK Go ListPartsInput API (MaxParts < 0) failed for", err).Fatal()
return
}
// PartNumberMarker < 0
lpInput.PartNumberMarker = aws.Int64(-1)
listParts, err = s3Client.ListParts(lpInput)
if err == nil {
failureLog(function, args, startTime, "", "AWS SDK Go ListPartsInput API (PartNumberMarker < 0) failed for", err).Fatal()
return
}
successLogger(function, args, startTime).Info()
}