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

fuse/test: testTtl -> testTTL

parent 4e73fb9a
...@@ -39,7 +39,7 @@ type testCase struct { ...@@ -39,7 +39,7 @@ type testCase struct {
connector *nodefs.FileSystemConnector connector *nodefs.FileSystemConnector
} }
const testTtl = 100 * time.Millisecond const testTTL = 100 * time.Millisecond
// Mkdir is a utility wrapper for os.Mkdir, aborting the test if it fails. // Mkdir is a utility wrapper for os.Mkdir, aborting the test if it fails.
func (tc *testCase) Mkdir(name string, mode os.FileMode) { func (tc *testCase) Mkdir(name string, mode os.FileMode) {
...@@ -92,8 +92,8 @@ func NewTestCase(t *testing.T) *testCase { ...@@ -92,8 +92,8 @@ func NewTestCase(t *testing.T) *testCase {
ClientInodes: true}) ClientInodes: true})
tc.connector = nodefs.NewFileSystemConnector(tc.pathFs.Root(), tc.connector = nodefs.NewFileSystemConnector(tc.pathFs.Root(),
&nodefs.Options{ &nodefs.Options{
EntryTimeout: testTtl, EntryTimeout: testTTL,
AttrTimeout: testTtl, AttrTimeout: testTTL,
NegativeTimeout: 0.0, NegativeTimeout: 0.0,
Debug: testutil.VerboseTest(), Debug: testutil.VerboseTest(),
LookupKnownChildren: true, LookupKnownChildren: true,
...@@ -947,7 +947,7 @@ func TestLookupKnownChildrenAttrCopied(t *testing.T) { ...@@ -947,7 +947,7 @@ func TestLookupKnownChildrenAttrCopied(t *testing.T) {
t.Fatalf("WriteFile: %v", err) t.Fatalf("WriteFile: %v", err)
} }
mode := fi.Mode() mode := fi.Mode()
time.Sleep(2 * testTtl) time.Sleep(2 * testTTL)
if fi, err = os.Lstat(tc.mountFile); err != nil { if fi, err = os.Lstat(tc.mountFile); err != nil {
t.Fatalf("Lstat: %v", err) t.Fatalf("Lstat: %v", err)
......
...@@ -124,7 +124,7 @@ func TestRecursiveMount(t *testing.T) { ...@@ -124,7 +124,7 @@ func TestRecursiveMount(t *testing.T) {
// We can't avoid a sleep here: the file handle release is not // We can't avoid a sleep here: the file handle release is not
// synchronized. // synchronized.
t.Log("Waiting for kernel to flush file-close to fuse...") t.Log("Waiting for kernel to flush file-close to fuse...")
time.Sleep(testTtl) time.Sleep(testTTL)
code = ts.pathFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if code != fuse.OK { if code != fuse.OK {
...@@ -163,7 +163,7 @@ func TestDeletedUnmount(t *testing.T) { ...@@ -163,7 +163,7 @@ func TestDeletedUnmount(t *testing.T) {
} }
f.Close() f.Close()
time.Sleep((3 * testTtl) / 2) time.Sleep((3 * testTTL) / 2)
code = ts.pathFs.Unmount("mnt") code = ts.pathFs.Unmount("mnt")
if !code.Ok() { if !code.Ok() {
t.Error("should succeed", code) t.Error("should succeed", code)
......
...@@ -79,11 +79,11 @@ func NewNotifyTest(t *testing.T) *NotifyTest { ...@@ -79,11 +79,11 @@ func NewNotifyTest(t *testing.T) *NotifyTest {
me := &NotifyTest{} me := &NotifyTest{}
me.fs = newNotifyFs() me.fs = newNotifyFs()
me.dir = testutil.TempDir() me.dir = testutil.TempDir()
entryTtl := 100 * time.Millisecond entryTTL := 100 * time.Millisecond
opts := &nodefs.Options{ opts := &nodefs.Options{
EntryTimeout: entryTtl, EntryTimeout: entryTTL,
AttrTimeout: entryTtl, AttrTimeout: entryTTL,
NegativeTimeout: entryTtl, NegativeTimeout: entryTTL,
Debug: testutil.VerboseTest(), Debug: testutil.VerboseTest(),
} }
......
...@@ -50,8 +50,8 @@ func TestUmask(t *testing.T) { ...@@ -50,8 +50,8 @@ func TestUmask(t *testing.T) {
ClientInodes: true}) ClientInodes: true})
connector := nodefs.NewFileSystemConnector(pathFs.Root(), connector := nodefs.NewFileSystemConnector(pathFs.Root(),
&nodefs.Options{ &nodefs.Options{
EntryTimeout: testTtl, EntryTimeout: testTTL,
AttrTimeout: testTtl, AttrTimeout: testTTL,
NegativeTimeout: 0.0, NegativeTimeout: 0.0,
Debug: testutil.VerboseTest(), Debug: testutil.VerboseTest(),
LookupKnownChildren: true, LookupKnownChildren: true,
......
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