Skip to content
Permalink
Browse files

Merge pull request #3 from jfontan/connection

Reuse gluster connection for all tests
  • Loading branch information...
jfontan committed Jan 4, 2019
2 parents 130898d + 5b6aa18 commit 06fe134f2fdf20ad0290c92496f68c0e8133e8bb
Showing with 13 additions and 6 deletions.
  1. +13 −6 filesystem_test.go
@@ -21,15 +21,25 @@ type FilesystemSuite struct {
tmp string
}

func (s *FilesystemSuite) SetUpTest(c *C) {
func (s *FilesystemSuite) SetUpSuite(c *C) {
fs, err := New("localhost", "billy")
c.Assert(err, IsNil)
s.FS = fs
}

func (s *FilesystemSuite) TearDownSuite(c *C) {
if s.FS != nil {
err := s.FS.Close()
c.Assert(err, IsNil)
}
}

s.tmp, err = util.TempDir(fs, "", "billy")
func (s *FilesystemSuite) SetUpTest(c *C) {
var err error
s.tmp, err = util.TempDir(s.FS, "", "billy")
c.Assert(err, IsNil)

tmp := chroot.New(fs, s.tmp)
tmp := chroot.New(s.FS, s.tmp)
s.BasicSuite.FS = tmp
s.DirSuite.FS = tmp
}
@@ -38,9 +48,6 @@ func (s *FilesystemSuite) TearDownTest(c *C) {
if s.FS != nil {
err := util.RemoveAll(s.FS, s.tmp)
c.Assert(err, IsNil)

err = s.FS.Close()
c.Assert(err, IsNil)
}
}

0 comments on commit 06fe134

Please sign in to comment.
You can’t perform that action at this time.