1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
13 func FakeManifest(dirCount, filesPerDir, blocksPerFile, interleaveChunk int) string {
14 const blksize = 1 << 26
15 mb := bytes.NewBuffer(make([]byte, 0, 40000000))
17 for i := 0; i < dirCount; i++ {
18 fmt.Fprintf(mb, "./dir%d", i)
19 for j := 0; j < filesPerDir; j++ {
20 for k := 0; k < blocksPerFile; k++ {
22 fmt.Fprintf(mb, " %032x+%d+A%040x@%08x", blkid, blksize, blkid, blkid)
25 for j := 0; j < filesPerDir; j++ {
26 if interleaveChunk == 0 {
27 fmt.Fprintf(mb, " %d:%d:dir%d/file%d", (filesPerDir-j-1)*blocksPerFile*blksize, blocksPerFile*blksize, j, j)
30 for todo := int64(blocksPerFile) * int64(blksize); todo > 0; todo -= int64(interleaveChunk) {
31 size := int64(interleaveChunk)
35 offset := rand.Int63n(int64(blocksPerFile)*int64(blksize)*int64(filesPerDir) - size)
36 fmt.Fprintf(mb, " %d:%d:dir%d/file%d", offset, size, j, j)
39 mb.Write([]byte{'\n'})