Test creating temporary file inside read-only directory
(t *testing.T)
| 15 | |
| 16 | // Test creating temporary file inside read-only directory |
| 17 | func TestReadOnlyDir(t *testing.T) { |
| 18 | ffs := fs.NewFilesystem(fs.FilesystemTypeFake, rand.String(32)) |
| 19 | ffs.Mkdir("testdir", 0o555) |
| 20 | |
| 21 | s := sharedPullerState{ |
| 22 | fs: ffs, |
| 23 | tempName: "testdir/.temp_name", |
| 24 | } |
| 25 | |
| 26 | fd, err := s.tempFile() |
| 27 | if err != nil { |
| 28 | t.Fatal(err) |
| 29 | } |
| 30 | if fd == nil { |
| 31 | t.Fatal("Unexpected nil fd") |
| 32 | } |
| 33 | |
| 34 | s.fail(nil) |
| 35 | s.finalClose() |
| 36 | } |
nothing calls this directly
no test coverage detected