(t *testing.T)
| 651 | } |
| 652 | |
| 653 | func TestInternalCacheWrites(t *testing.T) { |
| 654 | id := "ticw" |
| 655 | rootFs, boltDb := runInstance.newCacheFs(t, remoteName, id, false, true, map[string]string{"writes": "true"}) |
| 656 | |
| 657 | cfs, err := runInstance.getCacheFs(rootFs) |
| 658 | require.NoError(t, err) |
| 659 | chunkSize := cfs.ChunkSize() |
| 660 | |
| 661 | // create some rand test data |
| 662 | earliestTime := time.Now() |
| 663 | testData := randStringBytes(int(chunkSize*4 + chunkSize/2)) |
| 664 | runInstance.writeRemoteBytes(t, rootFs, "data.bin", testData) |
| 665 | expectedTs := time.Now() |
| 666 | ts, err := boltDb.GetChunkTs(runInstance.encryptRemoteIfNeeded(t, path.Join(rootFs.Root(), "data.bin")), 0) |
| 667 | require.NoError(t, err) |
| 668 | require.WithinDuration(t, expectedTs, ts, expectedTs.Sub(earliestTime)) |
| 669 | } |
| 670 | |
| 671 | func TestInternalMaxChunkSizeRespected(t *testing.T) { |
| 672 | if runtime.GOOS == "windows" && runtime.GOARCH == "386" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…