Documentation ¶
Overview ¶
Package test provides helper methods for testing. It should never be included in non-test libraries/binaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //go:embed eventlogs/arch-linux-workstation.bin ArchLinuxWorkstationEventLog []byte //go:embed eventlogs/debian-10.bin Debian10EventLog []byte //go:embed eventlogs/glinux-alex.bin GlinuxAlexEventLog []byte //go:embed eventlogs/rhel8-uefi.bin Rhel8EventLog []byte //go:embed eventlogs/ubuntu-2104-no-dbx.bin Ubuntu2104NoDbxEventLog []byte //go:embed eventlogs/ubuntu-2104-no-secure-boot.bin Ubuntu2104NoSecureBootEventLog []byte )
Raw binary TCG Event Logs
var ( DebugPCR = 16 ApplicationPCR = 23 )
PCR registers that are OK to use in tests (can be reset without reboot)
Functions ¶
func GetTPM ¶
func GetTPM(tb testing.TB) io.ReadWriteCloser
GetTPM is a cross-platform testing helper function that retrives the appropriate TPM device from the flags passed into "go test".
If using a test TPM, this will also retrieve a test eventlog. In this case, GetTPM extends the test event log's events into the test TPM.
func LoadRandomExternalKey ¶
LoadRandomExternalKey loads a randomly generated external key into the TPM simulator and returns its' handle. If any errors occur, calls Fatal() on the passed testing.TB.
func SkipOnUnsupportedAlg ¶
SkipOnUnsupportedAlg skips the test if the algorithm is not found in the TPM capability.
Types ¶
This section is empty.