feat(ci): test consistency command

Signed-off-by: jkoberg <jkoberg@owncloud.com>
Co-authored-by: dragonchaser <crichter@owncloud.com>
This commit is contained in:
jkoberg
2024-05-23 15:49:46 +02:00
parent ca12c2faa2
commit ada83f9338
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -1163,6 +1163,7 @@ def e2eTestPipeline(ctx):
},
"commands": [
"cd %s/tests/e2e" % dirs["web"],
"ocis backup consistency -p /var/lib/ocis/storage/users",
],
}
+9
View File
@@ -1,11 +1,14 @@
package command
import (
"errors"
"fmt"
ocisbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/backup"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/urfave/cli/v2"
@@ -19,6 +22,9 @@ func BackupCommand(cfg *config.Config) *cli.Command {
Subcommands: []*cli.Command{
ConsistencyCommand(cfg),
},
Before: func(c *cli.Context) error {
return configlog.ReturnError(parser.ParseConfig(cfg, false))
},
Action: func(_ *cli.Context) error {
fmt.Println("Read the docs")
return nil
@@ -42,6 +48,7 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
Name: "blobstore",
Aliases: []string{"b"},
Usage: "the blobstore type. Can be (ocis, s3ng). Default ocis",
Value: "ocis",
},
},
Action: func(c *cli.Context) error {
@@ -67,6 +74,8 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
)
case "ocis":
bs, err = ocisbs.New(basePath)
default:
err = errors.New("blobstore type not supported")
}
if err != nil {
fmt.Println(err)