Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Mar 9, 2022
1 parent 67a1716 commit bfdae74
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/storage/utils/decomposedfs/spaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ package decomposedfs_test
import (
permissionsv1beta1 "github.com/cs3org/go-cs3apis/cs3/permissions/v1beta1"
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
helpers "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/testhelpers"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/mock"
)

var _ = Describe("Home is Created", func() {
var _ = Describe("Create Spaces", func() {
var (
env *helpers.TestEnv
)
Expand Down Expand Up @@ -55,4 +56,15 @@ var _ = Describe("Home is Created", func() {
Expect(resp[0].SpaceType).To(Equal("personal"))
})
})
Context("when creating a space", func() {
It("project space is created", func() {
resp, err := env.Fs.CreateStorageSpace(env.Ctx, &provider.CreateStorageSpaceRequest{Name: "Mission to Mars", Type: "project"})
Expect(err).ToNot(HaveOccurred())
Expect(resp.Status.Code).To(Equal(rpcv1beta1.Code_CODE_OK))
Expect(resp.StorageSpace).ToNot(Equal(nil))
Expect(string(resp.StorageSpace.Opaque.Map["spaceAlias"].Value)).To(Equal("project/mission-to-mars"))
Expect(resp.StorageSpace.Name).To(Equal("Mission to Mars"))
Expect(resp.StorageSpace.SpaceType).To(Equal("project"))
})
})
})
2 changes: 2 additions & 0 deletions tests/oc-integration-tests/drone/storage-users-ocis.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ root = "/drone/src/tmp/reva/data"
treetime_accounting = true
treesize_accounting = true
permissionssvc = "localhost:10000"
personalspacealias_template = "{{.SpaceType}}/{{.User.Username}}"
generalspacealias_template = "{{.SpaceType}}/{{.SpaceName | replace \" \" \"-\" | lower}}"

# we have a locally running dataprovider
[http]
Expand Down
2 changes: 2 additions & 0 deletions tests/oc-integration-tests/local/storage-users.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ root = "/var/tmp/reva/data"
treetime_accounting = true
treesize_accounting = true
permissionssvc = "localhost:10000"
personalspacealias_template = "{{.SpaceType}}/{{.User.Username}}"
generalspacealias_template = "{{.SpaceType}}/{{.SpaceName | replace \" \" \"-\" | lower}}"

# we have a locally running dataprovider
[http]
Expand Down

0 comments on commit bfdae74

Please sign in to comment.