Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
4d3b5b6b
Commit
4d3b5b6b
authored
Oct 09, 2018
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unionfs: make tests more idiomatic
These two tests failed in recent travis runs.
parent
849b50c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+10
-10
No files found.
unionfs/unionfs_test.go
View file @
4d3b5b6b
...
...
@@ -812,28 +812,28 @@ func TestUnionFsCopyChmod(t *testing.T) {
fn
:=
wd
+
"/mnt/y"
err
:=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
contents
),
0644
)
if
err
!=
nil
{
t
.
Fatalf
(
"WriteFile
failed: %v"
,
err
)
t
.
Fatalf
(
"WriteFile
(%v): %v"
,
fn
,
err
)
}
err
=
os
.
Chmod
(
fn
,
0755
)
if
err
!=
nil
{
t
.
Fatalf
(
"Chmod
failed: %v"
,
err
)
t
.
Fatalf
(
"Chmod
(%v): %v"
,
fn
,
err
)
}
fi
,
err
:=
os
.
Lstat
(
fn
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat
failed: %v"
,
err
)
t
.
Fatalf
(
"Lstat
(%v): %v"
,
fn
,
err
)
}
if
fi
.
Mode
()
&
0111
==
0
{
t
.
Errorf
(
"
1st attr error %o"
,
fi
.
Mode
())
t
.
Errorf
(
"
Lstat(%v): mode %o"
,
fn
,
fi
.
Mode
())
}
time
.
Sleep
(
entryTtl
)
fi
,
err
=
os
.
Lstat
(
fn
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat
failed: %v"
,
err
)
t
.
Fatalf
(
"Lstat
(%v) after sleep: %v"
,
fn
,
err
)
}
if
fi
.
Mode
()
&
0111
==
0
{
t
.
Errorf
(
"
uncached attr error %o"
,
fi
.
Mode
())
t
.
Errorf
(
"
Lstat(%v) after sleep: mode %o"
,
fn
,
fi
.
Mode
())
}
}
...
...
@@ -852,23 +852,23 @@ func TestUnionFsTruncateTimestamp(t *testing.T) {
fn
:=
wd
+
"/mnt/y"
err
:=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
contents
),
0644
)
if
err
!=
nil
{
t
.
Fatalf
(
"WriteFile
failed: %v"
,
err
)
t
.
Fatalf
(
"WriteFile
(%v): %v"
,
fn
,
err
)
}
time
.
Sleep
(
200
*
time
.
Millisecond
)
truncTs
:=
time
.
Now
()
err
=
os
.
Truncate
(
fn
,
3
)
if
err
!=
nil
{
t
.
Fatalf
(
"Truncate
failed: %v"
,
err
)
t
.
Fatalf
(
"Truncate
(%v): %v"
,
fn
,
err
)
}
fi
,
err
:=
os
.
Lstat
(
fn
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat
failed: %v"
,
err
)
t
.
Fatalf
(
"Lstat
(%v): %v"
,
fn
,
err
)
}
if
truncTs
.
Sub
(
fi
.
ModTime
())
>
100
*
time
.
Millisecond
{
t
.
Error
(
"timestamp drift"
,
truncTs
,
fi
.
ModTime
()
)
t
.
Error
f
(
"after Truncate: got TS %v, want %v"
,
fi
.
ModTime
(),
truncTs
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment