mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-09 23:42:20 +08:00
introduce concept of filedescriptors to mfs, adjust fuse code to use them
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -88,7 +88,7 @@ func checkExists(t *testing.T, path string) {
|
||||
}
|
||||
}
|
||||
|
||||
func closeMount(mnt *fstest.Mount) {
|
||||
func closeMount(mnt *mountWrap) {
|
||||
if err := recover(); err != nil {
|
||||
log.Error("Recovered panic")
|
||||
log.Error(err)
|
||||
@ -96,7 +96,18 @@ func closeMount(mnt *fstest.Mount) {
|
||||
mnt.Close()
|
||||
}
|
||||
|
||||
func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *fstest.Mount) {
|
||||
type mountWrap struct {
|
||||
*fstest.Mount
|
||||
Fs *FileSystem
|
||||
}
|
||||
|
||||
func (m *mountWrap) Close() error {
|
||||
m.Fs.Destroy()
|
||||
m.Mount.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *mountWrap) {
|
||||
maybeSkipFuseTests(t)
|
||||
|
||||
var err error
|
||||
@ -129,7 +140,10 @@ func setupIpnsTest(t *testing.T, node *core.IpfsNode) (*core.IpfsNode, *fstest.M
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
return node, mnt
|
||||
return node, &mountWrap{
|
||||
Mount: mnt,
|
||||
Fs: fs,
|
||||
}
|
||||
}
|
||||
|
||||
func TestIpnsLocalLink(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user