Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
55d02a11
Commit
55d02a11
authored
Sep 09, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StatFSTest.Syscall_NonZeroValues
parent
5b359358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletion
+39
-1
samples/statfs/statfs_test.go
samples/statfs/statfs_test.go
+39
-1
No files found.
samples/statfs/statfs_test.go
View file @
55d02a11
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"syscall"
"syscall"
"testing"
"testing"
"github.com/jacobsa/fuse/fuseops"
"github.com/jacobsa/fuse/fuseutil"
"github.com/jacobsa/fuse/fuseutil"
"github.com/jacobsa/fuse/samples"
"github.com/jacobsa/fuse/samples"
"github.com/jacobsa/fuse/samples/statfs"
"github.com/jacobsa/fuse/samples/statfs"
...
@@ -109,7 +110,44 @@ func (t *StatFSTest) Syscall_ZeroValues() {
...
@@ -109,7 +110,44 @@ func (t *StatFSTest) Syscall_ZeroValues() {
}
}
func
(
t
*
StatFSTest
)
Syscall_NonZeroValues
()
{
func
(
t
*
StatFSTest
)
Syscall_NonZeroValues
()
{
AssertTrue
(
false
,
"TODO"
)
var
err
error
var
stat
syscall
.
Statfs_t
// Set up the canned response.
canned
:=
fuseops
.
StatFSOp
{
BlockSize
:
1
<<
15
,
Blocks
:
1
<<
51
+
3
,
BlocksFree
:
1
<<
43
+
5
,
BlocksAvailable
:
1
<<
41
+
7
,
Inodes
:
1
<<
59
+
11
,
InodesFree
:
1
<<
58
+
13
,
}
t
.
fs
.
SetStatFSResponse
(
canned
)
// Compute the canonicalized directory, for use below.
canonicalDir
,
err
:=
filepath
.
EvalSymlinks
(
t
.
Dir
)
AssertEq
(
nil
,
err
)
canonicalDir
=
path
.
Clean
(
canonicalDir
)
// Stat.
err
=
syscall
.
Statfs
(
t
.
Dir
,
&
stat
)
AssertEq
(
nil
,
err
)
ExpectEq
(
4096
,
stat
.
Bsize
)
// OS X seems to always make this 4096.
ExpectEq
(
canned
.
BlockSize
,
stat
.
Iosize
)
ExpectEq
(
canned
.
Blocks
,
stat
.
Blocks
)
ExpectEq
(
canned
.
BlocksFree
,
stat
.
Bfree
)
ExpectEq
(
canned
.
BlocksAvailable
,
stat
.
Bavail
)
ExpectEq
(
canned
.
Inodes
,
stat
.
Files
)
ExpectEq
(
canned
.
InodesFree
,
stat
.
Ffree
)
ExpectEq
(
"osxfusefs"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectThat
(
convertName
(
stat
.
Mntfromname
[
:
]),
MatchesRegexp
(
`mount_osxfusefs@osxfuse\d+`
))
}
}
func
(
t
*
StatFSTest
)
CapacityAndFreeSpace
()
{
func
(
t
*
StatFSTest
)
CapacityAndFreeSpace
()
{
...
...
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