tpm-helpers/backend/socket_test.go
Ettore Di Giacinto 1ab3e10e4d
Add backends and simulated TPM device
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-02-17 12:33:01 +01:00

30 lines
554 B
Go

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())
})
})
})