Skip to content

Commit

Permalink
fix remaining tests
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Sep 9, 2024
1 parent 3cf2115 commit 572a577
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion pkg/ocm/share/repository/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/internal/http/services/owncloud/ocs/conversions"
"google.golang.org/genproto/protobuf/field_mask"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/fieldmaskpb"

"github.com/cs3org/reva/pkg/ocm/share"
Expand Down Expand Up @@ -632,7 +633,7 @@ func TestGetShare(t *testing.T) {
}

if tt.err == nil {
if !reflect.DeepEqual(got, tt.expected) {
if !proto.Equal(got, tt.expected) {
t.Fatalf("shares do not match. got=%+v expected=%+v", render.AsCode(got), render.AsCode(tt.expected))
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/registry/dynamic/dynamic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ var _ = Describe("Dynamic storage provider", func() {
Path: "/non/existent",
})
Expect(err).To(HaveOccurred())
Expect(err).To(MatchError(errtypes.NotFound("storage provider not found for ref path:\"/non/existent\" ")))
Expect(err.Error()).To(Equal("error: not found: storage provider not found for ref path:\"/non/existent\""))
})
})
})
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/utils/grants/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import (

provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/pkg/storage/utils/acl"
"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/proto"
)

// GetACLPerm generates a string representation of CS3APIs' ResourcePermissions,
// modeled after the EOS ACLs.
// TODO(labkode): fine grained permission controls.
func GetACLPerm(set *provider.ResourcePermissions) (string, error) {
// resource permission is denied
if cmp.Equal(provider.ResourcePermissions{}, *set) {
if proto.Equal(&provider.ResourcePermissions{}, set) {
return "!r!w!x!m!u!d", nil
}

Expand Down Expand Up @@ -129,10 +129,10 @@ func GetGranteeType(aclType string) provider.GranteeType {

// PermissionsEqual returns true if the permissions are equal.
func PermissionsEqual(p1, p2 *provider.ResourcePermissions) bool {
return p1 != nil && p2 != nil && cmp.Equal(*p1, *p2)
return p1 != nil && p2 != nil && proto.Equal(p1, p2)
}

// GranteeEqual returns true if the grantee are equal.
func GranteeEqual(g1, g2 *provider.Grantee) bool {
return g1 != nil && g2 != nil && cmp.Equal(*g1, *g2)
return g1 != nil && g2 != nil && proto.Equal(g1, g2)
}

0 comments on commit 572a577

Please sign in to comment.