mirror of
https://github.com/kairos-io/tpm-helpers.git
synced 2025-06-28 07:26:53 +00:00
30 lines
551 B
Go
30 lines
551 B
Go
package backend_test
|
|
|
|
import (
|
|
"os"
|
|
|
|
. "github.com/kairos-io/tpm-helpers/backend"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("SWTPM", func() {
|
|
socket := os.Getenv("TPM_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())
|
|
})
|
|
})
|
|
})
|