client flow

This commit is contained in:
2026-03-19 19:40:45 +00:00
parent 8c00a42663
commit 93527bb725
5 changed files with 377 additions and 0 deletions

View File

@@ -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 {