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
e78f4a07
Commit
e78f4a07
authored
Dec 23, 2015
by
Yongwoo Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loopback: add testing for before epoch
parent
0de6a433
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
fuse/test/loopback_linux_test.go
fuse/test/loopback_linux_test.go
+31
-1
No files found.
fuse/test/loopback_linux_test.go
View file @
e78f4a07
...
...
@@ -32,6 +32,37 @@ func TestTouch(t *testing.T) {
}
}
func
TestNegativeTime
(
t
*
testing
.
T
)
{
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
_
,
err
:=
os
.
Create
(
ts
.
origFile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Create failed: %v"
,
err
)
}
var
stat
syscall
.
Stat_t
// set negative nanosecond will occur errors on UtimesNano as invalid argument
ut
:=
time
.
Date
(
1960
,
time
.
January
,
10
,
23
,
0
,
0
,
0
,
time
.
UTC
)
tim
:=
[]
syscall
.
Timespec
{
syscall
.
NsecToTimespec
(
ut
.
UnixNano
()),
syscall
.
NsecToTimespec
(
ut
.
UnixNano
()),
}
err
=
syscall
.
UtimesNano
(
ts
.
mountFile
,
tim
)
if
err
!=
nil
{
t
.
Fatalf
(
"UtimesNano failed: %v"
,
err
)
}
err
=
syscall
.
Lstat
(
ts
.
mountFile
,
&
stat
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat failed: %v"
,
err
)
}
if
stat
.
Atim
.
Sec
>=
0
||
stat
.
Mtim
.
Sec
>=
0
{
t
.
Errorf
(
"Got wrong timestamps %v"
,
stat
)
}
}
func
clearStatfs
(
s
*
syscall
.
Statfs_t
)
{
empty
:=
syscall
.
Statfs_t
{}
s
.
Type
=
0
...
...
@@ -44,7 +75,6 @@ func clearStatfs(s *syscall.Statfs_t) {
func
TestFallocate
(
t
*
testing
.
T
)
{
ts
:=
NewTestCase
(
t
)
defer
ts
.
Cleanup
()
if
ts
.
state
.
KernelSettings
()
.
Minor
<
19
{
t
.
Log
(
"FUSE does not support Fallocate."
)
return
...
...
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