Commit f612a450 authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher

fs: add TestRoMount

Also add a test if "ro" works directly in the fs
package.

Currently fails like this (will be fixed later):

	--- FAIL: TestRoMount (0.01s)
	    simple_test.go:116: read-only file syste

Change-Id: I8194360b1d092268784b9c2b17de274b86633aa2
parent e836da11
...@@ -380,3 +380,8 @@ func TestParallelDiropsHang(t *testing.T) { ...@@ -380,3 +380,8 @@ func TestParallelDiropsHang(t *testing.T) {
wg.Wait() wg.Wait()
server.Unmount() server.Unmount()
} }
func TestRoMount(t *testing.T) {
tc := newTestCase(t, &testOptions{ro: true})
defer tc.Clean()
}
...@@ -53,6 +53,7 @@ type testOptions struct { ...@@ -53,6 +53,7 @@ type testOptions struct {
attrCache bool attrCache bool
suppressDebug bool suppressDebug bool
testDir string testDir string
ro bool
} }
// newTestCase creates the directories `orig` and `mnt` inside a temporary // newTestCase creates the directories `orig` and `mnt` inside a temporary
...@@ -102,6 +103,9 @@ func newTestCase(t *testing.T, opts *testOptions) *testCase { ...@@ -102,6 +103,9 @@ func newTestCase(t *testing.T, opts *testOptions) *testCase {
if !opts.suppressDebug { if !opts.suppressDebug {
mOpts.Debug = testutil.VerboseTest() mOpts.Debug = testutil.VerboseTest()
} }
if opts.ro {
mOpts.Options = append(mOpts.Options, "ro")
}
tc.server, err = fuse.NewServer(tc.rawFS, tc.mntDir, mOpts) tc.server, err = fuse.NewServer(tc.rawFS, tc.mntDir, mOpts)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
......
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