client flow
This commit is contained in:
@@ -185,6 +185,27 @@ func TestUnusedAccountCandidates(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildFstabLine(t *testing.T) {
|
||||
line := buildFstabLine(CIFSMountConfig{
|
||||
Server: "fileserver",
|
||||
Share: "media",
|
||||
MountPoint: "/mnt/media",
|
||||
Username: "alice",
|
||||
Password: "p@ ss,word",
|
||||
UID: "1000",
|
||||
GID: "1000",
|
||||
FileMode: "0664",
|
||||
DirMode: "0775",
|
||||
AutoMount: true,
|
||||
ReadOnly: false,
|
||||
})
|
||||
|
||||
want := "//fileserver/media /mnt/media cifs username=alice,password=p@\\040ss\\,word,iocharset=utf8,uid=1000,gid=1000,file_mode=0664,dir_mode=0775,rw 0 0"
|
||||
if line != want {
|
||||
t.Fatalf("unexpected fstab line:\nwant: %s\ngot: %s", want, line)
|
||||
}
|
||||
}
|
||||
|
||||
type execErr string
|
||||
|
||||
func (e execErr) Error() string {
|
||||
|
||||
Reference in New Issue
Block a user