testWritebackLargeFile writes a large file (multi-chunk) with writebackCache
(t *testing.T, framework *FuseTestFramework)
| 138 | |
| 139 | // testWritebackLargeFile writes a large file (multi-chunk) with writebackCache |
| 140 | func testWritebackLargeFile(t *testing.T, framework *FuseTestFramework) { |
| 141 | filename := "writeback_large.bin" |
| 142 | mountPath := filepath.Join(framework.GetMountPoint(), filename) |
| 143 | |
| 144 | // 8MB file (spans multiple 2MB chunks) |
| 145 | content := make([]byte, 8*1024*1024) |
| 146 | _, err := rand.Read(content) |
| 147 | require.NoError(t, err) |
| 148 | |
| 149 | require.NoError(t, os.WriteFile(mountPath, content, 0644)) |
| 150 | |
| 151 | // Wait for file to be fully flushed |
| 152 | waitForFileContent(t, mountPath, content, 60*time.Second) |
| 153 | } |
| 154 | |
| 155 | // testWritebackEmptyFile creates an empty file with writebackCache |
| 156 | func testWritebackEmptyFile(t *testing.T, framework *FuseTestFramework) { |
no test coverage detected