MCPcopy
hub / github.com/containerd/containerd / testOptions

Function testOptions

internal/dmverity/dmverity_test.go:222–237  ·  view source on GitHub ↗

testOptions creates DmverityOptions for testing with common defaults

(superblock bool, hashOffset uint64)

Source from the content-addressed store, hash-verified

220
221// testOptions creates DmverityOptions for testing with common defaults
222func testOptions(superblock bool, hashOffset uint64) DmverityOptions {
223 opts := DmverityOptions{
224 Salt: "0000000000000000000000000000000000000000000000000000000000000000",
225 HashAlgorithm: "sha256",
226 DataBlockSize: 4096,
227 HashBlockSize: 4096,
228 DataBlocks: 256,
229 HashOffset: hashOffset,
230 HashType: 1,
231 NoSuperblock: !superblock,
232 }
233 if superblock {
234 opts.UUID = "12345678-1234-1234-1234-123456789012"
235 }
236 return opts
237}
238
239// createTempFile creates a temporary file with optional data, returns file path and cleanup function
240func createTempFile(t *testing.T, data []byte) string {

Callers 1

TestDMVerityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…