testOptions creates DmverityOptions for testing with common defaults
(superblock bool, hashOffset uint64)
| 220 | |
| 221 | // testOptions creates DmverityOptions for testing with common defaults |
| 222 | func 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 |
| 240 | func createTempFile(t *testing.T, data []byte) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…