Documentation
¶
Index ¶
- func AlignUp(x, align uint64) uint64
- func ApplySalt(saltHex string, maxSaltSize int) ([]byte, uint16, error)
- func ApplyUUID(uuidStr string, generateIfEmpty bool, noSuperblock bool, ...) ([16]byte, error)
- func AttachLoopDevice(backingFile string) (string, error)
- func CalculateDataBlocks(dataPath string, userSpecified uint64, dataBlockSize uint32) (uint64, error)
- func CreateFormattedFiles(t *testing.T) (dataPath, hashPath, rootHex string)
- func DetachLoopDevice(devices ...string) error
- func ExtractRootHex(t *testing.T, out string) string
- func FirstLine(s string) string
- func GetBitsDown(u uint32) uint
- func GetBlockOrFileSize(path string) (int64, error)
- func IsBlockSizeValid(size uint32) bool
- func MakeTempFile(t *testing.T, size int64) string
- func MaskVerityDevices(s string) string
- func OpenVerityDevice(t *testing.T, params VerityTestParams, ...)
- func ParseRootHash(rootHex string) ([]byte, error)
- func ParseSaltHex(saltHex string, maxSaltSize int) ([]byte, error)
- func RequireRoot(t *testing.T)
- func RequireTool(t *testing.T, name string) string
- func RunCmd(t *testing.T, name string, args ...string) (string, string)
- func RunGoCLI(t *testing.T, args ...string) (string, string)
- func SelectHashSize(name string) int
- func SetupLoopDevice(path string) (string, func(), error)
- func Uint64MultOverflow(a, b uint64) bool
- func ValidateDataHashOverlap(dataBlocks uint64, dataBlockSize uint32, hashAreaOffset uint64, ...) error
- func ValidateHashOffset(hashAreaOffset uint64, hashBlockSize uint32, noSuperblock bool) error
- func ValidateRootHashSize(rootDigest []byte, hashName string) error
- func VerifyDeviceRemoved(t *testing.T, name string)
- type DMDeviceCleanup
- type LoopParams
- type VerityTestParams
- func (p VerityTestParams) BuildCVeritysetupOpenArgs(dataLoop, name, hashLoop, rootHex string) []string
- func (p VerityTestParams) BuildCVeritysetupVerifyArgs(data, hash, rootHex string) []string
- func (p VerityTestParams) BuildOpenArgs(dataLoop, name, hashLoop, rootHex string) []string
- func (p VerityTestParams) BuildVerifyArgs(data, hash, rootHex string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachLoopDevice ¶
AttachLoopDevice attaches a specified backing file to a loop device
func CalculateDataBlocks ¶
func CreateFormattedFiles ¶
func DetachLoopDevice ¶
DetachLoopDevice detaches the provided loop devices
func GetBitsDown ¶
func GetBlockOrFileSize ¶
func IsBlockSizeValid ¶
func MaskVerityDevices ¶
func OpenVerityDevice ¶
func OpenVerityDevice(t *testing.T, params VerityTestParams, dataLoop, name, hashLoop, rootHex string)
func ParseRootHash ¶
func RequireRoot ¶
func SelectHashSize ¶
func SetupLoopDevice ¶
func Uint64MultOverflow ¶
func ValidateDataHashOverlap ¶
func ValidateHashOffset ¶
func ValidateRootHashSize ¶
func VerifyDeviceRemoved ¶
Types ¶
type DMDeviceCleanup ¶
type DMDeviceCleanup struct {
// contains filtered or unexported fields
}
func NewDMDeviceCleanup ¶
func NewDMDeviceCleanup(t *testing.T) *DMDeviceCleanup
func (*DMDeviceCleanup) Add ¶
func (c *DMDeviceCleanup) Add(device string) string
func (*DMDeviceCleanup) Cleanup ¶
func (c *DMDeviceCleanup) Cleanup()
type LoopParams ¶
type LoopParams struct {
// Loop device should forbid write
Readonly bool
// Loop device is automatically cleared by kernel when the
// last opener closes it
Autoclear bool
// Use direct IO to access the loop backing file
Direct bool
}
LoopParams parameters to control loop device setup
type VerityTestParams ¶
type VerityTestParams struct {
Hash string
DataBlockSize string
HashBlockSize string
Salt string
NoSuperblock bool
HashOffset string
}
func DefaultVerityTestParams ¶
func DefaultVerityTestParams() VerityTestParams
func (VerityTestParams) BuildCVeritysetupOpenArgs ¶
func (p VerityTestParams) BuildCVeritysetupOpenArgs(dataLoop, name, hashLoop, rootHex string) []string
func (VerityTestParams) BuildCVeritysetupVerifyArgs ¶
func (p VerityTestParams) BuildCVeritysetupVerifyArgs(data, hash, rootHex string) []string
func (VerityTestParams) BuildOpenArgs ¶
func (p VerityTestParams) BuildOpenArgs(dataLoop, name, hashLoop, rootHex string) []string
func (VerityTestParams) BuildVerifyArgs ¶
func (p VerityTestParams) BuildVerifyArgs(data, hash, rootHex string) []string
Click to show internal directories.
Click to hide internal directories.