fix: Added KeyCount property in ListObjectsV2 action result, added a test case for one

This commit is contained in:
jonaustin09
2023-07-25 20:44:57 +04:00
parent 7c08ea44a6
commit 1649c5cafd
2 changed files with 5 additions and 0 deletions

View File

@@ -1317,6 +1317,7 @@ func (p *Posix) ListObjectsV2(input *s3.ListObjectsV2Input) (*s3.ListObjectsV2Ou
Name: &bucket,
NextContinuationToken: &results.NextMarker,
Prefix: &prefix,
KeyCount: int32(len(results.Objects)),
}, nil
}

View File

@@ -426,6 +426,10 @@ func TestListObject(s *S3Conf) {
failF("object %v not found", obj2)
return
}
if out.KeyCount != 2 {
failF("%v: expected key count: %v, instead got: %v", testname, 2, out.KeyCount)
return
}
ctx, cancel = context.WithTimeout(context.Background(), shortTimeout)
_, err = s3client.DeleteObject(ctx, &s3.DeleteObjectInput{