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
Kirill Smelkov
go-fuse
Commits
d822ee41
Commit
d822ee41
authored
Oct 10, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorten /mount to /mnt in unionfs tests.
parent
62094b64
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
223 additions
and
223 deletions
+223
-223
unionfs/autounion_test.go
unionfs/autounion_test.go
+19
-19
unionfs/memunionfs_test.go
unionfs/memunionfs_test.go
+92
-92
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+112
-112
No files found.
unionfs/autounion_test.go
View file @
d822ee41
...
...
@@ -30,7 +30,7 @@ func WriteFile(name string, contents string) {
func
setup
(
t
*
testing
.
T
)
(
workdir
string
,
cleanup
func
())
{
wd
,
_
:=
ioutil
.
TempDir
(
""
,
""
)
err
:=
os
.
Mkdir
(
wd
+
"/m
ou
nt"
,
0700
)
err
:=
os
.
Mkdir
(
wd
+
"/mnt"
,
0700
)
fuse
.
CheckSuccess
(
err
)
err
=
os
.
Mkdir
(
wd
+
"/store"
,
0700
)
...
...
@@ -42,7 +42,7 @@ func setup(t *testing.T) (workdir string, cleanup func()) {
WriteFile
(
wd
+
"/ro/file2"
,
"file2"
)
fs
:=
NewAutoUnionFs
(
wd
+
"/store"
,
testAOpts
)
state
,
conn
,
err
:=
fuse
.
MountPathFileSystem
(
wd
+
"/m
ou
nt"
,
fs
,
&
testAOpts
.
FileSystemOptions
)
state
,
conn
,
err
:=
fuse
.
MountPathFileSystem
(
wd
+
"/mnt"
,
fs
,
&
testAOpts
.
FileSystemOptions
)
CheckSuccess
(
err
)
state
.
Debug
=
fuse
.
VerboseTest
()
conn
.
Debug
=
fuse
.
VerboseTest
()
...
...
@@ -58,7 +58,7 @@ func TestVersion(t *testing.T) {
wd
,
clean
:=
setup
(
t
)
defer
clean
()
c
,
err
:=
ioutil
.
ReadFile
(
wd
+
"/m
ou
nt/status/gounionfs_version"
)
c
,
err
:=
ioutil
.
ReadFile
(
wd
+
"/mnt/status/gounionfs_version"
)
CheckSuccess
(
err
)
if
len
(
c
)
==
0
{
t
.
Fatal
(
"No version found."
)
...
...
@@ -76,36 +76,36 @@ func TestAutoFsSymlink(t *testing.T) {
err
=
os
.
Symlink
(
wd
+
"/ro"
,
wd
+
"/store/backing1/READONLY"
)
CheckSuccess
(
err
)
err
=
os
.
Symlink
(
wd
+
"/store/backing1"
,
wd
+
"/m
ou
nt/config/manual1"
)
err
=
os
.
Symlink
(
wd
+
"/store/backing1"
,
wd
+
"/mnt/config/manual1"
)
CheckSuccess
(
err
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/m
ou
nt/manual1/file1"
)
fi
,
err
:=
os
.
Lstat
(
wd
+
"/mnt/manual1/file1"
)
CheckSuccess
(
err
)
entries
,
err
:=
ioutil
.
ReadDir
(
wd
+
"/m
ou
nt"
)
entries
,
err
:=
ioutil
.
ReadDir
(
wd
+
"/mnt"
)
CheckSuccess
(
err
)
if
len
(
entries
)
!=
3
{
t
.
Error
(
"readdir mismatch"
,
entries
)
}
err
=
os
.
Remove
(
wd
+
"/m
ou
nt/config/manual1"
)
err
=
os
.
Remove
(
wd
+
"/mnt/config/manual1"
)
CheckSuccess
(
err
)
scan
:=
wd
+
"/m
ou
nt/config/"
+
_SCAN_CONFIG
scan
:=
wd
+
"/mnt/config/"
+
_SCAN_CONFIG
err
=
ioutil
.
WriteFile
(
scan
,
[]
byte
(
"something"
),
0644
)
if
err
!=
nil
{
t
.
Error
(
"error writing:"
,
err
)
}
fi
,
_
=
os
.
Lstat
(
wd
+
"/m
ou
nt/manual1"
)
fi
,
_
=
os
.
Lstat
(
wd
+
"/mnt/manual1"
)
if
fi
!=
nil
{
t
.
Error
(
"Should not have file:"
,
fi
)
}
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/m
ou
nt/config"
)
_
,
err
=
ioutil
.
ReadDir
(
wd
+
"/mnt/config"
)
CheckSuccess
(
err
)
_
,
err
=
os
.
Lstat
(
wd
+
"/m
ou
nt/backing1/file1"
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mnt/backing1/file1"
)
CheckSuccess
(
err
)
}
...
...
@@ -122,13 +122,13 @@ func TestDetectSymlinkedDirectories(t *testing.T) {
err
=
os
.
Symlink
(
wd
+
"/backing1"
,
wd
+
"/store/backing1"
)
CheckSuccess
(
err
)
scan
:=
wd
+
"/m
ou
nt/config/"
+
_SCAN_CONFIG
scan
:=
wd
+
"/mnt/config/"
+
_SCAN_CONFIG
err
=
ioutil
.
WriteFile
(
scan
,
[]
byte
(
"something"
),
0644
)
if
err
!=
nil
{
t
.
Error
(
"error writing:"
,
err
)
}
_
,
err
=
os
.
Lstat
(
wd
+
"/m
ou
nt/backing1"
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mnt/backing1"
)
CheckSuccess
(
err
)
}
...
...
@@ -141,12 +141,12 @@ func TestExplicitScan(t *testing.T) {
os
.
Symlink
(
wd
+
"/ro"
,
wd
+
"/store/backing1/READONLY"
)
CheckSuccess
(
err
)
fi
,
_
:=
os
.
Lstat
(
wd
+
"/m
ou
nt/backing1"
)
fi
,
_
:=
os
.
Lstat
(
wd
+
"/mnt/backing1"
)
if
fi
!=
nil
{
t
.
Error
(
"Should not have file:"
,
fi
)
}
scan
:=
wd
+
"/m
ou
nt/config/"
+
_SCAN_CONFIG
scan
:=
wd
+
"/mnt/config/"
+
_SCAN_CONFIG
_
,
err
=
os
.
Lstat
(
scan
)
if
err
!=
nil
{
t
.
Error
(
".scan_config missing:"
,
err
)
...
...
@@ -157,7 +157,7 @@ func TestExplicitScan(t *testing.T) {
t
.
Error
(
"error writing:"
,
err
)
}
_
,
err
=
os
.
Lstat
(
wd
+
"/m
ou
nt/backing1"
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mnt/backing1"
)
if
err
!=
nil
{
t
.
Error
(
"Should have workspace backing1:"
,
err
)
}
...
...
@@ -177,16 +177,16 @@ func TestCreationChecks(t *testing.T) {
os
.
Symlink
(
wd
+
"/ro"
,
wd
+
"/store/ws2/READONLY"
)
CheckSuccess
(
err
)
err
=
os
.
Symlink
(
wd
+
"/store/foo"
,
wd
+
"/m
ou
nt/config/bar"
)
err
=
os
.
Symlink
(
wd
+
"/store/foo"
,
wd
+
"/mnt/config/bar"
)
CheckSuccess
(
err
)
err
=
os
.
Symlink
(
wd
+
"/store/foo"
,
wd
+
"/m
ou
nt/config/foo"
)
err
=
os
.
Symlink
(
wd
+
"/store/foo"
,
wd
+
"/mnt/config/foo"
)
code
:=
fuse
.
OsErrorToErrno
(
err
)
if
code
!=
fuse
.
EBUSY
{
t
.
Error
(
"Should return EBUSY"
,
err
)
}
err
=
os
.
Symlink
(
wd
+
"/store/ws2"
,
wd
+
"/m
ou
nt/config/config"
)
err
=
os
.
Symlink
(
wd
+
"/store/ws2"
,
wd
+
"/mnt/config/config"
)
code
=
fuse
.
OsErrorToErrno
(
err
)
if
code
!=
fuse
.
EINVAL
{
t
.
Error
(
"Should return EINVAL"
,
err
)
...
...
unionfs/memunionfs_test.go
View file @
d822ee41
This diff is collapsed.
Click to expand it.
unionfs/unionfs_test.go
View file @
d822ee41
This diff is collapsed.
Click to expand it.
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