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/keepclient"
13 "github.com/arvados/cgofuse/fuse"
14 check "gopkg.in/check.v1"
17 // Gocheck boilerplate
18 func Test(t *testing.T) {
22 var _ = check.Suite(&FSSuite{})
26 func (*FSSuite) TestFuseInterface(c *check.C) {
27 var _ fuse.FileSystemInterface = &keepFS{}
30 func (*FSSuite) TestOpendir(c *check.C) {
31 client := arvados.NewClientFromEnv()
32 ac, err := arvadosclient.New(client)
33 c.Assert(err, check.IsNil)
34 kc, err := keepclient.MakeKeepClient(ac)
35 c.Assert(err, check.IsNil)
37 var fs fuse.FileSystemInterface = &keepFS{
42 errc, fh := fs.Opendir("/by_id")
43 c.Check(errc, check.Equals, 0)
44 c.Check(fh, check.Not(check.Equals), uint64(0))
45 c.Check(fh, check.Not(check.Equals), invalidFH)
46 errc, fh = fs.Opendir("/bogus")
47 c.Check(errc, check.Equals, -fuse.ENOENT)
48 c.Check(fh, check.Equals, invalidFH)