mirror of
https://github.com/kairos-io/tpm-helpers.git
synced 2025-09-20 16:58:19 +00:00
Add backends and simulated TPM device
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
This commit is contained in:
29
backend/socket_test.go
Normal file
29
backend/socket_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package backend_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
. "github.com/rancher-sandbox/go-tpm/backend"
|
||||
)
|
||||
|
||||
var _ = Describe("SWTPM", func() {
|
||||
socket := os.Getenv("SWTPM_SOCKET")
|
||||
Context("opening socket connection", func() {
|
||||
It("fails on invalid files", func() {
|
||||
|
||||
_, err := Socket("foobar")
|
||||
Expect(err).To(HaveOccurred())
|
||||
|
||||
})
|
||||
|
||||
It("dials in just fine", func() {
|
||||
if socket == "" {
|
||||
Skip("No socket file specified")
|
||||
}
|
||||
_, err := Socket(socket)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user