MCPcopy Create free account
hub / github.com/tailscale/tailscale / TestFileManipulation

Function TestFileManipulation

drive/driveimpl/drive_test.go:95–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestFileManipulation(t *testing.T) {
96 s := newSystem(t)
97
98 s.addRemote(remote1)
99 s.addShare(remote1, share11, drive.PermissionReadWrite)
100 s.writeFile("writing file to read/write remote should succeed", remote1, share11, file111, "hello world", true)
101 s.checkFileStatus(remote1, share11, file111)
102 s.checkFileContents(remote1, share11, file111)
103
104 s.renameFile("renaming file across shares should fail", remote1, share11, file111, share12, file112, false)
105
106 s.renameFile("renaming file in same share should succeed", remote1, share11, file111, share11, file112, true)
107 s.checkFileContents(remote1, share11, file112)
108
109 s.addShare(remote1, share12, drive.PermissionReadOnly)
110 s.writeFile("writing file to non-existent remote should fail", "non-existent", share11, file111, "hello world", false)
111 s.writeFile("writing file to non-existent share should fail", remote1, "non-existent", file111, "hello world", false)
112}
113
114func TestPermissions(t *testing.T) {
115 s := newSystem(t)

Callers

nothing calls this directly

Calls 7

newSystemFunction · 0.85
addRemoteMethod · 0.80
addShareMethod · 0.80
writeFileMethod · 0.80
checkFileStatusMethod · 0.80
checkFileContentsMethod · 0.80
renameFileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…