[#665] Prevent ContinuationToken duplication in ListObjectsV2 result
All checks were successful
/ DCO (pull_request) Successful in 29s
/ Vulncheck (pull_request) Successful in 1m8s
/ Builds (pull_request) Successful in 1m22s
/ OCI image (pull_request) Successful in 1m59s
/ Lint (pull_request) Successful in 2m0s
/ Tests (pull_request) Successful in 1m19s
/ Vulncheck (push) Successful in 1m11s
/ Builds (push) Successful in 1m32s
/ OCI image (push) Successful in 2m9s
/ Lint (push) Successful in 2m16s
/ Tests (push) Successful in 1m33s
All checks were successful
/ DCO (pull_request) Successful in 29s
/ Vulncheck (pull_request) Successful in 1m8s
/ Builds (pull_request) Successful in 1m22s
/ OCI image (pull_request) Successful in 1m59s
/ Lint (pull_request) Successful in 2m0s
/ Tests (pull_request) Successful in 1m19s
/ Vulncheck (push) Successful in 1m11s
/ Builds (push) Successful in 1m32s
/ OCI image (push) Successful in 2m9s
/ Lint (push) Successful in 2m16s
/ Tests (push) Successful in 1m33s
Signed-off-by: Aleksey Kravchenko <al.kravchenko@yadro.com>
This commit is contained in:
parent
646f59abfd
commit
c0c99a1839
2 changed files with 25 additions and 2 deletions
|
@ -938,6 +938,29 @@ func TestPeriodicWriter(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestListObjectsNotDuplicateContinuationToken(t *testing.T) {
|
||||
tc := prepareHandlerContext(t)
|
||||
|
||||
bktName := "bucket-for-listing"
|
||||
bktInfo := createTestBucket(tc, bktName)
|
||||
|
||||
for _, name := range []string{"bar /baz", "bar baz/foo", "bar/baz"} {
|
||||
createTestObject(tc, bktInfo, name, encryption.Params{})
|
||||
}
|
||||
|
||||
t.Run("list v2", func(t *testing.T) {
|
||||
res1 := listObjectsV2(tc, bktName, "", "", "", "", 1)
|
||||
res2 := listObjectsV2(tc, bktName, "", "", "", res1.NextContinuationToken, 1)
|
||||
require.NotEqual(t, res1.NextContinuationToken, res2.NextContinuationToken)
|
||||
})
|
||||
|
||||
t.Run("list versions", func(t *testing.T) {
|
||||
res1 := listObjectsVersions(tc, bktName, "", "", "", "", 1)
|
||||
res2 := listObjectsVersions(tc, bktName, "", "", res1.NextKeyMarker, res1.NextVersionIDMarker, 1)
|
||||
require.NotEqual(t, res1.NextVersionIDMarker, res2.NextVersionIDMarker)
|
||||
})
|
||||
}
|
||||
|
||||
func checkVersionsNames(t *testing.T, versions *ListObjectsVersionsResponse, names []string) {
|
||||
for i, v := range versions.Version {
|
||||
require.Equal(t, names[i], v.Key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue