Commit e093cf0f authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Rename var.

parent 9b069ce5
...@@ -33,7 +33,7 @@ type testCase struct { ...@@ -33,7 +33,7 @@ type testCase struct {
origSubdir string origSubdir string
tester *testing.T tester *testing.T
state *MountState state *MountState
nodeFs *PathNodeFs pathFs *PathNodeFs
connector *FileSystemConnector connector *FileSystemConnector
} }
...@@ -69,8 +69,8 @@ func NewTestCase(t *testing.T) *testCase { ...@@ -69,8 +69,8 @@ func NewTestCase(t *testing.T) *testCase {
pfs = NewLockingFileSystem(pfs) pfs = NewLockingFileSystem(pfs)
var rfs RawFileSystem var rfs RawFileSystem
me.nodeFs = NewPathNodeFs(pfs) me.pathFs = NewPathNodeFs(pfs)
me.connector = NewFileSystemConnector(me.nodeFs, me.connector = NewFileSystemConnector(me.pathFs,
&FileSystemOptions{ &FileSystemOptions{
EntryTimeout: testTtl, EntryTimeout: testTtl,
AttrTimeout: testTtl, AttrTimeout: testTtl,
...@@ -101,7 +101,7 @@ func (me *testCase) Cleanup() { ...@@ -101,7 +101,7 @@ func (me *testCase) Cleanup() {
} }
func (me *testCase) rootNode() *Inode { func (me *testCase) rootNode() *Inode {
return me.nodeFs.Root().Inode() return me.pathFs.Root().Inode()
} }
//////////////// ////////////////
......
...@@ -28,7 +28,7 @@ func TestMountOnExisting(t *testing.T) { ...@@ -28,7 +28,7 @@ func TestMountOnExisting(t *testing.T) {
t.Fatal("expect OK:", code) t.Fatal("expect OK:", code)
} }
ts.nodeFs.Unmount("mnt") ts.pathFs.Unmount("mnt")
} }
func TestMountRename(t *testing.T) { func TestMountRename(t *testing.T) {
...@@ -44,7 +44,7 @@ func TestMountRename(t *testing.T) { ...@@ -44,7 +44,7 @@ func TestMountRename(t *testing.T) {
if OsErrorToErrno(err) != EBUSY { if OsErrorToErrno(err) != EBUSY {
t.Fatal("rename mount point should fail with EBUSY:", err) t.Fatal("rename mount point should fail with EBUSY:", err)
} }
ts.nodeFs.Unmount("mnt") ts.pathFs.Unmount("mnt")
} }
func TestMountReaddir(t *testing.T) { func TestMountReaddir(t *testing.T) {
...@@ -62,7 +62,7 @@ func TestMountReaddir(t *testing.T) { ...@@ -62,7 +62,7 @@ func TestMountReaddir(t *testing.T) {
if len(entries) != 1 || entries[0].Name != "mnt" { if len(entries) != 1 || entries[0].Name != "mnt" {
t.Error("wrong readdir result", entries) t.Error("wrong readdir result", entries)
} }
ts.nodeFs.Unmount("mnt") ts.pathFs.Unmount("mnt")
} }
func TestRecursiveMount(t *testing.T) { func TestRecursiveMount(t *testing.T) {
...@@ -87,7 +87,7 @@ func TestRecursiveMount(t *testing.T) { ...@@ -87,7 +87,7 @@ func TestRecursiveMount(t *testing.T) {
f, err := os.Open(filepath.Join(submnt, "hello.txt")) f, err := os.Open(filepath.Join(submnt, "hello.txt"))
CheckSuccess(err) CheckSuccess(err)
log.Println("Attempting unmount, should fail") log.Println("Attempting unmount, should fail")
code = ts.nodeFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if code != EBUSY { if code != EBUSY {
t.Error("expect EBUSY") t.Error("expect EBUSY")
} }
...@@ -98,7 +98,7 @@ func TestRecursiveMount(t *testing.T) { ...@@ -98,7 +98,7 @@ func TestRecursiveMount(t *testing.T) {
time.Sleep(1.5e9 * testTtl) time.Sleep(1.5e9 * testTtl)
log.Println("Attempting unmount, should succeed") log.Println("Attempting unmount, should succeed")
code = ts.nodeFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if code != OK { if code != OK {
t.Error("umount failed.", code) t.Error("umount failed.", code)
} }
...@@ -125,14 +125,14 @@ func TestDeletedUnmount(t *testing.T) { ...@@ -125,14 +125,14 @@ func TestDeletedUnmount(t *testing.T) {
_, err = f.Write([]byte("bla")) _, err = f.Write([]byte("bla"))
CheckSuccess(err) CheckSuccess(err)
code = ts.nodeFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if code != EBUSY { if code != EBUSY {
t.Error("expect EBUSY for unmount with open files", code) t.Error("expect EBUSY for unmount with open files", code)
} }
f.Close() f.Close()
time.Sleep(1.5e9 * testTtl) time.Sleep(1.5e9 * testTtl)
code = ts.nodeFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if !code.Ok() { if !code.Ok() {
t.Error("should succeed", code) t.Error("should succeed", code)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment