From f283b98d127d543132345e45350d07341517ca32 Mon Sep 17 00:00:00 2001 From: Andre Duffeck Date: Thu, 10 Feb 2022 14:48:17 +0100 Subject: [PATCH] Upgrade to ginkgo v2, increase test coverage (#2526) * Upgrade to ginkgo v2 * Fix root info being counted twice * Do not try to list child non-containers * Improve generating response xml * DRY up code * Increase test coverage, port EncodePath benchmark to ginkgo Also add an assertion that its performanc does not decrease too much. * Add changelog * Fix hound issue * Add missing license header * Fix linter issue --- changelog/unreleased/upgrade-ginkgo.md | 3 + go.mod | 4 +- go.sum | 10 +- .../sharesstorageprovider_suite_test.go | 2 +- .../sharesstorageprovider_test.go | 2 +- .../owncloud/ocdav/net/context_test.go | 59 ++ .../owncloud/ocdav/net/net_suite_test.go | 31 + .../services/owncloud/ocdav/net/net_test.go | 112 ++- .../owncloud/ocdav/ocdav_suite_test.go | 2 +- .../services/owncloud/ocdav/ocdav_test.go | 13 - .../owncloud/ocdav/propfind/propfind.go | 240 ++++--- .../ocdav/propfind/propfind_suite_test.go | 2 +- .../owncloud/ocdav/propfind/propfind_test.go | 674 +++++++++++++++++- .../apps/sharing/shares/pending_test.go | 2 +- .../apps/sharing/shares/shares_suite_test.go | 2 +- .../apps/sharing/shares/shares_test.go | 2 +- .../manager/nextcloud/nextcloud_suite_test.go | 2 +- pkg/auth/manager/nextcloud/nextcloud_test.go | 2 +- .../accounts/accounts_suite_test.go | 2 +- .../owncloudsql/accounts/accounts_test.go | 2 +- .../manager/nextcloud/nextcloud_suite_test.go | 2 +- .../share/manager/nextcloud/nextcloud_test.go | 2 +- pkg/share/manager/sql/sql_suite_test.go | 2 +- pkg/share/manager/sql/sql_test.go | 2 +- .../fs/nextcloud/nextcloud_suite_test.go | 2 +- pkg/storage/fs/nextcloud/nextcloud_test.go | 2 +- .../fs/ocis/blobstore/blobstore_suite_test.go | 2 +- .../fs/ocis/blobstore/blobstore_test.go | 2 +- pkg/storage/fs/ocis/ocis_suite_test.go | 2 +- pkg/storage/fs/ocis/ocis_test.go | 2 +- .../filecache/filecache_suite_test.go | 2 +- .../owncloudsql/filecache/filecache_test.go | 2 +- pkg/storage/fs/s3ng/option_test.go | 2 +- pkg/storage/fs/s3ng/s3ng_suite_test.go | 2 +- pkg/storage/fs/s3ng/s3ng_test.go | 2 +- .../registry/spaces/spaces_suite_test.go | 2 +- pkg/storage/registry/spaces/spaces_test.go | 2 +- .../registry/static/static_suite_test.go | 2 +- pkg/storage/registry/static/static_test.go | 2 +- pkg/storage/utils/ace/ace_suite_test.go | 2 +- pkg/storage/utils/ace/ace_test.go | 2 +- .../decomposedfs_concurrency_test.go | 2 +- .../decomposedfs/decomposedfs_suite_test.go | 2 +- .../utils/decomposedfs/decomposedfs_test.go | 2 +- pkg/storage/utils/decomposedfs/grants_test.go | 2 +- pkg/storage/utils/decomposedfs/lookup_test.go | 2 +- .../utils/decomposedfs/node/locks_test.go | 2 +- .../decomposedfs/node/node_suite_test.go | 2 +- .../utils/decomposedfs/node/node_test.go | 2 +- .../options/options_suite_test.go | 2 +- .../decomposedfs/options/options_test.go | 2 +- .../utils/decomposedfs/recycle_test.go | 2 +- .../decomposedfs/tree/tree_suite_test.go | 2 +- .../utils/decomposedfs/tree/tree_test.go | 2 +- pkg/storage/utils/decomposedfs/upload_test.go | 2 +- .../manager/nextcloud/nextcloud_suite_test.go | 2 +- pkg/user/manager/nextcloud/nextcloud_test.go | 2 +- .../accounts/accounts_suite_test.go | 2 +- .../owncloudsql/accounts/accounts_test.go | 2 +- .../gateway_storageprovider_static_test.go | 2 +- .../grpc/gateway_storageprovider_test.go | 2 +- tests/integration/grpc/grpc_suite_test.go | 2 +- .../integration/grpc/storageprovider_test.go | 2 +- tests/integration/grpc/userprovider_test.go | 2 +- 64 files changed, 1037 insertions(+), 219 deletions(-) create mode 100644 changelog/unreleased/upgrade-ginkgo.md create mode 100644 internal/http/services/owncloud/ocdav/net/context_test.go create mode 100644 internal/http/services/owncloud/ocdav/net/net_suite_test.go diff --git a/changelog/unreleased/upgrade-ginkgo.md b/changelog/unreleased/upgrade-ginkgo.md new file mode 100644 index 00000000000..dca15641d0f --- /dev/null +++ b/changelog/unreleased/upgrade-ginkgo.md @@ -0,0 +1,3 @@ +Enhancement: upgrade ginkgo to v2 + +https://github.com/cs3org/reva/pull/2526 \ No newline at end of file diff --git a/go.mod b/go.mod index 21feb75ecda..682a62c9460 100644 --- a/go.mod +++ b/go.mod @@ -48,8 +48,8 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.4.3 - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.18.0 + github.com/onsi/ginkgo/v2 v2.0.0 + github.com/onsi/gomega v1.18.1 github.com/pkg/errors v0.9.1 github.com/pkg/xattr v0.4.4 github.com/pquerna/cachecontrol v0.1.0 // indirect diff --git a/go.sum b/go.sum index 3c41296610b..a86e76abb8e 100644 --- a/go.sum +++ b/go.sum @@ -158,7 +158,6 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gdexlab/go-render v1.0.1 h1:rxqB3vo5s4n1kF0ySmoNeSPRYkEsyHgln4jFIQY7v0U= github.com/gdexlab/go-render v1.0.1/go.mod h1:wRi5nW2qfjiGj4mPukH4UV0IknS1cHD4VgFTmJX5JzM= @@ -563,7 +562,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -573,17 +571,16 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= -github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1192,7 +1189,6 @@ gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_suite_test.go b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_suite_test.go index fceaad3ed32..36dbf5036ab 100644 --- a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_suite_test.go +++ b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_suite_test.go @@ -21,7 +21,7 @@ package sharesstorageprovider_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_test.go b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_test.go index cbd1628ca8b..bdd41097964 100644 --- a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_test.go +++ b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider_test.go @@ -37,7 +37,7 @@ import ( "github.com/cs3org/reva/pkg/utils" "google.golang.org/grpc" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/stretchr/testify/mock" ) diff --git a/internal/http/services/owncloud/ocdav/net/context_test.go b/internal/http/services/owncloud/ocdav/net/context_test.go new file mode 100644 index 00000000000..af653e74778 --- /dev/null +++ b/internal/http/services/owncloud/ocdav/net/context_test.go @@ -0,0 +1,59 @@ +// Copyright 2018-2022 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +package net_test + +import ( + "context" + + userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" + "github.com/cs3org/reva/internal/http/services/owncloud/ocdav/net" + ctxpkg "github.com/cs3org/reva/pkg/ctx" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("Net", func() { + var ( + alice = &userpb.User{ + Id: &userpb.UserId{ + OpaqueId: "alice", + }, + Username: "alice", + } + bob = &userpb.User{ + Id: &userpb.UserId{ + OpaqueId: "bob", + }, + Username: "bob", + } + aliceCtx = ctxpkg.ContextSetUser(context.Background(), alice) + bobCtx = ctxpkg.ContextSetUser(context.Background(), bob) + ) + + Describe("IsCurrentUserOwner", func() { + It("returns true", func() { + Expect(net.IsCurrentUserOwner(aliceCtx, alice.Id)).To(BeTrue()) + }) + + It("returns false", func() { + Expect(net.IsCurrentUserOwner(bobCtx, alice.Id)).To(BeFalse()) + }) + }) +}) diff --git a/internal/http/services/owncloud/ocdav/net/net_suite_test.go b/internal/http/services/owncloud/ocdav/net/net_suite_test.go new file mode 100644 index 00000000000..5760c91b472 --- /dev/null +++ b/internal/http/services/owncloud/ocdav/net/net_suite_test.go @@ -0,0 +1,31 @@ +// Copyright 2018-2021 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +package net_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestNet(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Net Suite") +} diff --git a/internal/http/services/owncloud/ocdav/net/net_test.go b/internal/http/services/owncloud/ocdav/net/net_test.go index 2b0e2c32aaa..17c8eb27a07 100644 --- a/internal/http/services/owncloud/ocdav/net/net_test.go +++ b/internal/http/services/owncloud/ocdav/net/net_test.go @@ -16,40 +16,78 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -package net - -import "testing" - -func TestParseDepth(t *testing.T) { - tests := map[string]Depth{ - "": DepthOne, - "0": DepthZero, - "1": DepthOne, - "infinity": DepthInfinity, - } - - for input, expected := range tests { - parsed, err := ParseDepth(input) - if err != nil { - t.Errorf("failed to parse depth %s", input) - } - if parsed != expected { - t.Errorf("parseDepth returned %s expected %s", parsed.String(), expected.String()) - } - } - - _, err := ParseDepth("invalid") - if err == nil { - t.Error("parse depth didn't return an error for invalid depth: invalid") - } -} - -var result Depth - -func BenchmarkParseDepth(b *testing.B) { - inputs := []string{"", "0", "1", "infinity", "INFINITY"} - size := len(inputs) - for i := 0; i < b.N; i++ { - result, _ = ParseDepth(inputs[i%size]) - } -} +package net_test + +import ( + "time" + + "github.com/cs3org/reva/internal/http/services/owncloud/ocdav/net" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gmeasure" +) + +var _ = Describe("Net", func() { + DescribeTable("TestParseDepth", + func(v string, expectSuccess bool, expectedValue net.Depth) { + parsed, err := net.ParseDepth(v) + Expect(err == nil).To(Equal(expectSuccess)) + Expect(parsed).To(Equal(expectedValue)) + }, + Entry("default", "", true, net.DepthOne), + Entry("0", "0", true, net.DepthZero), + Entry("1", "1", true, net.DepthOne), + Entry("infinity", "infinity", true, net.DepthInfinity), + Entry("invalid", "invalid", false, net.Depth(""))) + + Describe("ParseDepth", func() { + It("is reasonably fast", func() { + experiment := NewExperiment("Parsing depth headers") + AddReportEntry(experiment.Name, experiment) + + inputs := []string{"", "0", "1", "infinity", "INFINITY"} + size := len(inputs) + experiment.Sample(func(i int) { + experiment.MeasureDuration("parsing", func() { + _, _ = net.ParseDepth(inputs[i%size]) + }) + }, SamplingConfig{Duration: time.Second}) + + encodingStats := experiment.GetStats("parsing") + medianDuration := encodingStats.DurationFor(StatMedian) + + Expect(medianDuration).To(BeNumerically("<", 3*time.Millisecond)) + }) + }) + + Describe("EncodePath", func() { + It("encodes paths", func() { + Expect(net.EncodePath("foo")).To(Equal("foo")) + Expect(net.EncodePath("/some/path/Folder %^*(#1)")).To(Equal("/some/path/Folder%20%25%5e%2a(%231)")) + }) + + /* + The encodePath method as it is implemented currently is terribly inefficient. + As soon as there are a few special characters which need to be escaped the allocation count rises and the time spent too. + Adding more special characters increases the allocations and the time spent can rise up to a few milliseconds. + Granted this is not a lot on it's own but when a user has tens or hundreds of paths which need to be escaped and contain a few special characters + then this method alone will cost a huge amount of time. + */ + It("is reasonably fast", func() { + experiment := NewExperiment("Encoding paths") + AddReportEntry(experiment.Name, experiment) + + experiment.Sample(func(idx int) { + experiment.MeasureDuration("encoding", func() { + _ = net.EncodePath("/some/path/Folder %^*(#1)") + }) + }, SamplingConfig{Duration: time.Second}) + + encodingStats := experiment.GetStats("encoding") + medianDuration := encodingStats.DurationFor(StatMedian) + + Expect(medianDuration).To(BeNumerically("<", 10*time.Millisecond)) + }) + }) +}) diff --git a/internal/http/services/owncloud/ocdav/ocdav_suite_test.go b/internal/http/services/owncloud/ocdav/ocdav_suite_test.go index c31853b080f..26639ca7811 100644 --- a/internal/http/services/owncloud/ocdav/ocdav_suite_test.go +++ b/internal/http/services/owncloud/ocdav/ocdav_suite_test.go @@ -21,7 +21,7 @@ package ocdav_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/internal/http/services/owncloud/ocdav/ocdav_test.go b/internal/http/services/owncloud/ocdav/ocdav_test.go index 98c60afa33c..bcf63f63363 100644 --- a/internal/http/services/owncloud/ocdav/ocdav_test.go +++ b/internal/http/services/owncloud/ocdav/ocdav_test.go @@ -29,19 +29,6 @@ import ( "github.com/cs3org/reva/pkg/utils/resourceid" ) -/* -The encodePath method as it is implemented currently is terribly inefficient. -As soon as there are a few special characters which need to be escaped the allocation count rises and the time spent too. -Adding more special characters increases the allocations and the time spent can rise up to a few milliseconds. -Granted this is not a lot on it's own but when a user has tens or hundreds of paths which need to be escaped and contain a few special characters -then this method alone will cost a huge amount of time. -*/ -func BenchmarkEncodePath(b *testing.B) { - for i := 0; i < b.N; i++ { - _ = net.EncodePath("/some/path/Folder %^*(#1)") - } -} - func TestWrapResourceID(t *testing.T) { expected := "c3RvcmFnZWlkOm9wYXF1ZWlk" wrapped := resourceid.OwnCloudResourceIDWrap(&providerv1beta1.ResourceId{StorageId: "storageid", OpaqueId: "opaqueid"}) diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind.go b/internal/http/services/owncloud/ocdav/propfind/propfind.go index b1aadcf8ee8..59043a39501 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind.go @@ -19,7 +19,6 @@ package propfind import ( - "bytes" "context" "encoding/json" "encoding/xml" @@ -57,7 +56,102 @@ import ( //go:generate mockery -name GatewayClient -// GatewayClient is the interface that's being uses to interact with the gateway +type countingReader struct { + n int + r io.Reader +} + +// Props represents properties related to a resource +// http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop (for propfind) +type Props []xml.Name + +// XML holds the xml representation of a propfind +// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propfind +type XML struct { + XMLName xml.Name `xml:"DAV: propfind"` + Allprop *struct{} `xml:"DAV: allprop"` + Propname *struct{} `xml:"DAV: propname"` + Prop Props `xml:"DAV: prop"` + Include Props `xml:"DAV: include"` +} + +// PropstatXML holds the xml representation of a propfind response +// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat +type PropstatXML struct { + // Prop requires DAV: to be the default namespace in the enclosing + // XML. This is due to the standard encoding/xml package currently + // not honoring namespace declarations inside a xmltag with a + // parent element for anonymous slice elements. + // Use of multistatusWriter takes care of this. + Prop []*props.PropertyXML `xml:"d:prop>_ignored_"` + Status string `xml:"d:status"` + Error *errors.ErrorXML `xml:"d:error"` + ResponseDescription string `xml:"d:responsedescription,omitempty"` +} + +// ResponseXML holds the xml representation of a propfind response +type ResponseXML struct { + XMLName xml.Name `xml:"d:response"` + Href string `xml:"d:href"` + Propstat []PropstatXML `xml:"d:propstat"` + Status string `xml:"d:status,omitempty"` + Error *errors.ErrorXML `xml:"d:error"` + ResponseDescription string `xml:"d:responsedescription,omitempty"` +} + +// MultiStatusResponseXML holds the xml representation of a multistatus propfind response +type MultiStatusResponseXML struct { + XMLName xml.Name `xml:"d:multistatus"` + XmlnsS string `xml:"xmlns:s,attr,omitempty"` + XmlnsD string `xml:"xmlns:d,attr,omitempty"` + XmlnsOC string `xml:"xmlns:oc,attr,omitempty"` + + Responses []*ResponseXML `xml:"d:response"` +} + +// ResponseUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400 +type ResponseUnmarshalXML struct { + XMLName xml.Name `xml:"response"` + Href string `xml:"href"` + Propstat []PropstatUnmarshalXML `xml:"propstat"` + Status string `xml:"status,omitempty"` + Error *errors.ErrorXML `xml:"d:error"` + ResponseDescription string `xml:"responsedescription,omitempty"` +} + +// MultiStatusResponseUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400 +type MultiStatusResponseUnmarshalXML struct { + XMLName xml.Name `xml:"multistatus"` + XmlnsS string `xml:"xmlns:s,attr,omitempty"` + XmlnsD string `xml:"xmlns:d,attr,omitempty"` + XmlnsOC string `xml:"xmlns:oc,attr,omitempty"` + + Responses []*ResponseUnmarshalXML `xml:"response"` +} + +// PropstatUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400 +type PropstatUnmarshalXML struct { + // Prop requires DAV: to be the default namespace in the enclosing + // XML. This is due to the standard encoding/xml package currently + // not honoring namespace declarations inside a xmltag with a + // parent element for anonymous slice elements. + // Use of multistatusWriter takes care of this. + Prop []*props.PropertyXML `xml:"prop"` + Status string `xml:"status"` + Error *errors.ErrorXML `xml:"d:error"` + ResponseDescription string `xml:"responsedescription,omitempty"` +} + +// NewMultiStatusResponseXML returns a preconfigured instance of MultiStatusResponseXML +func NewMultiStatusResponseXML() *MultiStatusResponseXML { + return &MultiStatusResponseXML{ + XmlnsD: "DAV:", + XmlnsS: "http://sabredav.org/ns", + XmlnsOC: "http://owncloud.org/ns", + } +} + +// GatewayClient is the interface that's being used to interact with the gateway type GatewayClient interface { gateway.GatewayAPIClient } @@ -106,7 +200,7 @@ func (p *Handler) HandlePathPropfind(w http.ResponseWriter, r *http.Request, ns return } - spaces, rpcStatus, err := spacelookup.LookUpStorageSpacesForPathWithChildren(ctx, client.(gateway.GatewayAPIClient), fn) + spaces, rpcStatus, err := spacelookup.LookUpStorageSpacesForPathWithChildren(ctx, client, fn) if err != nil { sublog.Error().Err(err).Msg("error sending a grpc request") w.WriteHeader(http.StatusInternalServerError) @@ -147,7 +241,7 @@ func (p *Handler) HandleSpacesPropfind(w http.ResponseWriter, r *http.Request, s } // retrieve a specific storage space - space, rpcStatus, err := spacelookup.LookUpStorageSpaceByID(ctx, client.(gateway.GatewayAPIClient), spaceID) + space, rpcStatus, err := spacelookup.LookUpStorageSpaceByID(ctx, client, spaceID) if err != nil { sublog.Error().Err(err).Msg("error looking up the space by id") w.WriteHeader(http.StatusInternalServerError) @@ -288,7 +382,7 @@ func (p *Handler) getResourceInfos(ctx context.Context, w http.ResponseWriter, r // TODO separate stats to the path or to the children, after statting all children update the mtime/etag // TODO get mtime, and size from space as well, so we no longer have to stat here? spaceRef := spacelookup.MakeRelativeReference(space, requestPath, spacesPropfind) - info, status, err := p.statSpace(ctx, client.(gateway.GatewayAPIClient), space, spaceRef, metadataKeys) + info, status, err := p.statSpace(ctx, client, space, spaceRef, metadataKeys) if err != nil || status.Code != rpc.Code_CODE_OK { continue } @@ -303,13 +397,9 @@ func (p *Handler) getResourceInfos(ctx context.Context, w http.ResponseWriter, r spaceMap[info] = spaceRef spaceInfos = append(spaceInfos, info) - - if rootInfo == nil && requestPath == info.Path || spacesPropfind && requestPath == path.Join("/", info.Path) { + if rootInfo == nil && (requestPath == info.Path || (spacesPropfind && requestPath == path.Join("/", info.Path))) { rootInfo = info - } - - // Check if the space is a child of the requested path - if requestPath != spacePath && strings.HasPrefix(spacePath, requestPath) { + } else if requestPath != spacePath && strings.HasPrefix(spacePath, requestPath) { // Check if the space is a child of the requested path // aggregate child metadata aggregatedChildSize += info.Size if mostRecentChildInfo == nil { @@ -348,36 +438,45 @@ func (p *Handler) getResourceInfos(ctx context.Context, w http.ResponseWriter, r resourceInfos := []*provider.ResourceInfo{ rootInfo, // PROPFIND always includes the root resource } - if rootInfo.Type == provider.ResourceType_RESOURCE_TYPE_FILE { // no need to stat any other spaces, we got our file stat already return resourceInfos, true, true } childInfos := map[string]*provider.ResourceInfo{} + addChild := func(spaceInfo *provider.ResourceInfo) { + if spaceInfo == rootInfo { + return // already accounted for + } + childPath := strings.TrimPrefix(spaceInfo.Path, requestPath) + childName, tail := router.ShiftPath(childPath) + if tail != "/" { + spaceInfo.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER + spaceInfo.Checksum = nil + // TODO unset opaque checksum + } + spaceInfo.Path = path.Join(requestPath, childName) + if existingChild, ok := childInfos[childName]; ok { + // use most recent child + if existingChild.Mtime == nil || (spaceInfo.Mtime != nil && utils.TSToUnixNano(spaceInfo.Mtime) > utils.TSToUnixNano(existingChild.Mtime)) { + childInfos[childName].Mtime = spaceInfo.Mtime + childInfos[childName].Etag = spaceInfo.Etag + childInfos[childName].Size += spaceInfo.Size + } + // only update fileid if the resource is a direct child + if tail == "/" { + childInfos[childName].Id = spaceInfo.Id + } + } else { + childInfos[childName] = spaceInfo + } + } // then add children for _, spaceInfo := range spaceInfos { switch { case !spacesPropfind && spaceInfo.Type != provider.ResourceType_RESOURCE_TYPE_CONTAINER && depth != net.DepthInfinity: - // The propfind is requested for a file that exists - - childPath := strings.TrimPrefix(spaceInfo.Path, requestPath) - childName, tail := router.ShiftPath(childPath) - if tail != "/" { - spaceInfo.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER - spaceInfo.Checksum = nil - // TODO unset opaque checksum - } - spaceInfo.Path = path.Join(requestPath, childName) - if existingChild, ok := childInfos[childName]; ok { - // use most recent child - if existingChild.Mtime == nil || (spaceInfo.Mtime != nil && utils.TSToUnixNano(spaceInfo.Mtime) > utils.TSToUnixNano(existingChild.Mtime)) { - childInfos[childName] = spaceInfo - } - } else { - childInfos[childName] = spaceInfo - } + addChild(spaceInfo) case spaceInfo.Type == provider.ResourceType_RESOURCE_TYPE_CONTAINER && depth == net.DepthOne: switch { @@ -402,27 +501,7 @@ func (p *Handler) getResourceInfos(ctx context.Context, w http.ResponseWriter, r } resourceInfos = append(resourceInfos, res.Infos...) case strings.HasPrefix(spaceInfo.Path, requestPath): // space is a deep child of the requested path - childPath := strings.TrimPrefix(spaceInfo.Path, requestPath) - childName, tail := router.ShiftPath(childPath) - if tail != "/" { - spaceInfo.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER - spaceInfo.Checksum = nil - // TODO unset opaque checksum - } - if existingChild, ok := childInfos[childName]; ok { - // use most recent child - if existingChild.Mtime == nil || (spaceInfo.Mtime != nil && utils.TSToUnixNano(spaceInfo.Mtime) > utils.TSToUnixNano(existingChild.Mtime)) { - childInfos[childName].Mtime = spaceInfo.Mtime - childInfos[childName].Etag = spaceInfo.Etag - } - // only update fileid if the resource is a direct child - if tail == "/" { - childInfos[childName].Id = spaceInfo.Id - } - } else { - childInfos[childName] = spaceInfo - } - spaceInfo.Path = path.Join(requestPath, childName) + addChild(spaceInfo) default: log.Debug().Msg("unhandled") } @@ -437,6 +516,9 @@ func (p *Handler) getResourceInfos(ctx context.Context, w http.ResponseWriter, r info := stack[0] stack = stack[1:] + if info.Type != provider.ResourceType_RESOURCE_TYPE_CONTAINER { + continue + } req := &provider.ListContainerRequest{ Ref: &provider.Reference{ ResourceId: spaceInfo.Id, @@ -561,17 +643,14 @@ func MultistatusResponse(ctx context.Context, pf *XML, mds []*provider.ResourceI } responses = append(responses, res) } - responsesXML, err := xml.Marshal(&responses) + + msr := NewMultiStatusResponseXML() + msr.Responses = responses + msg, err := xml.Marshal(msr) if err != nil { return nil, err } - - var buf bytes.Buffer - buf.WriteString(``) - buf.Write(responsesXML) - buf.WriteString(``) - return buf.Bytes(), nil + return msg, nil } // mdToPropResponse converts the CS3 metadata into a webdav PropResponse @@ -1180,11 +1259,6 @@ func quoteEtag(etag string) string { return `"` + strings.Trim(etag, `"`) + `"` } -type countingReader struct { - n int - r io.Reader -} - func (c *countingReader) Read(p []byte) (int, error) { n, err := c.r.Read(p) c.n += n @@ -1200,10 +1274,6 @@ func metadataKeyOf(n *xml.Name) string { } } -// Props represents properties related to a resource -// http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop (for propfind) -type Props []xml.Name - // UnmarshalXML appends the property names enclosed within start to pn. // // It returns an error if start does not contain any properties or if @@ -1235,37 +1305,3 @@ func (pn *Props) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { } } } - -// XML holds the xml representation of a propfind -// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propfind -type XML struct { - XMLName xml.Name `xml:"DAV: propfind"` - Allprop *struct{} `xml:"DAV: allprop"` - Propname *struct{} `xml:"DAV: propname"` - Prop Props `xml:"DAV: prop"` - Include Props `xml:"DAV: include"` -} - -// ResponseXML holds the xml representation of a propfind response -type ResponseXML struct { - XMLName xml.Name `xml:"d:response"` - Href string `xml:"d:href"` - Propstat []PropstatXML `xml:"d:propstat"` - Status string `xml:"d:status,omitempty"` - Error *errors.ErrorXML `xml:"d:error"` - ResponseDescription string `xml:"d:responsedescription,omitempty"` -} - -// PropstatXML holds the xml representation of a propfind response -// http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat -type PropstatXML struct { - // Prop requires DAV: to be the default namespace in the enclosing - // XML. This is due to the standard encoding/xml package currently - // not honoring namespace declarations inside a xmltag with a - // parent element for anonymous slice elements. - // Use of multistatusWriter takes care of this. - Prop []*props.PropertyXML `xml:"d:prop>_ignored_"` - Status string `xml:"d:status"` - Error *errors.ErrorXML `xml:"d:error"` - ResponseDescription string `xml:"d:responsedescription,omitempty"` -} diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind_suite_test.go b/internal/http/services/owncloud/ocdav/propfind/propfind_suite_test.go index d02dba936bd..d7d601b592b 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind_suite_test.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind_suite_test.go @@ -21,7 +21,7 @@ package propfind_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind_test.go b/internal/http/services/owncloud/ocdav/propfind/propfind_test.go index 0109fb82a89..5cd80be3cb3 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind_test.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind_test.go @@ -20,17 +20,24 @@ package propfind_test import ( "context" + "encoding/xml" + "io" + "io/ioutil" "net/http" "net/http/httptest" "strings" + link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1" sprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" + "github.com/cs3org/reva/internal/http/services/owncloud/ocdav/net" "github.com/cs3org/reva/internal/http/services/owncloud/ocdav/propfind" "github.com/cs3org/reva/internal/http/services/owncloud/ocdav/propfind/mocks" "github.com/cs3org/reva/pkg/rgrpc/status" "github.com/stretchr/testify/mock" + "google.golang.org/grpc" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -39,14 +46,236 @@ var _ = Describe("Propfind", func() { handler *propfind.Handler client *mocks.GatewayClient ctx context.Context + + readResponse = func(r io.Reader) (*propfind.MultiStatusResponseUnmarshalXML, string, error) { + buf, err := ioutil.ReadAll(r) + if err != nil { + return nil, "", err + } + res := &propfind.MultiStatusResponseUnmarshalXML{} + err = xml.Unmarshal(buf, res) + if err != nil { + return nil, "", err + } + + return res, string(buf), nil + } + + mockStat = func(ref *sprovider.Reference, info *sprovider.ResourceInfo) { + client.On("Stat", mock.Anything, mock.MatchedBy(func(req *sprovider.StatRequest) bool { + return (ref.ResourceId.GetOpaqueId() == "" || req.Ref.ResourceId.GetOpaqueId() == ref.ResourceId.GetOpaqueId()) && + (ref.Path == "" || req.Ref.Path == ref.Path) + })).Return(&sprovider.StatResponse{ + Status: status.NewOK(ctx), + Info: info, + }, nil) + } + mockListContainer = func(ref *sprovider.Reference, infos []*sprovider.ResourceInfo) { + client.On("ListContainer", mock.Anything, mock.MatchedBy(func(req *sprovider.ListContainerRequest) bool { + match := (ref.ResourceId.GetOpaqueId() == "" || req.Ref.ResourceId.GetOpaqueId() == ref.ResourceId.GetOpaqueId()) && + (ref.Path == "" || req.Ref.Path == ref.Path) + return match + })).Return(&sprovider.ListContainerResponse{ + Status: status.NewOK(ctx), + Infos: infos, + }, nil) + } + + foospace = &sprovider.StorageSpace{ + Opaque: &typesv1beta1.Opaque{ + Map: map[string]*typesv1beta1.OpaqueEntry{ + "path": { + Decoder: "plain", + Value: []byte("/foo"), + }, + }, + }, + Id: &sprovider.StorageSpaceId{OpaqueId: "foospace"}, + Root: &sprovider.ResourceId{OpaqueId: "foospaceroot"}, + Name: "foospace", + } + fooquxspace = &sprovider.StorageSpace{ + Opaque: &typesv1beta1.Opaque{ + Map: map[string]*typesv1beta1.OpaqueEntry{ + "path": { + Decoder: "plain", + Value: []byte("/foo/qux"), + }, + }, + }, + Id: &sprovider.StorageSpaceId{OpaqueId: "fooquxspace"}, + Root: &sprovider.ResourceId{OpaqueId: "fooquxspaceroot"}, + Name: "fooquxspace", + } + fooFileShareSpace = &sprovider.StorageSpace{ + Opaque: &typesv1beta1.Opaque{ + Map: map[string]*typesv1beta1.OpaqueEntry{ + "path": { + Decoder: "plain", + Value: []byte("/foo/Shares/sharedFile"), + }, + }, + }, + Id: &sprovider.StorageSpaceId{OpaqueId: "fooFileShareSpace"}, + Root: &sprovider.ResourceId{OpaqueId: "sharedfile"}, + Name: "fooFileShareSpace", + } + fooFileShare2Space = &sprovider.StorageSpace{ + Opaque: &typesv1beta1.Opaque{ + Map: map[string]*typesv1beta1.OpaqueEntry{ + "path": { + Decoder: "plain", + Value: []byte("/foo/Shares/sharedFile2"), + }, + }, + }, + Id: &sprovider.StorageSpaceId{OpaqueId: "fooFileShareSpace2"}, + Root: &sprovider.ResourceId{OpaqueId: "sharedfile2"}, + Name: "fooFileShareSpace2", + } + fooDirShareSpace = &sprovider.StorageSpace{ + Opaque: &typesv1beta1.Opaque{ + Map: map[string]*typesv1beta1.OpaqueEntry{ + "path": { + Decoder: "plain", + Value: []byte("/foo/Shares/sharedDir"), + }, + }, + }, + Id: &sprovider.StorageSpaceId{OpaqueId: "fooDirShareSpace"}, + Root: &sprovider.ResourceId{OpaqueId: "shareddir"}, + Name: "fooDirShareSpace", + } ) JustBeforeEach(func() { - ctx = context.Background() + ctx = context.WithValue(context.Background(), net.CtxKeyBaseURI, "http://127.0.0.1:3000") client = &mocks.GatewayClient{} handler = propfind.NewHandler("127.0.0.1:3000", func() (propfind.GatewayClient, error) { return client, nil }) + + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "foospaceroot"}, Path: "."}, + &sprovider.ResourceInfo{ + Id: &sprovider.ResourceId{OpaqueId: "foospaceroot", StorageId: "foospaceroot"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Path: ".", + Size: uint64(131), + }) + mockListContainer(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "foospaceroot"}, Path: "."}, + []*sprovider.ResourceInfo{ + { + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "bar", + Size: 100, + }, + { + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "baz", + Size: 1, + }, + { + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Path: "dir", + Size: 30, + }, + }) + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "foospaceroot"}, Path: "./bar"}, + &sprovider.ResourceInfo{ + Id: &sprovider.ResourceId{StorageId: "foospace", OpaqueId: "foospacebar"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "./bar", + Size: uint64(100), + }) + mockListContainer(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "foospaceroot"}, Path: "./dir"}, + []*sprovider.ResourceInfo{ + { + Id: &sprovider.ResourceId{StorageId: "foospace", OpaqueId: "dirent"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "entry", + Size: 30, + }, + }) + + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "fooquxspaceroot"}, Path: "."}, + &sprovider.ResourceInfo{ + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Path: ".", + Size: uint64(1000), + }) + mockListContainer(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "fooquxspaceroot"}, Path: "."}, + []*sprovider.ResourceInfo{ + { + Id: &sprovider.ResourceId{OpaqueId: "fooquxspaceroot", StorageId: "fooquxspaceroot"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "quux", + Size: 1000, + }, + }) + + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "sharedfile"}, Path: "."}, + &sprovider.ResourceInfo{ + Id: &sprovider.ResourceId{OpaqueId: "sharedfile", StorageId: "sharedfile"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: ".", + Size: uint64(2000), + Mtime: &typesv1beta1.Timestamp{Seconds: 1}, + Etag: "1", + }) + + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "sharedfile2"}, Path: "."}, + &sprovider.ResourceInfo{ + Id: &sprovider.ResourceId{OpaqueId: "sharedfile2", StorageId: "sharedfile2"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: ".", + Size: uint64(2500), + Mtime: &typesv1beta1.Timestamp{Seconds: 2}, + Etag: "2", + }) + mockStat(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "shareddir"}, Path: "."}, + &sprovider.ResourceInfo{ + Id: &sprovider.ResourceId{OpaqueId: "shareddir", StorageId: "shareddir"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Path: ".", + Size: uint64(1500), + Mtime: &typesv1beta1.Timestamp{Seconds: 3}, + Etag: "3", + }) + mockListContainer(&sprovider.Reference{ResourceId: &sprovider.ResourceId{OpaqueId: "shareddir"}, Path: "."}, + []*sprovider.ResourceInfo{ + { + Id: &sprovider.ResourceId{OpaqueId: "shareddir", StorageId: "shareddir"}, + Type: sprovider.ResourceType_RESOURCE_TYPE_FILE, + Path: "something", + Size: 1500, + }, + }) + + client.On("ListPublicShares", mock.Anything, mock.Anything).Return( + func(_ context.Context, req *link.ListPublicSharesRequest, _ ...grpc.CallOption) *link.ListPublicSharesResponse { + + var shares []*link.PublicShare + if len(req.Filters) == 0 { + shares = []*link.PublicShare{} + } else { + term := req.Filters[0].Term.(*link.ListPublicSharesRequest_Filter_ResourceId) + switch { + case term != nil && term.ResourceId != nil && term.ResourceId.OpaqueId == "foospacebar": + shares = []*link.PublicShare{ + { + Id: &link.PublicShareId{OpaqueId: "share1"}, + ResourceId: &sprovider.ResourceId{StorageId: "foospace", OpaqueId: "foospacebar"}, + }, + } + default: + shares = []*link.PublicShare{} + } + } + return &link.ListPublicSharesResponse{ + Status: status.NewOK(ctx), + Share: shares, + } + }, nil) }) Describe("NewHandler", func() { @@ -55,7 +284,347 @@ var _ = Describe("Propfind", func() { }) }) + Describe("HandlePathPropfind", func() { + Context("with just one space", func() { + JustBeforeEach(func() { + client.On("ListStorageSpaces", mock.Anything, mock.MatchedBy(func(req *sprovider.ListStorageSpacesRequest) bool { + p := string(req.Opaque.Map["path"].Value) + return p == "/" || strings.HasPrefix(p, "/foo") + })).Return(&sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: []*sprovider.StorageSpace{foospace}, + }, nil) + client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: []*sprovider.StorageSpace{}, + }, nil) + }) + + It("verifies the depth header", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + req.Header.Set(net.HeaderDepth, "invalid") + req = req.WithContext(ctx) + Expect(err).ToNot(HaveOccurred()) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusBadRequest)) + }) + + It("stats a path", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + req = req.WithContext(ctx) + Expect(err).ToNot(HaveOccurred()) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(4)) + + root := res.Responses[0] + Expect(root.Href).To(Equal("http:/127.0.0.1:3000/foo/")) + Expect(string(root.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("131")) + + bar := res.Responses[1] + Expect(bar.Href).To(Equal("http:/127.0.0.1:3000/foo/bar")) + Expect(string(bar.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("100")) + + baz := res.Responses[2] + Expect(baz.Href).To(Equal("http:/127.0.0.1:3000/foo/baz")) + Expect(string(baz.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1")) + + dir := res.Responses[3] + Expect(dir.Href).To(Equal("http:/127.0.0.1:3000/foo/dir/")) + Expect(string(dir.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("30")) + }) + + It("stats a file", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo/bar", strings.NewReader("")) + req = req.WithContext(ctx) + Expect(err).ToNot(HaveOccurred()) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(1)) + + bar := res.Responses[0] + Expect(bar.Href).To(Equal("http:/127.0.0.1:3000/foo/bar")) + Expect(string(bar.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("100")) + }) + }) + + Context("with one nested file space", func() { + JustBeforeEach(func() { + client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return( + func(_ context.Context, req *sprovider.ListStorageSpacesRequest, _ ...grpc.CallOption) *sprovider.ListStorageSpacesResponse { + var spaces []*sprovider.StorageSpace + switch string(req.Opaque.Map["path"].Value) { + case "/", "/foo": + spaces = []*sprovider.StorageSpace{foospace, fooFileShareSpace} + case "/foo/Shares", "/foo/Shares/sharedFile": + spaces = []*sprovider.StorageSpace{fooFileShareSpace} + } + return &sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: spaces, + } + }, + nil) + }) + + It("stats the parent", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(5)) + + parent := res.Responses[0] + Expect(parent.Href).To(Equal("http:/127.0.0.1:3000/foo/")) + Expect(string(parent.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("2131")) + + sf := res.Responses[4] + Expect(sf.Href).To(Equal("http:/127.0.0.1:3000/foo/Shares/")) + Expect(string(sf.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("2000")) + }) + + It("stats the embedded space", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo/Shares/sharedFile", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(1)) + + sf := res.Responses[0] + Expect(sf.Href).To(Equal("http:/127.0.0.1:3000/foo/Shares/sharedFile")) + Expect(string(sf.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("2000")) + Expect(string(sf.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("Thu, 01 Jan 1970 00:00:01 GMT")) + Expect(string(sf.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring(""1"")) + }) + }) + + Context("with two nested file spaces and a nested directory space", func() { + JustBeforeEach(func() { + client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return( + func(_ context.Context, req *sprovider.ListStorageSpacesRequest, _ ...grpc.CallOption) *sprovider.ListStorageSpacesResponse { + var spaces []*sprovider.StorageSpace + switch string(req.Opaque.Map["path"].Value) { + case "/", "/foo": + spaces = []*sprovider.StorageSpace{foospace, fooFileShareSpace, fooFileShare2Space, fooDirShareSpace} + case "/foo/Shares": + spaces = []*sprovider.StorageSpace{fooFileShareSpace, fooFileShare2Space, fooDirShareSpace} + case "/foo/Shares/sharedFile": + spaces = []*sprovider.StorageSpace{fooFileShareSpace} + case "/foo/Shares/sharedFile2": + spaces = []*sprovider.StorageSpace{fooFileShare2Space} + } + return &sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: spaces, + } + }, + nil) + }) + + It("stats the parent", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(5)) + + parent := res.Responses[0] + Expect(parent.Href).To(Equal("http:/127.0.0.1:3000/foo/")) + Expect(string(parent.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("6131")) + + shares := res.Responses[4] + Expect(shares.Href).To(Equal("http:/127.0.0.1:3000/foo/Shares/")) + Expect(string(shares.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("6000")) + Expect(string(shares.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("Thu, 01 Jan 1970 00:00:03 GMT")) + Expect(string(shares.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring(""3"")) + }) + + It("stats the embedded space", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo/Shares/sharedFile", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(1)) + + sf := res.Responses[0] + Expect(sf.Href).To(Equal("http:/127.0.0.1:3000/foo/Shares/sharedFile")) + Expect(string(sf.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("2000")) + }) + + It("includes all the things™ when depth is infinity", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + req.Header.Add(net.HeaderDepth, "infinity") + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(9)) + + paths := []string{} + for _, r := range res.Responses { + paths = append(paths, r.Href) + } + Expect(paths).To(ConsistOf( + "http:/127.0.0.1:3000/foo/", + "http:/127.0.0.1:3000/foo/bar", + "http:/127.0.0.1:3000/foo/baz", + "http:/127.0.0.1:3000/foo/dir/", + "http:/127.0.0.1:3000/foo/dir/entry", + "http:/127.0.0.1:3000/foo/Shares/sharedFile", + "http:/127.0.0.1:3000/foo/Shares/sharedFile2", + "http:/127.0.0.1:3000/foo/Shares/sharedDir/", + "http:/127.0.0.1:3000/foo/Shares/sharedDir/something", + )) + }) + }) + + Context("with a nested directory space", func() { + JustBeforeEach(func() { + client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return( + func(_ context.Context, req *sprovider.ListStorageSpacesRequest, _ ...grpc.CallOption) *sprovider.ListStorageSpacesResponse { + var spaces []*sprovider.StorageSpace + switch string(req.Opaque.Map["path"].Value) { + case "/", "/foo": + spaces = []*sprovider.StorageSpace{foospace, fooquxspace} + case "/foo/qux": + spaces = []*sprovider.StorageSpace{fooquxspace} + } + return &sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: spaces, + } + }, + nil) + }) + + // Pending, the code for handling missing parents is still missing + PIt("handles children with no parent", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusOK)) + }) + + It("mounts embedded spaces", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(5)) + + root := res.Responses[0] + Expect(root.Href).To(Equal("http:/127.0.0.1:3000/foo/")) + Expect(string(root.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1131")) + + bar := res.Responses[1] + Expect(bar.Href).To(Equal("http:/127.0.0.1:3000/foo/bar")) + Expect(string(bar.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("100")) + + baz := res.Responses[2] + Expect(baz.Href).To(Equal("http:/127.0.0.1:3000/foo/baz")) + Expect(string(baz.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1")) + + dir := res.Responses[3] + Expect(dir.Href).To(Equal("http:/127.0.0.1:3000/foo/dir/")) + Expect(string(dir.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("30")) + + qux := res.Responses[4] + Expect(qux.Href).To(Equal("http:/127.0.0.1:3000/foo/qux/")) + Expect(string(qux.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1000")) + }) + + It("stats the embedded space", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/foo/qux/", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandlePathPropfind(rr, req, "/") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(2)) + + qux := res.Responses[0] + Expect(qux.Href).To(Equal("http:/127.0.0.1:3000/foo/qux/")) + Expect(string(qux.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1000")) + + quux := res.Responses[1] + Expect(quux.Href).To(Equal("http:/127.0.0.1:3000/foo/qux/quux")) + Expect(string(quux.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1000")) + }) + }) + }) + Describe("HandleSpacesPropfind", func() { + JustBeforeEach(func() { + client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return( + func(_ context.Context, req *sprovider.ListStorageSpacesRequest, _ ...grpc.CallOption) *sprovider.ListStorageSpacesResponse { + var spaces []*sprovider.StorageSpace + switch { + case req.Filters[0].Term.(*sprovider.ListStorageSpacesRequest_Filter_Id).Id.OpaqueId == "foospace": + spaces = []*sprovider.StorageSpace{foospace} + default: + spaces = []*sprovider.StorageSpace{} + } + return &sprovider.ListStorageSpacesResponse{ + Status: status.NewOK(ctx), + StorageSpaces: spaces, + } + }, nil) + }) + It("handles invalid space ids", func() { client.On("ListStorageSpaces", mock.Anything, mock.Anything).Return(&sprovider.ListStorageSpacesResponse{ Status: status.NewOK(ctx), @@ -66,8 +635,107 @@ var _ = Describe("Propfind", func() { req, err := http.NewRequest("GET", "/", strings.NewReader("")) Expect(err).ToNot(HaveOccurred()) - handler.HandleSpacesPropfind(rr, req, "foo") + handler.HandleSpacesPropfind(rr, req, "does-not-exist") Expect(rr.Code).To(Equal(http.StatusNotFound)) }) + + It("stats the space root", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandleSpacesPropfind(rr, req, "foospace") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(4)) + + root := res.Responses[0] + Expect(root.Href).To(Equal("http:/127.0.0.1:3000/foospace/")) + Expect(string(root.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("131")) + + bar := res.Responses[1] + Expect(bar.Href).To(Equal("http:/127.0.0.1:3000/foospace/bar")) + Expect(string(bar.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("100")) + + baz := res.Responses[2] + Expect(baz.Href).To(Equal("http:/127.0.0.1:3000/foospace/baz")) + Expect(string(baz.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("1")) + + dir := res.Responses[3] + Expect(dir.Href).To(Equal("http:/127.0.0.1:3000/foospace/dir/")) + Expect(string(dir.Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("30")) + }) + + It("stats a file", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/bar", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandleSpacesPropfind(rr, req, "foospace") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(1)) + Expect(string(res.Responses[0].Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("100")) + }) + + It("stats a directory", func() { + mockStat(&sprovider.Reference{Path: "./baz"}, &sprovider.ResourceInfo{ + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Size: 50, + }) + mockListContainer(&sprovider.Reference{Path: "./baz"}, []*sprovider.ResourceInfo{ + { + Type: sprovider.ResourceType_RESOURCE_TYPE_CONTAINER, + Size: 50, + }, + }) + + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/baz", strings.NewReader("")) + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandleSpacesPropfind(rr, req, "foospace") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(2)) + Expect(string(res.Responses[0].Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("50")) + Expect(string(res.Responses[1].Propstat[0].Prop[0].InnerXML)).To(ContainSubstring("50")) + }) + + It("includes all the things™ when depth is infinity", func() { + rr := httptest.NewRecorder() + req, err := http.NewRequest("GET", "/", strings.NewReader("")) + req.Header.Add(net.HeaderDepth, "infinity") + Expect(err).ToNot(HaveOccurred()) + req = req.WithContext(ctx) + + handler.HandleSpacesPropfind(rr, req, "foospace") + Expect(rr.Code).To(Equal(http.StatusMultiStatus)) + + res, _, err := readResponse(rr.Result().Body) + Expect(err).ToNot(HaveOccurred()) + Expect(len(res.Responses)).To(Equal(5)) + + paths := []string{} + for _, r := range res.Responses { + paths = append(paths, r.Href) + } + Expect(paths).To(ConsistOf( + "http:/127.0.0.1:3000/foospace/", + "http:/127.0.0.1:3000/foospace/bar", + "http:/127.0.0.1:3000/foospace/baz", + "http:/127.0.0.1:3000/foospace/dir/", + "http:/127.0.0.1:3000/foospace/dir/entry", + )) + }) }) }) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending_test.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending_test.go index 8f130da31dc..253370e10fe 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending_test.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending_test.go @@ -33,7 +33,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/stretchr/testify/mock" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_suite_test.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_suite_test.go index 1b681efb77b..a1ac8abba99 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_suite_test.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_suite_test.go @@ -21,7 +21,7 @@ package shares_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_test.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_test.go index 98c723936e0..53ec6744c9b 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_test.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares_test.go @@ -36,7 +36,7 @@ import ( "github.com/cs3org/reva/pkg/rgrpc/status" "github.com/stretchr/testify/mock" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/auth/manager/nextcloud/nextcloud_suite_test.go b/pkg/auth/manager/nextcloud/nextcloud_suite_test.go index 7d75b648796..25baa8ffd58 100644 --- a/pkg/auth/manager/nextcloud/nextcloud_suite_test.go +++ b/pkg/auth/manager/nextcloud/nextcloud_suite_test.go @@ -21,7 +21,7 @@ package nextcloud_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/auth/manager/nextcloud/nextcloud_test.go b/pkg/auth/manager/nextcloud/nextcloud_test.go index e7f7bdfa846..ce10328843d 100644 --- a/pkg/auth/manager/nextcloud/nextcloud_test.go +++ b/pkg/auth/manager/nextcloud/nextcloud_test.go @@ -34,7 +34,7 @@ import ( ctxpkg "github.com/cs3org/reva/pkg/ctx" jwt "github.com/cs3org/reva/pkg/token/manager/jwt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/auth/manager/owncloudsql/accounts/accounts_suite_test.go b/pkg/auth/manager/owncloudsql/accounts/accounts_suite_test.go index 8564f5a515b..05306baa8c8 100644 --- a/pkg/auth/manager/owncloudsql/accounts/accounts_suite_test.go +++ b/pkg/auth/manager/owncloudsql/accounts/accounts_suite_test.go @@ -21,7 +21,7 @@ package accounts_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/auth/manager/owncloudsql/accounts/accounts_test.go b/pkg/auth/manager/owncloudsql/accounts/accounts_test.go index bb00fcbf2f2..02fa613b048 100644 --- a/pkg/auth/manager/owncloudsql/accounts/accounts_test.go +++ b/pkg/auth/manager/owncloudsql/accounts/accounts_test.go @@ -28,7 +28,7 @@ import ( "github.com/cs3org/reva/pkg/auth/manager/owncloudsql/accounts" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/ocm/share/manager/nextcloud/nextcloud_suite_test.go b/pkg/ocm/share/manager/nextcloud/nextcloud_suite_test.go index 7d75b648796..25baa8ffd58 100644 --- a/pkg/ocm/share/manager/nextcloud/nextcloud_suite_test.go +++ b/pkg/ocm/share/manager/nextcloud/nextcloud_suite_test.go @@ -21,7 +21,7 @@ package nextcloud_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/ocm/share/manager/nextcloud/nextcloud_test.go b/pkg/ocm/share/manager/nextcloud/nextcloud_test.go index 2f01928ec2b..847cb0f7ff6 100644 --- a/pkg/ocm/share/manager/nextcloud/nextcloud_test.go +++ b/pkg/ocm/share/manager/nextcloud/nextcloud_test.go @@ -36,7 +36,7 @@ import ( "github.com/cs3org/reva/pkg/ocm/share/manager/nextcloud" jwt "github.com/cs3org/reva/pkg/token/manager/jwt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/share/manager/sql/sql_suite_test.go b/pkg/share/manager/sql/sql_suite_test.go index a7e8fec9500..e890f1cb178 100644 --- a/pkg/share/manager/sql/sql_suite_test.go +++ b/pkg/share/manager/sql/sql_suite_test.go @@ -21,7 +21,7 @@ package sql_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/share/manager/sql/sql_test.go b/pkg/share/manager/sql/sql_test.go index 4f327ed6ad0..ecc386d2ccd 100644 --- a/pkg/share/manager/sql/sql_test.go +++ b/pkg/share/manager/sql/sql_test.go @@ -38,7 +38,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/mock" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/nextcloud/nextcloud_suite_test.go b/pkg/storage/fs/nextcloud/nextcloud_suite_test.go index 7d75b648796..25baa8ffd58 100644 --- a/pkg/storage/fs/nextcloud/nextcloud_suite_test.go +++ b/pkg/storage/fs/nextcloud/nextcloud_suite_test.go @@ -21,7 +21,7 @@ package nextcloud_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/nextcloud/nextcloud_test.go b/pkg/storage/fs/nextcloud/nextcloud_test.go index fb081b05923..21c54de795c 100644 --- a/pkg/storage/fs/nextcloud/nextcloud_test.go +++ b/pkg/storage/fs/nextcloud/nextcloud_test.go @@ -37,7 +37,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/nextcloud" jwt "github.com/cs3org/reva/pkg/token/manager/jwt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/ocis/blobstore/blobstore_suite_test.go b/pkg/storage/fs/ocis/blobstore/blobstore_suite_test.go index 4add51ce11e..46c475e1155 100644 --- a/pkg/storage/fs/ocis/blobstore/blobstore_suite_test.go +++ b/pkg/storage/fs/ocis/blobstore/blobstore_suite_test.go @@ -21,7 +21,7 @@ package blobstore_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/ocis/blobstore/blobstore_test.go b/pkg/storage/fs/ocis/blobstore/blobstore_test.go index 450226a7fa5..fb159dfba59 100644 --- a/pkg/storage/fs/ocis/blobstore/blobstore_test.go +++ b/pkg/storage/fs/ocis/blobstore/blobstore_test.go @@ -27,7 +27,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/ocis/blobstore" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/ocis/ocis_suite_test.go b/pkg/storage/fs/ocis/ocis_suite_test.go index f42a46046ac..d97da9cf3d3 100644 --- a/pkg/storage/fs/ocis/ocis_suite_test.go +++ b/pkg/storage/fs/ocis/ocis_suite_test.go @@ -21,7 +21,7 @@ package ocis_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/ocis/ocis_test.go b/pkg/storage/fs/ocis/ocis_test.go index e2f4e32efcf..b8d1e049a8f 100644 --- a/pkg/storage/fs/ocis/ocis_test.go +++ b/pkg/storage/fs/ocis/ocis_test.go @@ -24,7 +24,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/ocis" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/owncloudsql/filecache/filecache_suite_test.go b/pkg/storage/fs/owncloudsql/filecache/filecache_suite_test.go index 822a699bca3..b739d704d16 100644 --- a/pkg/storage/fs/owncloudsql/filecache/filecache_suite_test.go +++ b/pkg/storage/fs/owncloudsql/filecache/filecache_suite_test.go @@ -21,7 +21,7 @@ package filecache_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/owncloudsql/filecache/filecache_test.go b/pkg/storage/fs/owncloudsql/filecache/filecache_test.go index 4a6eab04381..5c336ca5c20 100644 --- a/pkg/storage/fs/owncloudsql/filecache/filecache_test.go +++ b/pkg/storage/fs/owncloudsql/filecache/filecache_test.go @@ -28,7 +28,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/owncloudsql/filecache" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/s3ng/option_test.go b/pkg/storage/fs/s3ng/option_test.go index 05e0cac43bf..d881baa6e99 100644 --- a/pkg/storage/fs/s3ng/option_test.go +++ b/pkg/storage/fs/s3ng/option_test.go @@ -23,7 +23,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/s3ng" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/s3ng/s3ng_suite_test.go b/pkg/storage/fs/s3ng/s3ng_suite_test.go index c6df7d972c0..299752cde0f 100644 --- a/pkg/storage/fs/s3ng/s3ng_suite_test.go +++ b/pkg/storage/fs/s3ng/s3ng_suite_test.go @@ -21,7 +21,7 @@ package s3ng_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/fs/s3ng/s3ng_test.go b/pkg/storage/fs/s3ng/s3ng_test.go index 697006f8bb2..fc7cadc7e77 100644 --- a/pkg/storage/fs/s3ng/s3ng_test.go +++ b/pkg/storage/fs/s3ng/s3ng_test.go @@ -24,7 +24,7 @@ import ( "github.com/cs3org/reva/pkg/storage/fs/s3ng" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/registry/spaces/spaces_suite_test.go b/pkg/storage/registry/spaces/spaces_suite_test.go index 0c51b61eb08..c8b42c2d5c0 100644 --- a/pkg/storage/registry/spaces/spaces_suite_test.go +++ b/pkg/storage/registry/spaces/spaces_suite_test.go @@ -21,7 +21,7 @@ package spaces_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/registry/spaces/spaces_test.go b/pkg/storage/registry/spaces/spaces_test.go index a329a2c12f2..0c7f98e7019 100644 --- a/pkg/storage/registry/spaces/spaces_test.go +++ b/pkg/storage/registry/spaces/spaces_test.go @@ -33,7 +33,7 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/grpc" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/registry/static/static_suite_test.go b/pkg/storage/registry/static/static_suite_test.go index 686ccf33604..6b3cca08ea3 100644 --- a/pkg/storage/registry/static/static_suite_test.go +++ b/pkg/storage/registry/static/static_suite_test.go @@ -21,7 +21,7 @@ package static_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/registry/static/static_test.go b/pkg/storage/registry/static/static_test.go index 8fe22a7c5ee..3fb7deab04f 100644 --- a/pkg/storage/registry/static/static_test.go +++ b/pkg/storage/registry/static/static_test.go @@ -27,7 +27,7 @@ import ( ctxpkg "github.com/cs3org/reva/pkg/ctx" "github.com/cs3org/reva/pkg/storage/registry/static" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/ace/ace_suite_test.go b/pkg/storage/utils/ace/ace_suite_test.go index 62778e0ba39..b7ee0e2a416 100644 --- a/pkg/storage/utils/ace/ace_suite_test.go +++ b/pkg/storage/utils/ace/ace_suite_test.go @@ -21,7 +21,7 @@ package ace_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/ace/ace_test.go b/pkg/storage/utils/ace/ace_test.go index 724cbe1c876..a5340ca1b7e 100644 --- a/pkg/storage/utils/ace/ace_test.go +++ b/pkg/storage/utils/ace/ace_test.go @@ -26,7 +26,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/cs3org/reva/pkg/storage/utils/ace" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/decomposedfs_concurrency_test.go b/pkg/storage/utils/decomposedfs/decomposedfs_concurrency_test.go index 8cae5c42f6e..9f9e7b85354 100644 --- a/pkg/storage/utils/decomposedfs/decomposedfs_concurrency_test.go +++ b/pkg/storage/utils/decomposedfs/decomposedfs_concurrency_test.go @@ -29,7 +29,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/decomposedfs_suite_test.go b/pkg/storage/utils/decomposedfs/decomposedfs_suite_test.go index 9ea8f67dddd..87d937e5571 100644 --- a/pkg/storage/utils/decomposedfs/decomposedfs_suite_test.go +++ b/pkg/storage/utils/decomposedfs/decomposedfs_suite_test.go @@ -21,7 +21,7 @@ package decomposedfs_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/decomposedfs_test.go b/pkg/storage/utils/decomposedfs/decomposedfs_test.go index 0c501723562..b0cd93d8249 100644 --- a/pkg/storage/utils/decomposedfs/decomposedfs_test.go +++ b/pkg/storage/utils/decomposedfs/decomposedfs_test.go @@ -26,7 +26,7 @@ import ( helpers "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/testhelpers" treemocks "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/tree/mocks" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/grants_test.go b/pkg/storage/utils/decomposedfs/grants_test.go index c063ef4c9cd..4b28c740e02 100644 --- a/pkg/storage/utils/decomposedfs/grants_test.go +++ b/pkg/storage/utils/decomposedfs/grants_test.go @@ -28,7 +28,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" helpers "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/testhelpers" "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/xattrs" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/xattr" "github.com/stretchr/testify/mock" diff --git a/pkg/storage/utils/decomposedfs/lookup_test.go b/pkg/storage/utils/decomposedfs/lookup_test.go index 34ce78efe17..28954453831 100644 --- a/pkg/storage/utils/decomposedfs/lookup_test.go +++ b/pkg/storage/utils/decomposedfs/lookup_test.go @@ -22,7 +22,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" helpers "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/testhelpers" "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/xattrs" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/node/locks_test.go b/pkg/storage/utils/decomposedfs/node/locks_test.go index 4512964113c..d86c677ad29 100644 --- a/pkg/storage/utils/decomposedfs/node/locks_test.go +++ b/pkg/storage/utils/decomposedfs/node/locks_test.go @@ -23,7 +23,7 @@ import ( "os" "github.com/google/uuid" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" diff --git a/pkg/storage/utils/decomposedfs/node/node_suite_test.go b/pkg/storage/utils/decomposedfs/node/node_suite_test.go index 6fd6e84f432..b8b294924a6 100644 --- a/pkg/storage/utils/decomposedfs/node/node_suite_test.go +++ b/pkg/storage/utils/decomposedfs/node/node_suite_test.go @@ -21,7 +21,7 @@ package node_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/node/node_test.go b/pkg/storage/utils/decomposedfs/node/node_test.go index 11c0ac9c48a..4cf5420cf3f 100644 --- a/pkg/storage/utils/decomposedfs/node/node_test.go +++ b/pkg/storage/utils/decomposedfs/node/node_test.go @@ -27,7 +27,7 @@ import ( "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/node" helpers "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/testhelpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/options/options_suite_test.go b/pkg/storage/utils/decomposedfs/options/options_suite_test.go index 233675759f7..a038d0fe1c9 100644 --- a/pkg/storage/utils/decomposedfs/options/options_suite_test.go +++ b/pkg/storage/utils/decomposedfs/options/options_suite_test.go @@ -21,7 +21,7 @@ package options_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/options/options_test.go b/pkg/storage/utils/decomposedfs/options/options_test.go index a74825c2b65..0ff86610f28 100644 --- a/pkg/storage/utils/decomposedfs/options/options_test.go +++ b/pkg/storage/utils/decomposedfs/options/options_test.go @@ -21,7 +21,7 @@ package options_test import ( "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/options" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/recycle_test.go b/pkg/storage/utils/decomposedfs/recycle_test.go index c50967e181d..dc03d7a1394 100644 --- a/pkg/storage/utils/decomposedfs/recycle_test.go +++ b/pkg/storage/utils/decomposedfs/recycle_test.go @@ -26,7 +26,7 @@ import ( ctxpkg "github.com/cs3org/reva/pkg/ctx" "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/mocks" helpers "github.com/cs3org/reva/pkg/storage/utils/decomposedfs/testhelpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/stretchr/testify/mock" ) diff --git a/pkg/storage/utils/decomposedfs/tree/tree_suite_test.go b/pkg/storage/utils/decomposedfs/tree/tree_suite_test.go index ef20ab4f6e4..53cd4d51525 100644 --- a/pkg/storage/utils/decomposedfs/tree/tree_suite_test.go +++ b/pkg/storage/utils/decomposedfs/tree/tree_suite_test.go @@ -21,7 +21,7 @@ package tree_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/tree/tree_test.go b/pkg/storage/utils/decomposedfs/tree/tree_test.go index 6f245254bf4..75fe4460d42 100644 --- a/pkg/storage/utils/decomposedfs/tree/tree_test.go +++ b/pkg/storage/utils/decomposedfs/tree/tree_test.go @@ -31,7 +31,7 @@ import ( "github.com/pkg/xattr" "github.com/stretchr/testify/mock" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/storage/utils/decomposedfs/upload_test.go b/pkg/storage/utils/decomposedfs/upload_test.go index 1db9dc21abd..074cd68e96a 100644 --- a/pkg/storage/utils/decomposedfs/upload_test.go +++ b/pkg/storage/utils/decomposedfs/upload_test.go @@ -42,7 +42,7 @@ import ( "github.com/pkg/xattr" "github.com/stretchr/testify/mock" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/user/manager/nextcloud/nextcloud_suite_test.go b/pkg/user/manager/nextcloud/nextcloud_suite_test.go index 7d75b648796..25baa8ffd58 100644 --- a/pkg/user/manager/nextcloud/nextcloud_suite_test.go +++ b/pkg/user/manager/nextcloud/nextcloud_suite_test.go @@ -21,7 +21,7 @@ package nextcloud_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/user/manager/nextcloud/nextcloud_test.go b/pkg/user/manager/nextcloud/nextcloud_test.go index 1ce00082b4c..2e2f9069803 100644 --- a/pkg/user/manager/nextcloud/nextcloud_test.go +++ b/pkg/user/manager/nextcloud/nextcloud_test.go @@ -32,7 +32,7 @@ import ( "github.com/cs3org/reva/pkg/user/manager/nextcloud" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/user/manager/owncloudsql/accounts/accounts_suite_test.go b/pkg/user/manager/owncloudsql/accounts/accounts_suite_test.go index 8564f5a515b..05306baa8c8 100644 --- a/pkg/user/manager/owncloudsql/accounts/accounts_suite_test.go +++ b/pkg/user/manager/owncloudsql/accounts/accounts_suite_test.go @@ -21,7 +21,7 @@ package accounts_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/user/manager/owncloudsql/accounts/accounts_test.go b/pkg/user/manager/owncloudsql/accounts/accounts_test.go index 61819b966fa..0b01939389e 100644 --- a/pkg/user/manager/owncloudsql/accounts/accounts_test.go +++ b/pkg/user/manager/owncloudsql/accounts/accounts_test.go @@ -28,7 +28,7 @@ import ( "github.com/cs3org/reva/pkg/user/manager/owncloudsql/accounts" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tests/integration/grpc/gateway_storageprovider_static_test.go b/tests/integration/grpc/gateway_storageprovider_static_test.go index 7cab4add866..a3881f6bf76 100644 --- a/tests/integration/grpc/gateway_storageprovider_static_test.go +++ b/tests/integration/grpc/gateway_storageprovider_static_test.go @@ -34,7 +34,7 @@ import ( "github.com/cs3org/reva/pkg/rgrpc/todo/pool" jwt "github.com/cs3org/reva/pkg/token/manager/jwt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tests/integration/grpc/gateway_storageprovider_test.go b/tests/integration/grpc/gateway_storageprovider_test.go index af7df5ec76a..8265e1c1e86 100644 --- a/tests/integration/grpc/gateway_storageprovider_test.go +++ b/tests/integration/grpc/gateway_storageprovider_test.go @@ -39,7 +39,7 @@ import ( jwt "github.com/cs3org/reva/pkg/token/manager/jwt" "github.com/cs3org/reva/tests/helpers" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tests/integration/grpc/grpc_suite_test.go b/tests/integration/grpc/grpc_suite_test.go index 8ea909a50fe..042725da660 100644 --- a/tests/integration/grpc/grpc_suite_test.go +++ b/tests/integration/grpc/grpc_suite_test.go @@ -33,7 +33,7 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tests/integration/grpc/storageprovider_test.go b/tests/integration/grpc/storageprovider_test.go index 978486676e7..c7399b32c7d 100644 --- a/tests/integration/grpc/storageprovider_test.go +++ b/tests/integration/grpc/storageprovider_test.go @@ -36,7 +36,7 @@ import ( "github.com/cs3org/reva/tests/helpers" "github.com/google/uuid" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tests/integration/grpc/userprovider_test.go b/tests/integration/grpc/userprovider_test.go index 1de51e683f3..95a7e520f2b 100644 --- a/tests/integration/grpc/userprovider_test.go +++ b/tests/integration/grpc/userprovider_test.go @@ -29,7 +29,7 @@ import ( jwt "github.com/cs3org/reva/pkg/token/manager/jwt" "google.golang.org/grpc/metadata" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" )