mirror of
https://github.com/kairos-io/tpm-helpers.git
synced 2025-07-07 19:48:37 +00:00
26 lines
642 B
Go
26 lines
642 B
Go
package tpm_test
|
|
|
|
import (
|
|
. "github.com/kairos-io/tpm-helpers"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("TPM NV", func() {
|
|
Context("NV store", func() {
|
|
It("stores a blob and get it back", func() {
|
|
By("Storing the blob", func() {
|
|
// authwrite matters here!
|
|
err := StoreBlob([]byte("foo"), EmulatedTPM, WithIndex("0x1500000"))
|
|
Expect(err).ToNot(HaveOccurred())
|
|
})
|
|
By("Reading the blob", func() {
|
|
foo, err := ReadBlob(WithIndex("0x1500000"), EmulatedTPM)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
Expect(foo).To(Equal([]byte("foo")))
|
|
})
|
|
CloseEmulatedDevice()
|
|
})
|
|
})
|
|
})
|