1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
10 "git.arvados.org/arvados.git/sdk/go/arvados"
11 "git.arvados.org/arvados.git/sdk/go/arvadosclient"
12 "git.arvados.org/arvados.git/sdk/go/ctxlog"
13 "git.arvados.org/arvados.git/sdk/go/keepclient"
14 "github.com/arvados/cgofuse/fuse"
15 check "gopkg.in/check.v1"
18 // Gocheck boilerplate
19 func Test(t *testing.T) {
23 var _ = check.Suite(&FSSuite{})
27 func (*FSSuite) TestFuseInterface(c *check.C) {
28 var _ fuse.FileSystemInterface = &keepFS{}
31 func (*FSSuite) TestOpendir(c *check.C) {
32 client := arvados.NewClientFromEnv()
33 ac, err := arvadosclient.New(client)
34 c.Assert(err, check.IsNil)
35 kc, err := keepclient.MakeKeepClient(ac)
36 c.Assert(err, check.IsNil)
38 var fs fuse.FileSystemInterface = &keepFS{
41 Logger: ctxlog.TestLogger(c),
44 errc, fh := fs.Opendir("/by_id")
45 c.Check(errc, check.Equals, 0)
46 c.Check(fh, check.Not(check.Equals), uint64(0))
47 c.Check(fh, check.Not(check.Equals), invalidFH)
48 errc, fh = fs.Opendir("/bogus")
49 c.Check(errc, check.Equals, -fuse.ENOENT)
50 c.Check(fh, check.Equals, invalidFH)