Commit 4edb751b authored by Levin Zimmermann's avatar Levin Zimmermann

fuse/mount_linux_test/DirectMount: Verify FsName \w comma/backslash works

In https://github.com/hanwen/go-fuse/commit/90b055af4668fce08c961406c32c15bbd7953fe4 we adjusted go-fuse to support fusermount
string options with commas and backslash. But https://github.com/hanwen/go-fuse/commit/90b055af4668fce08c961406c32c15bbd7953fe4
only verified that commas and backslashs work with fusermount and
missed checking if they also work when using 'DirectMount'.

Initially this may not look problematic, because the option string escaping
with backslashs is only applied when mounting with fusermount and isn't
applied when directly mounting [1].

But https://github.com/hanwen/go-fuse/commit/90b055af4668fce08c961406c32c15bbd7953fe4 also dropped an explicit check for commas [2]
which would have been applied independently from whether 'DirectMount' is
set or not. In other words, the previous patch changed go-fuse to allow commas
and backslashs in option strings for 'DirectMount' or fusermount, but missed
checking if commas/backslashs actually works with 'DirectMount'.

This patch therefore amends 'TestDirectMount' to ensure commas and
backslashs work in the 'fsname' option when 'DirectMount' is used.

[1] https://github.com/hanwen/go-fuse/blob/90b055a/fuse/mount_linux.go#L107
[2] https://github.com/hanwen/go-fuse/blob/854d591/fuse/server.go#L188-L192

Change-Id: I78c612c55fb08be66713cd5234a8ffd468dd1349
parent 90b055af
......@@ -159,6 +159,9 @@ func TestDirectMount(t *testing.T) {
{Debug: true, FsName: "aaa"},
{Debug: true, Name: "bbb"},
{Debug: true, FsName: "ccc", Name: "ddd"},
{Debug: true, FsName: "a,b"},
{Debug: true, FsName: `a\b`},
{Debug: true, FsName: `a\,b`},
}
for _, opts := range optsTable {
// Without DirectMount - i.e. using fusermount
......
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